File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -231,15 +231,22 @@ private function createFileIterator(string $dir): Nette\Utils\Finder
231231 throw new Nette \IOException ("File or directory ' $ dir' not found. " );
232232 }
233233
234- $ ignoreDirs = is_array ($ this ->ignoreDirs ) ? $ this ->ignoreDirs : preg_split ('#[,\s]+# ' , $ this ->ignoreDirs );
234+ if (!is_array ($ ignoreDirs = $ this ->ignoreDirs )) {
235+ trigger_error (__CLASS__ . ': $ignoreDirs must be an array. ' , E_USER_WARNING );
236+ $ ignoreDirs = preg_split ('#[,\s]+# ' , $ ignoreDirs );
237+ }
235238 $ disallow = [];
236239 foreach (array_merge ($ ignoreDirs , $ this ->excludeDirs ) as $ item ) {
237240 if ($ item = realpath ($ item )) {
238241 $ disallow [str_replace ('\\' , '/ ' , $ item )] = true ;
239242 }
240243 }
241244
242- $ acceptFiles = is_array ($ this ->acceptFiles ) ? $ this ->acceptFiles : preg_split ('#[,\s]+# ' , $ this ->acceptFiles );
245+ if (!is_array ($ acceptFiles = $ this ->acceptFiles )) {
246+ trigger_error (__CLASS__ . ': $acceptFiles must be an array. ' , E_USER_WARNING );
247+ $ acceptFiles = preg_split ('#[,\s]+# ' , $ acceptFiles );
248+ }
249+
243250 $ iterator = Nette \Utils \Finder::findFiles ($ acceptFiles )
244251 ->filter (function (SplFileInfo $ file ) use (&$ disallow ) {
245252 return !isset ($ disallow [str_replace ('\\' , '/ ' , $ file ->getRealPath ())]);
You can’t perform that action at this time.
0 commit comments