mirror of
https://github.com/friendica/friendica
synced 2025-04-26 12:30:11 +00:00
Changes:
- reformatted and documented private method - used [] instead of deprecated/discouraged array()
This commit is contained in:
parent
809beeee9d
commit
ae9bd4f3f2
3 changed files with 19 additions and 8 deletions
|
@ -21,6 +21,9 @@
|
|||
|
||||
namespace Friendica\Console;
|
||||
|
||||
use \RecursiveDirectoryIterator;
|
||||
use \RecursiveIteratorIterator;
|
||||
|
||||
/**
|
||||
* Extracts translation strings from the Friendica project's files to be exported
|
||||
* to Transifex for translation.
|
||||
|
@ -120,10 +123,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 +144,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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue