Skip to content

Commit f319430

Browse files
Merge branch '4.4' into 5.1
* 4.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents f7b9ed6 + 0d38697 commit f319430

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Filesystem.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function copy(string $originFile, string $targetFile, bool $overwriteNewe
4444
$this->mkdir(\dirname($targetFile));
4545

4646
$doCopy = true;
47-
if (!$overwriteNewerFiles && null === parse_url($originFile, PHP_URL_HOST) && is_file($targetFile)) {
47+
if (!$overwriteNewerFiles && null === parse_url($originFile, \PHP_URL_HOST) && is_file($targetFile)) {
4848
$doCopy = filemtime($originFile) > filemtime($targetFile);
4949
}
5050

@@ -114,7 +114,7 @@ public function mkdir($dirs, int $mode = 0777)
114114
*/
115115
public function exists($files)
116116
{
117-
$maxPathLength = PHP_MAXPATHLEN - 2;
117+
$maxPathLength = \PHP_MAXPATHLEN - 2;
118118

119119
foreach ($this->toIterable($files) as $file) {
120120
if (\strlen($file) > $maxPathLength) {
@@ -289,7 +289,7 @@ public function rename(string $origin, string $target, bool $overwrite = false)
289289
*/
290290
private function isReadable(string $filename): bool
291291
{
292-
$maxPathLength = PHP_MAXPATHLEN - 2;
292+
$maxPathLength = \PHP_MAXPATHLEN - 2;
293293

294294
if (\strlen($filename) > $maxPathLength) {
295295
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)
574574
&& ':' === $file[1]
575575
&& strspn($file, '/\\', 2, 1)
576576
)
577-
|| null !== parse_url($file, PHP_URL_SCHEME)
577+
|| null !== parse_url($file, \PHP_URL_SCHEME)
578578
;
579579
}
580580

@@ -690,7 +690,7 @@ public function appendToFile(string $filename, $content)
690690
throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir);
691691
}
692692

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

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
@@ -159,7 +159,7 @@ protected function markAsSkippedIfSymlinkIsMissing($relative = false)
159159
}
160160

161161
// https://bugs.php.net/69473
162-
if ($relative && '\\' === \DIRECTORY_SEPARATOR && 1 === PHP_ZTS) {
162+
if ($relative && '\\' === \DIRECTORY_SEPARATOR && 1 === \PHP_ZTS) {
163163
$this->markTestSkipped('symlink does not support relative paths on thread safe Windows PHP versions');
164164
}
165165
}

0 commit comments

Comments
 (0)