Skip to content

Commit

Permalink
Merge branch '4.4' into 5.1
Browse files Browse the repository at this point in the history
* 4.4:
  Enable "native_constant_invocation" CS rule
  Make AbstractPhpFileCacheWarmer public
  • Loading branch information
nicolas-grekas committed Sep 2, 2020
2 parents f7b9ed6 + 0d38697 commit f319430
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Filesystem.php
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
;
}

Expand Down Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/FilesystemTest.php
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Tests/FilesystemTestCase.php
Expand Up @@ -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');
}
}
Expand Down

0 comments on commit f319430

Please sign in to comment.