Skip to content

Commit 495646f

Browse files
Enable "native_constant_invocation" CS rule
1 parent 8e6eff5 commit 495646f

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Filesystem.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function copy($originFile, $targetFile, $overwriteNewerFiles = false)
4747
$this->mkdir(\dirname($targetFile));
4848

4949
$doCopy = true;
50-
if (!$overwriteNewerFiles && null === parse_url($originFile, PHP_URL_HOST) && is_file($targetFile)) {
50+
if (!$overwriteNewerFiles && null === parse_url($originFile, \PHP_URL_HOST) && is_file($targetFile)) {
5151
$doCopy = filemtime($originFile) > filemtime($targetFile);
5252
}
5353

@@ -118,7 +118,7 @@ public function mkdir($dirs, $mode = 0777)
118118
*/
119119
public function exists($files)
120120
{
121-
$maxPathLength = PHP_MAXPATHLEN - 2;
121+
$maxPathLength = \PHP_MAXPATHLEN - 2;
122122

123123
foreach ($this->toIterable($files) as $file) {
124124
if (\strlen($file) > $maxPathLength) {
@@ -301,7 +301,7 @@ public function rename($origin, $target, $overwrite = false)
301301
*/
302302
private function isReadable($filename)
303303
{
304-
$maxPathLength = PHP_MAXPATHLEN - 2;
304+
$maxPathLength = \PHP_MAXPATHLEN - 2;
305305

306306
if (\strlen($filename) > $maxPathLength) {
307307
throw new IOException(sprintf('Could not check if file is readable because path length exceeds %d characters.', $maxPathLength), 0, null, $filename);
@@ -446,7 +446,7 @@ public function readlink($path, $canonicalize = false)
446446
public function makePathRelative($endPath, $startPath)
447447
{
448448
if (!$this->isAbsolutePath($endPath) || !$this->isAbsolutePath($startPath)) {
449-
@trigger_error(sprintf('Support for passing relative paths to %s() is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED);
449+
@trigger_error(sprintf('Support for passing relative paths to %s() is deprecated since Symfony 3.4 and will be removed in 4.0.', __METHOD__), \E_USER_DEPRECATED);
450450
}
451451

452452
// Normalize separators on Windows
@@ -604,7 +604,7 @@ public function isAbsolutePath($file)
604604
&& ':' === $file[1]
605605
&& strspn($file, '/\\', 2, 1)
606606
)
607-
|| null !== parse_url($file, PHP_URL_SCHEME)
607+
|| null !== parse_url($file, \PHP_URL_SCHEME)
608608
;
609609
}
610610

@@ -713,7 +713,7 @@ public function appendToFile($filename, $content)
713713
throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir);
714714
}
715715

716-
if (false === @file_put_contents($filename, $content, FILE_APPEND)) {
716+
if (false === @file_put_contents($filename, $content, \FILE_APPEND)) {
717717
throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename);
718718
}
719719
}

LockHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\Lock\Store\FlockStore;
1616
use Symfony\Component\Lock\Store\SemaphoreStore;
1717

18-
@trigger_error(sprintf('The %s class is deprecated since Symfony 3.4 and will be removed in 4.0. Use %s or %s instead.', LockHandler::class, SemaphoreStore::class, FlockStore::class), E_USER_DEPRECATED);
18+
@trigger_error(sprintf('The %s class is deprecated since Symfony 3.4 and will be removed in 4.0. Use %s or %s instead.', LockHandler::class, SemaphoreStore::class, FlockStore::class), \E_USER_DEPRECATED);
1919

2020
/**
2121
* LockHandler class provides a simple abstraction to lock anything by means of
@@ -97,7 +97,7 @@ public function lock($blocking = false)
9797

9898
// On Windows, even if PHP doc says the contrary, LOCK_NB works, see
9999
// https://bugs.php.net/54129
100-
if (!flock($this->handle, LOCK_EX | ($blocking ? 0 : LOCK_NB))) {
100+
if (!flock($this->handle, \LOCK_EX | ($blocking ? 0 : \LOCK_NB))) {
101101
fclose($this->handle);
102102
$this->handle = null;
103103

@@ -113,7 +113,7 @@ public function lock($blocking = false)
113113
public function release()
114114
{
115115
if ($this->handle) {
116-
flock($this->handle, LOCK_UN | LOCK_NB);
116+
flock($this->handle, \LOCK_UN | \LOCK_NB);
117117
fclose($this->handle);
118118
$this->handle = null;
119119
}

Tests/FilesystemTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public function testFilesExistsFails()
377377
$this->markTestSkipped('Long file names are an issue on Windows');
378378
}
379379
$basePath = $this->workspace.'\\directory\\';
380-
$maxPathLength = PHP_MAXPATHLEN - 2;
380+
$maxPathLength = \PHP_MAXPATHLEN - 2;
381381

382382
$oldPath = getcwd();
383383
mkdir($basePath);

Tests/FilesystemTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ protected function markAsSkippedIfSymlinkIsMissing($relative = false)
144144
}
145145

146146
// https://bugs.php.net/69473
147-
if ($relative && '\\' === \DIRECTORY_SEPARATOR && 1 === PHP_ZTS) {
147+
if ($relative && '\\' === \DIRECTORY_SEPARATOR && 1 === \PHP_ZTS) {
148148
$this->markTestSkipped('symlink does not support relative paths on thread safe Windows PHP versions');
149149
}
150150
}

0 commit comments

Comments
 (0)