Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 5, 2022. It is now read-only.

Commit 351b74b

Browse files
Merge branch '2.8' into 3.4
* 2.8: Fix Clidumper tests Enable the fixer enforcing fully-qualified calls for compiler-optimized functions Apply fixers Disable the native_constant_invocation fixer until it can be scoped Update the list of excluded files for the CS fixer
2 parents e63c126 + dadfb73 commit 351b74b

8 files changed

+20
-20
lines changed

‎ApcClassLoader.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ApcClassLoader
6969
*/
7070
public function __construct($prefix, $decorated)
7171
{
72-
if (!function_exists('apcu_fetch')) {
72+
if (!\function_exists('apcu_fetch')) {
7373
throw new \RuntimeException('Unable to use ApcClassLoader as APC is not installed.');
7474
}
7575

@@ -138,6 +138,6 @@ public function findFile($class)
138138
*/
139139
public function __call($method, $args)
140140
{
141-
return call_user_func_array(array($this->decorated, $method), $args);
141+
return \call_user_func_array(array($this->decorated, $method), $args);
142142
}
143143
}

‎ClassCollectionLoader.php‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static function inline($classes, $cache, array $excluded)
131131
}
132132

133133
// cache the core classes
134-
$cacheDir = dirname($cache);
134+
$cacheDir = \dirname($cache);
135135
if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
136136
throw new \RuntimeException(sprintf('Class Collection Loader was not able to create directory "%s"', $cacheDir));
137137
}
@@ -169,8 +169,8 @@ public static function inline($classes, $cache, array $excluded)
169169
if (1 >= $i) {
170170
$file = var_export(implode('/', $file), true);
171171
} else {
172-
$file = array_slice($file, $i);
173-
$file = str_repeat('../', count($cacheDir) - $i).implode('/', $file);
172+
$file = \array_slice($file, $i);
173+
$file = str_repeat('../', \count($cacheDir) - $i).implode('/', $file);
174174
$file = '__DIR__.'.var_export('/'.$file, true);
175175
}
176176

