diff --git a/Filesystem.php b/Filesystem.php index d2131c9b9d..eb14fee9e9 100644 --- a/Filesystem.php +++ b/Filesystem.php @@ -44,7 +44,7 @@ public function copy(string $originFile, string $targetFile, bool $overwriteNewe $this->mkdir(\dirname($targetFile)); $doCopy = true; - if (!$overwriteNewerFiles && null === parse_url($originFile, PHP_URL_HOST) && is_file($targetFile)) { + if (!$overwriteNewerFiles && null === parse_url($originFile, \PHP_URL_HOST) && is_file($targetFile)) { $doCopy = filemtime($originFile) > filemtime($targetFile); } @@ -114,7 +114,7 @@ public function mkdir($dirs, int $mode = 0777) */ public function exists($files) { - $maxPathLength = PHP_MAXPATHLEN - 2; + $maxPathLength = \PHP_MAXPATHLEN - 2; foreach ($this->toIterable($files) as $file) { if (\strlen($file) > $maxPathLength) { @@ -289,7 +289,7 @@ public function rename(string $origin, string $target, bool $overwrite = false) */ private function isReadable(string $filename): bool { - $maxPathLength = PHP_MAXPATHLEN - 2; + $maxPathLength = \PHP_MAXPATHLEN - 2; if (\strlen($filename) > $maxPathLength) { throw new IOException(sprintf('Could not check if file is readable because path length exceeds %d characters.', $maxPathLength), 0, null, $filename); @@ -574,7 +574,7 @@ public function isAbsolutePath(string $file) && ':' === $file[1] && strspn($file, '/\\', 2, 1) ) - || null !== parse_url($file, PHP_URL_SCHEME) + || null !== parse_url($file, \PHP_URL_SCHEME) ; } @@ -690,7 +690,7 @@ public function appendToFile(string $filename, $content) throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir); } - if (false === @file_put_contents($filename, $content, FILE_APPEND)) { + if (false === @file_put_contents($filename, $content, \FILE_APPEND)) { throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename); } } diff --git a/Tests/FilesystemTest.php b/Tests/FilesystemTest.php index c6e63fbc56..dcd6a393a9 100644 --- a/Tests/FilesystemTest.php +++ b/Tests/FilesystemTest.php @@ -377,7 +377,7 @@ public function testFilesExistsFails() $this->markTestSkipped('Long file names are an issue on Windows'); } $basePath = $this->workspace.'\\directory\\'; - $maxPathLength = PHP_MAXPATHLEN - 2; + $maxPathLength = \PHP_MAXPATHLEN - 2; $oldPath = getcwd(); mkdir($basePath); diff --git a/Tests/FilesystemTestCase.php b/Tests/FilesystemTestCase.php index 396a3ab2e8..76cfb9f9ff 100644 --- a/Tests/FilesystemTestCase.php +++ b/Tests/FilesystemTestCase.php @@ -159,7 +159,7 @@ protected function markAsSkippedIfSymlinkIsMissing($relative = false) } // https://bugs.php.net/69473 - if ($relative && '\\' === \DIRECTORY_SEPARATOR && 1 === PHP_ZTS) { + if ($relative && '\\' === \DIRECTORY_SEPARATOR && 1 === \PHP_ZTS) { $this->markTestSkipped('symlink does not support relative paths on thread safe Windows PHP versions'); } }