@@ -69,7 +69,6 @@ class DotArray implements
6969 */
7070 protected $ items ;
7171
72-
7372 /**
7473 * Creates an DotArray object.
7574 *
@@ -82,7 +81,6 @@ public static function create($items)
8281 return (new static ($ items ));
8382 }
8483
85-
8684 /**
8785 * @param string $json
8886 *
@@ -93,7 +91,6 @@ public static function createFromJson($json)
9391 return static ::create (\json_decode ($ json , true ));
9492 }
9593
96-
9794 /**
9895 * Getting the dot path pattern.
9996 *
@@ -114,7 +111,6 @@ protected static function dotPathPattern()
114111 return self ::$ dotPathPattern ;
115112 }
116113
117-
118114 /**
119115 * Converts dot string path to segments.
120116 *
@@ -150,7 +146,6 @@ function ($match) {
150146 return (empty ($ segments ) ? [] : $ segments );
151147 }
152148
153-
154149 /**
155150 * Wrap a given string into special characters.
156151 *
@@ -163,7 +158,6 @@ protected static function wrapSegmentKey($key)
163158 return vsprintf (static ::$ dotPathConfig ['wrapKey ' ], [$ key ]);
164159 }
165160
166-
167161 /**
168162 * @param array $segments
169163 *
@@ -184,7 +178,6 @@ function ($segment) {
184178 );
185179 }
186180
187-
188181 /**
189182 * Flatten the internal array using the dot delimiter,
190183 * also the keys are wrapped inside {key} (1 x curly braces).
@@ -219,7 +212,6 @@ protected static function flatten(array $items, $prepend = [])
219212 return $ flatten ;
220213 }
221214
222-
223215 /**
224216 * Return the given items as an array
225217 *
@@ -245,7 +237,6 @@ protected static function normalize($items)
245237 return (array ) $ items ;
246238 }
247239
248-
249240 /**
250241 * @param array|DotArray|mixed $array1
251242 * @param null|array|DotArray|mixed $array2
@@ -275,7 +266,6 @@ protected static function mergeRecursive($array1, $array2 = null)
275266 return $ res ;
276267 }
277268
278-
279269 /**
280270 * DotArray Constructor.
281271 *
@@ -288,7 +278,6 @@ public function __construct($items = [])
288278 $ this ->uniqueIdentifier ();
289279 }
290280
291-
292281 /**
293282 * DotArray Destructor.
294283 */
@@ -298,7 +287,6 @@ public function __destruct()
298287 unset($ this ->items );
299288 }
300289
301-
302290 /**
303291 * Call object as function.
304292 *
@@ -311,7 +299,6 @@ public function __invoke($key = null)
311299 return $ this ->get ($ key );
312300 }
313301
314-
315302 /**
316303 * @return string
317304 */
@@ -330,7 +317,6 @@ public function uniqueIdentifier()
330317 return $ this ->uniqueIdentifier ;
331318 }
332319
333-
334320 /**
335321 * Merges one or more arrays into master recursively.
336322 * If each array has an element with the same string key value, the latter
@@ -362,7 +348,6 @@ public function merge($array)
362348 return $ this ;
363349 }
364350
365-
366351 /**
367352 * @param string|null|mixed $key
368353 * @param mixed $default
@@ -390,7 +375,6 @@ protected function &read($key = null, $default = null)
390375 return $ items ;
391376 }
392377
393-
394378 /**
395379 * @param string $key
396380 * @param mixed $value
@@ -427,7 +411,6 @@ protected function write($key, $value)
427411 }
428412 }
429413
430-
431414 /**
432415 * Delete the given key or keys.
433416 *
@@ -459,7 +442,6 @@ protected function remove($key)
459442 }
460443 }
461444
462-
463445 /**
464446 * @param string $key
465447 *
@@ -472,7 +454,6 @@ public function has($key)
472454 return ($ identifier !== $ this ->read ($ key , $ identifier ));
473455 }
474456
475-
476457 /**
477458 * Check if a given key contains empty values (null, [], 0, false)
478459 *
@@ -487,7 +468,6 @@ public function isEmpty($key = null)
487468 return empty ($ items );
488469 }
489470
490-
491471 /**
492472 * @param null|string $key
493473 * @param null|mixed $default
@@ -505,7 +485,6 @@ public function get($key = null, $default = null)
505485 return $ items ;
506486 }
507487
508-
509488 /**
510489 * Set the given value to the provided key or keys.
511490 *
@@ -525,7 +504,6 @@ public function set($keys = null, $value = [])
525504 return $ this ;
526505 }
527506
528-
529507 /**
530508 * Delete the given key or keys.
531509 *
@@ -544,7 +522,6 @@ public function delete($keys)
544522 return $ this ;
545523 }
546524
547-
548525 /**
549526 * Set the contents of a given key or keys to the given value (default is empty array).
550527 *
@@ -564,7 +541,6 @@ public function clear($keys = null, $value = [])
564541 return $ this ;
565542 }
566543
567-
568544 /**
569545 * Returning the first value from the current array.
570546 *
@@ -577,7 +553,6 @@ public function first()
577553 return \array_shift ($ items );
578554 }
579555
580-
581556 /**
582557 * Whether a offset exists
583558 *
@@ -595,7 +570,6 @@ public function offsetExists($offset)
595570 return $ this ->has ($ offset );
596571 }
597572
598-
599573 /**
600574 * Offset to retrieve
601575 *
@@ -612,7 +586,6 @@ public function &offsetGet($offset)
612586 return $ this ->read ($ offset , null );
613587 }
614588
615-
616589 /**
617590 * Offset to set
618591 *
@@ -630,7 +603,6 @@ public function offsetSet($offset, $value)
630603 $ this ->write ($ offset , $ value );
631604 }
632605
633-
634606 /**
635607 * Offset to unset
636608 *
@@ -652,7 +624,6 @@ public function offsetUnset($offset)
652624 $ this ->remove ($ offset );
653625 }
654626
655-
656627 /**
657628 * Count elements of an object
658629 *
@@ -669,7 +640,6 @@ public function count($mode = COUNT_NORMAL)
669640 return \count ($ this ->items , $ mode );
670641 }
671642
672-
673643 /**
674644 * Specify data which should be serialized to JSON
675645 *
@@ -685,7 +655,6 @@ public function jsonSerialize()
685655 return $ this ->items ;
686656 }
687657
688-
689658 /**
690659 * String representation of object
691660 *
@@ -700,7 +669,6 @@ public function serialize()
700669 return \serialize ($ this ->items );
701670 }
702671
703-
704672 /**
705673 * Constructs the object
706674 *
@@ -717,7 +685,6 @@ public function unserialize($serialized)
717685 $ this ->items = \unserialize ($ serialized );
718686 }
719687
720-
721688 /**
722689 * Retrieve an external iterator.
723690 *
@@ -732,7 +699,6 @@ public function getIterator()
732699 return new \ArrayIterator ($ this ->items );
733700 }
734701
735-
736702 /**
737703 * Getting the internal raw array.
738704 *
@@ -743,7 +709,6 @@ public function toArray()
743709 return $ this ->items ;
744710 }
745711
746-
747712 /**
748713 * Getting the internal raw array as JSON.
749714 *
@@ -756,7 +721,6 @@ public function toJson($options = 0)
756721 return (string ) \json_encode ($ this ->items , $ options );
757722 }
758723
759-
760724 /**
761725 * Flatten the internal array using the dot delimiter,
762726 * also the keys are wrapped inside {key} (1 x curly braces).
@@ -768,5 +732,4 @@ public function toFlat()
768732 return static ::flatten ($ this ->items );
769733 }
770734
771-
772735}
0 commit comments