File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -118,11 +118,15 @@ public function tryLoad(string $type): void
118118
119119 /**
120120 * Add path or paths to list.
121- * @param string|string[] $path absolute path
121+ * @param string ...$paths absolute path
122122 */
123- public function addDirectory ($ path ): self
123+ public function addDirectory (... $ paths ): self
124124 {
125- $ this ->scanPaths = array_merge ($ this ->scanPaths , (array ) $ path );
125+ if (is_array ($ paths [0 ])) {
126+ trigger_error (__METHOD__ . '() use variadics ...$paths to add an array of paths. ' , E_USER_WARNING );
127+ $ paths = $ paths [0 ];
128+ }
129+ $ this ->scanPaths = array_merge ($ this ->scanPaths , $ paths );
126130 return $ this ;
127131 }
128132
@@ -136,11 +140,15 @@ public function reportParseErrors(bool $on = true): self
136140
137141 /**
138142 * Excludes path or paths from list.
139- * @param string|string[] $path absolute path
143+ * @param string ...$paths absolute path
140144 */
141- public function excludeDirectory ($ path ): self
145+ public function excludeDirectory (... $ paths ): self
142146 {
143- $ this ->excludeDirs = array_merge ($ this ->excludeDirs , (array ) $ path );
147+ if (is_array ($ paths [0 ])) {
148+ trigger_error (__METHOD__ . '() use variadics ...$paths to add an array of paths. ' , E_USER_WARNING );
149+ $ paths = $ paths [0 ];
150+ }
151+ $ this ->excludeDirs = array_merge ($ this ->excludeDirs , $ paths );
144152 return $ this ;
145153 }
146154
You can’t perform that action at this time.
0 commit comments