X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FExtract.php;h=1f84d442b5031d69f929c9d00a428eadb157f9d6;hb=d4a5a8051ad34a7be72238967afb3e6b140afdc8;hp=06015f6970692506407c8b2c471e80abea95bafe;hpb=8b7cb5d9efeab580c2592e0fbe301f7142b73a3d;p=friendica.git diff --git a/src/Console/Extract.php b/src/Console/Extract.php index 06015f6970..1f84d442b5 100644 --- a/src/Console/Extract.php +++ b/src/Console/Extract.php @@ -1,6 +1,6 @@ globRecursive('src') ); @@ -120,10 +122,10 @@ HELP; $arr[] = $matchtkns[0]; - $s .= '$a->strings[' . $matchtkns[0] . "] = array(\n"; + $s .= '$a->strings[' . $matchtkns[0] . "] = [\n"; $s .= "\t0 => " . $matchtkns[0] . ",\n"; $s .= "\t1 => " . $matchtkns[1] . ",\n"; - $s .= ");\n"; + $s .= "];\n"; } } } @@ -141,9 +143,17 @@ HELP; return 0; } - private function globRecursive($path) { - $dir_iterator = new \RecursiveDirectoryIterator($path); - $iterator = new \RecursiveIteratorIterator($dir_iterator, \RecursiveIteratorIterator::SELF_FIRST); + /** + * Returns an array with found files and directories including their paths. + * + * @param string $path Base path to scan + * + * @return array A flat array with found files and directories + */ + private function globRecursive(string $path): array + { + $dir_iterator = new RecursiveDirectoryIterator($path); + $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST); $return = []; foreach ($iterator as $file) {