@@ -92,6 +92,7 @@ public static function fromArray(array $config): self
9292 'notNames ' => 'addNotNames ' ,
9393 'paths ' => 'addNotPaths ' ,
9494 'notPaths ' => 'addNotPaths ' ,
95+ 'exclude ' => 'exclude ' ,
9596 'excludes ' => 'exclude ' ,
9697 ];
9798
@@ -163,7 +164,7 @@ public function name(string $pattern): self
163164 */
164165 public function addNames ($ patterns ): self
165166 {
166- $ this ->names = array_merge ($ this ->names , $ patterns );
167+ $ this ->names = \ array_merge ($ this ->names , ( array ) $ patterns );
167168
168169 return $ this ;
169170 }
@@ -231,7 +232,7 @@ public function notPath(string $pattern): self
231232 */
232233 public function addNotPaths ($ patterns ): self
233234 {
234- $ this ->notPaths = array_merge ($ this ->notPaths , $ patterns );
235+ $ this ->notPaths = array_merge ($ this ->notPaths , ( array ) $ patterns );
235236
236237 return $ this ;
237238 }
@@ -324,6 +325,7 @@ public function inDir($dirs): self
324325 /**
325326 * @param mixed $iterator
326327 * @return $this
328+ * @throws \InvalidArgumentException
327329 */
328330 public function append ($ iterator ): self
329331 {
@@ -349,7 +351,7 @@ public function append($iterator): self
349351 */
350352 public function count (): int
351353 {
352- return iterator_count ($ this ->getIterator ());
354+ return \ iterator_count ($ this ->getIterator ());
353355 }
354356
355357 /**
@@ -364,6 +366,7 @@ public function isFollowLinks(): bool
364366 * Retrieve an external iterator
365367 * @link http://php.net/manual/en/iteratoraggregate.getiterator.php
366368 * @return \Iterator|\SplFileInfo[] An iterator
369+ * @throws \LogicException
367370 */
368371 public function getIterator (): \Traversable
369372 {
@@ -521,7 +524,7 @@ public function accept(): bool
521524 return !($ this ->current ()->isDir () && isset ($ this ->excludes [$ name ]));
522525 }
523526
524- public function hasChildren ()
527+ public function hasChildren (): bool
525528 {
526529 return $ this ->iterator ->hasChildren ();
527530 }
0 commit comments