@@ -203,7 +203,7 @@ public static function inline($classes, $cache, array $excluded)
203203
*/
204204
public static function fixNamespaceDeclarations($source)
205205
{
206-
if (!function_exists('token_get_all') || !self::$useTokenizer) {
206+
if (!\function_exists('token_get_all') || !self::$useTokenizer) {
207207
if (preg_match('/(^|\s)namespace(.*?)\s*;/', $source)) {
208208
$source = preg_replace('/(^|\s)namespace(.*?)\s*;/', "1ドルnamespace2ドル\n{", $source)."}\n";
209209
}
@@ -220,7 +220,7 @@ public static function fixNamespaceDeclarations($source)
220220
$token = $tokens[$i];
221221
if (!isset($token[1]) || 'b"' === $token) {
222222
$rawChunk .= $token;
223-
} elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
223+
} elseif (\in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
224224
// strip comments
225225
continue;
226226
} elseif (T_NAMESPACE === $token[0]) {
@@ -230,7 +230,7 @@ public static function fixNamespaceDeclarations($source)
230230
$rawChunk .= $token[1];
231231

232232
// namespace name and whitespaces
233-
while (isset($tokens[++$i][1]) && in_array($tokens[$i][0], array(T_WHITESPACE, T_NS_SEPARATOR, T_STRING))) {
233+
while (isset($tokens[++$i][1]) && \in_array($tokens[$i][0], array(T_WHITESPACE, T_NS_SEPARATOR, T_STRING))) {
234234
$rawChunk .= $tokens[$i][1];
235235
}
236236
if ('{' === $tokens[$i]) {
@@ -305,7 +305,7 @@ private static function compressCode($code)
305305
*/
306306
private static function writeCacheFile($file, $content)
307307
{
308-
$dir = dirname($file);
308+
$dir = \dirname($file);
309309
if (!is_writable($dir)) {
310310
throw new \RuntimeException(sprintf('Cache directory "%s" is not writable.', $dir));
311311
}

‎ClassLoader.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ public function addPrefix($prefix, $paths)
9595
return;
9696
}
9797
if (isset($this->prefixes[$prefix])) {
98-
if (is_array($paths)) {
98+
if (\is_array($paths)) {
9999
$this->prefixes[$prefix] = array_unique(array_merge(
100100
$this->prefixes[$prefix],
101101
$paths
102102
));
103-
} elseif (!in_array($paths, $this->prefixes[$prefix])) {
103+
} elseif (!\in_array($paths, $this->prefixes[$prefix])) {
104104
$this->prefixes[$prefix][] = $paths;
105105
}
106106
} else {

‎ClassMapGenerator.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static function dump($dirs, $file)
4949
*/
5050
public static function createMap($dir)
5151
{
52-
if (is_string($dir)) {
52+
if (\is_string($dir)) {
5353
$dir = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir));
5454
}
5555

@@ -110,7 +110,7 @@ private static function findClasses($path)
110110
$namespace = '';
111111
// If there is a namespace, extract it
112112
while (isset($tokens[++$i][1])) {
113-
if (in_array($tokens[$i][0], array(T_STRING, T_NS_SEPARATOR))) {
113+
if (\in_array($tokens[$i][0], array(T_STRING, T_NS_SEPARATOR))) {
114114
$namespace .= $tokens[$i][1];
115115
}
116116
}
@@ -129,7 +129,7 @@ private static function findClasses($path)
129129
if (T_DOUBLE_COLON === $tokens[$j][0]) {
130130
$isClassConstant = true;
131131
break;
132-
} elseif (!in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) {
132+
} elseif (!\in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) {
133133
break;
134134
}
135135
}

‎Psr4ClassLoader.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function findFile($class)
4848

4949
foreach ($this->prefixes as list($currentPrefix, $currentBaseDir)) {
5050
if (0 === strpos($class, $currentPrefix)) {
51-
$classWithoutPrefix = substr($class, strlen($currentPrefix));
51+
$classWithoutPrefix = substr($class, \strlen($currentPrefix));
5252
$file = $currentBaseDir.str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php';
5353
if (file_exists($file)) {
5454
return $file;

‎Tests/ClassCollectionLoaderTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public function testCommentStripping()
231231
}
232232
});
233233

234-
$strictTypes = defined('HHVM_VERSION') ? '' : "\nnamespace {require __DIR__.'/Fixtures/Namespaced/WithStrictTypes.php';}";
234+
$strictTypes = \defined('HHVM_VERSION') ? '' : "\nnamespace {require __DIR__.'/Fixtures/Namespaced/WithStrictTypes.php';}";
235235

236236
ClassCollectionLoader::load(
237237
array('Namespaced\\WithComments', 'Pearlike_WithComments', 'Namespaced\\WithDirMagic', 'Namespaced\\WithFileMagic', 'Namespaced\\WithHaltCompiler', $strictTypes ? 'Namespaced\\WithStrictTypes' : 'Namespaced\\WithComments'),

‎WinCacheClassLoader.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class WinCacheClassLoader
6868
*/
6969
public function __construct($prefix, $decorated)
7070
{
71-
if (!extension_loaded('wincache')) {
71+
if (!\extension_loaded('wincache')) {
7272
throw new \RuntimeException('Unable to use WinCacheClassLoader as WinCache is not enabled.');
7373
}
7474

@@ -137,6 +137,6 @@ public function findFile($class)
137137
*/
138138
public function __call($method, $args)
139139
{
140-
return call_user_func_array(array($this->decorated, $method), $args);
140+
return \call_user_func_array(array($this->decorated, $method), $args);
141141
}
142142
}

‎XcacheClassLoader.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class XcacheClassLoader
6262
*/
6363
public function __construct($prefix, $decorated)
6464
{
65-
if (!extension_loaded('xcache')) {
65+
if (!\extension_loaded('xcache')) {
6666
throw new \RuntimeException('Unable to use XcacheClassLoader as XCache is not enabled.');
6767
}
6868

@@ -132,6 +132,6 @@ public function findFile($class)
132132
*/
133133
public function __call($method, $args)
134134
{
135-
return call_user_func_array(array($this->decorated, $method), $args);
135+
return \call_user_func_array(array($this->decorated, $method), $args);
136136
}
137137
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /