Skip to content

Commit f120980

Browse files
committed
optimized global function calls
1 parent a5fe153 commit f120980

25 files changed

+37
-23
lines changed

ncs.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

ncs.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
<exclude-pattern>./tests/Utils/Reflection.getDeclaringMethod.alias.phpt</exclude-pattern>
77
<exclude-pattern>./tests/Utils/Reflection.getDeclaringMethod.insteadof.phpt</exclude-pattern>
88

9-
<!-- use function in Arrays.php, Callback.php, Html.php, Strings.php -->
10-
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine.MultipleUsesPerLine">
11-
<exclude-pattern>./src/*/*.php</exclude-pattern>
12-
</rule>
13-
149
<!-- utf8_decode -->
1510
<rule ref="Generic.PHP.DeprecatedFunctions.Deprecated">
1611
<exclude-pattern>Strings.php</exclude-pattern>

src/Utils/ArrayHash.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Nette\Utils;
1111

1212
use Nette;
13+
use function count, is_array, is_scalar, sprintf;
1314

1415

1516
/**

src/Utils/ArrayList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Nette\Utils;
1111

1212
use Nette;
13+
use function array_slice, array_splice, count, is_int;
1314

1415

1516
/**

src/Utils/Arrays.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
use JetBrains\PhpStorm\Language;
1313
use Nette;
14-
use function is_array, is_int, is_object, count;
14+
use function array_combine, array_intersect_key, array_is_list, array_key_exists, array_key_first, array_key_last, array_keys, array_reverse, array_search, array_slice, array_walk_recursive, count, func_num_args, in_array, is_array, is_int, is_object, key, preg_split, range;
15+
use const PHP_VERSION_ID, PREG_GREP_INVERT, PREG_SPLIT_DELIM_CAPTURE, PREG_SPLIT_NO_EMPTY;
1516

1617

1718
/**

src/Utils/Callback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Nette\Utils;
1111

1212
use Nette;
13-
use function is_array, is_object, is_string;
13+
use function explode, func_get_args, ini_get, is_array, is_callable, is_object, is_string, preg_replace, restore_error_handler, set_error_handler, sprintf, str_contains, str_ends_with;
1414

1515

1616
/**

src/Utils/DateTime.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Nette\Utils;
1111

1212
use Nette;
13+
use function array_merge, checkdate, date_default_timezone_get, implode, is_numeric, is_string, preg_replace_callback, sprintf, time, trim;
1314

1415

1516
/**

src/Utils/FileInfo.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Nette\Utils;
1111

1212
use Nette;
13+
use const DIRECTORY_SEPARATOR;
1314

1415

1516
/**

src/Utils/FileSystem.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
namespace Nette\Utils;
1111

1212
use Nette;
13+
use function array_pop, chmod, decoct, dirname, end, fclose, file_exists, file_get_contents, file_put_contents, fopen, implode, is_dir, is_file, is_link, mkdir, preg_match, preg_split, realpath, rename, rmdir, rtrim, sprintf, str_replace, stream_copy_to_stream, stream_is_local, strtr;
14+
use const DIRECTORY_SEPARATOR;
1315

1416

1517
/**

src/Utils/Finder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
namespace Nette\Utils;
1111

1212
use Nette;
13+
use function array_merge, count, func_get_args, func_num_args, glob, implode, is_array, is_dir, iterator_to_array, preg_match, preg_quote, preg_replace, preg_split, rtrim, spl_object_id, sprintf, str_ends_with, str_starts_with, strnatcmp, strpbrk, strrpos, strtolower, strtr, substr, usort;
14+
use const GLOB_NOESCAPE, GLOB_NOSORT, GLOB_ONLYDIR;
1315

1416

1517
/**

0 commit comments

Comments
 (0)