File tree 7 files changed +472
-198
lines changed
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
2
28
/.editorconfig export-ignore
3
29
/.gitattributes export-ignore
4
30
/.gitignore export-ignore
31
+ /phpunit.xml export-ignore
32
+ /phpcs.xml export-ignore
33
+ /phpmd.xml export-ignore
5
34
/.travis.yml export-ignore
6
35
/.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 1
1
DotArray Change Log
2
2
=====================
3
3
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
+
4
16
1.0.3 December 28, 2018
5
17
-----------------------------
6
18
Original file line number Diff line number Diff line change @@ -118,6 +118,25 @@ DotArray::create(['config' => ['some.dotted.key' => 'value']])->get('config.{som
118
118
$dot[' books.{sci-fi & fantasy}' ] = [];
119
119
```
120
120
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
+
121
140
- **delete** *(unset(...))*:
122
141
- ```php
123
142
$dot->delete(' books.{sci-fi & fantasy}' );
@@ -213,6 +232,58 @@ DotArray::create(['config' => ['some.dotted.key' => 'value']])->get('config.{som
213
232
});
214
233
```
215
234
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
+
216
287
217
288
218
289
Original file line number Diff line number Diff line change 82
82
],
83
83
84
84
"create-folders" : [
85
- " mkdir build"
85
+ " [ ! -d build ] && mkdir -p build || exit 0; "
86
86
],
87
87
88
88
"cs-check" : " phpcs" ,
95
95
"tests-report-html" : " phpunit --coverage-html build/phpunit/coverage/html || exit 0;" ,
96
96
"tests-report-xml" : " phpunit --coverage-xml build/phpunit/coverage/xml || exit 0;" ,
97
97
"tests-report-clover" : " phpunit --coverage-clover build/phpunit/coverage/clover/index.xml || exit 0;"
98
+ },
99
+
100
+ "scripts-descriptions" : {
98
101
}
99
102
}
You can’t perform that action at this time.
0 commit comments