formatting

This commit is contained in:
Shish
2019-09-29 14:32:51 +01:00
parent 4dce3a2f07
commit f5119b20a3
100 changed files with 406 additions and 409 deletions

View File

@@ -759,7 +759,7 @@ function validate_input(array $inputs): array
*/
function sanitize_path(string $path): string
{
return preg_replace('|[\\\\/]+|S',DIRECTORY_SEPARATOR,$path);
return preg_replace('|[\\\\/]+|S', DIRECTORY_SEPARATOR, $path);
}
/**
@@ -770,11 +770,11 @@ function join_path(string ...$paths): string
{
$output = "";
foreach ($paths as $path) {
if(empty($path)) {
if (empty($path)) {
continue;
}
$path = sanitize_path($path);
if(empty($output)) {
if (empty($output)) {
$output = $path;
} else {
$output = rtrim($output, DIRECTORY_SEPARATOR);
@@ -790,8 +790,8 @@ function join_path(string ...$paths): string
*/
function iterator_map(callable $callback, iterator $iter): Generator
{
foreach($iter as $i) {
yield call_user_func($callback,$i);
foreach ($iter as $i) {
yield call_user_func($callback, $i);
}
}
@@ -801,4 +801,4 @@ function iterator_map(callable $callback, iterator $iter): Generator
function iterator_map_to_array(callable $callback, iterator $iter): array
{
return iterator_to_array(iterator_map($callback, $iter));
}
}