File tree Expand file tree Collapse file tree 7 files changed +472
-198
lines changed Expand file tree Collapse file tree 7 files changed +472
-198
lines changed Original file line number Diff line number Diff line change 1- /tests export-ignore
1+ # Autodetect text files
2+ * text =auto
3+
4+
5+ # ...Unless the name matches the following overriding patterns
6+
7+ # Definitively text files
8+ * .php text
9+ * .css text
10+ * .js text
11+ * .txt text
12+ * .md text
13+ * .xml text
14+ * .json text
15+ * .bat text
16+ * .sql text
17+ * .yml text
18+
19+
20+ # Ensure those won't be messed up with
21+ * .png binary
22+ * .jpg binary
23+ * .gif binary
24+ * .ttf binary
25+
26+
27+ # Ignore some meta files when creating an archive of this repository
228/.editorconfig export-ignore
329/.gitattributes export-ignore
430/.gitignore export-ignore
31+ /phpunit.xml export-ignore
32+ /phpcs.xml export-ignore
33+ /phpmd.xml export-ignore
534/.travis.yml export-ignore
635/.scrutinizer.yml export-ignore
7- /phpunit.xml.dist export-ignore
8- /phpcs.xml.dist export-ignore
9- /phpmd.xml.dist export-ignore
36+
37+
38+ # Avoid merge conflicts in CHANGELOG
39+ # https://about.gitlab.com/2015/02/10/gitlab-reduced-merge-conflicts-by-90-percent-with-changelog-placeholders/
40+ /CHANGELOG.md merge =union
Original file line number Diff line number Diff line change 11DotArray Change Log
22=====================
33
4+ 1.0.4 December 30, 2018
5+ -----------------------------
6+
7+ - Refactoring DotArray:
8+ - Using a Trait (DotPathTrait) to split code in more organized units.
9+ - Refactor DotArray::mergeRecursive :: less ` if ... else ` branches.
10+ - Refactor DotArray::normalize :: now is recursive and if type of the entry is DotArray then is converted to array.
11+ - Apply DotArray::normalize after every DotArray::write used when DotArray::set is called.
12+ - Fix composer.json ` create-folders ` script :: in case of fail creating the ` build ` folder, exit with code 0.
13+ - Updating README.md
14+ - Updating Tests
15+
4161.0.3 December 28, 2018
517-----------------------------
618
Original file line number Diff line number Diff line change @@ -118,6 +118,25 @@ DotArray::create(['config' => ['some.dotted.key' => 'value']])->get('config.{som
118118 $dot[' books.{sci-fi & fantasy}' ] = [];
119119 ```
120120
121+ - **merge**:
122+ - ```php
123+ // Example 1.
124+ $dot->merge([' key_1' => [' some_key' => ' some_value' ]]);
125+
126+ // Example 2.
127+ $dot->merge(
128+ [
129+ ' key_1' => [' some_key' => ' some_value' ],
130+ ],
131+ [
132+ ' key_2' => [' some_key' => ' some_value' ],
133+ ],
134+ [
135+ ' key_n' => [' some_key' => ' some_value' ]
136+ ],
137+ );
138+ ```
139+
121140- **delete** *(unset(...))*:
122141 - ```php
123142 $dot->delete(' books.{sci-fi & fantasy}' );
@@ -213,6 +232,58 @@ DotArray::create(['config' => ['some.dotted.key' => 'value']])->get('config.{som
213232 });
214233 ```
215234
235+ - **toArray**:
236+ - ```php
237+ // Getting the internal raw array.
238+
239+ // Example 1.
240+ $dot->toArray();
241+
242+ // Example 2.
243+ $dot->get(' books.{sci-fi & fantasy}')->toArray ();
244+ ` ` `
245+
246+ - ** toJson** :
247+ - ` ` ` php
248+ // Getting the internal raw array as JSON.
249+
250+ // Example 1.
251+ $dot->toJson ();
252+
253+ // Example 2.
254+ $dot -> get(' books.{sci-fi & fantasy}' )-> toJson();
255+ ` ` `
256+
257+ - ** toFlat** :
258+ - ` ` ` php
259+ $dot = DotArray::create(
260+ [
261+ ' a' => [
262+ ' b' => ' value' ,
263+ ],
264+
265+ ' b' => [
266+ 1,
267+ 2,
268+ 3,
269+ ],
270+ ]
271+ );
272+
273+ $dot->toFlat ();
274+
275+ /*
276+ The output will be an array:
277+
278+ [
279+ ' {{a}}.{{b}}' => ' value' ,
280+ ' {{b}}.{{0}}' => 1,
281+ ' {{b}}.{{1}}' => 2,
282+ ' {{b}}.{{2}}' => 3,
283+ ],
284+ * /
285+ ` ` `
286+
216287
217288
218289
Original file line number Diff line number Diff line change 8282 ],
8383
8484 "create-folders" : [
85- " mkdir build"
85+ " [ ! -d build ] && mkdir -p build || exit 0; "
8686 ],
8787
8888 "cs-check" : " phpcs" ,
9595 "tests-report-html" : " phpunit --coverage-html build/phpunit/coverage/html || exit 0;" ,
9696 "tests-report-xml" : " phpunit --coverage-xml build/phpunit/coverage/xml || exit 0;" ,
9797 "tests-report-clover" : " phpunit --coverage-clover build/phpunit/coverage/clover/index.xml || exit 0;"
98+ },
99+
100+ "scripts-descriptions" : {
98101 }
99102}
You can’t perform that action at this time.
0 commit comments