Skip to content

Commit 0d38697

Browse files
Merge branch '3.4' into 4.4
* 3.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents 27575bc + 495646f commit 0d38697

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Filesystem.php

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

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

@@ -119,7 +119,7 @@ public function mkdir($dirs, $mode = 0777)
119119
*/
120120
public function exists($files)
121121
{
122-
$maxPathLength = PHP_MAXPATHLEN - 2;
122+
$maxPathLength = \PHP_MAXPATHLEN - 2;
123123

124124
foreach ($this->toIterable($files) as $file) {
125125
if (\strlen($file) > $maxPathLength) {
@@ -298,7 +298,7 @@ public function rename($origin, $target, $overwrite = false)
298298
*/
299299
private function isReadable(string $filename): bool
300300
{
301-
$maxPathLength = PHP_MAXPATHLEN - 2;
301+
$maxPathLength = \PHP_MAXPATHLEN - 2;
302302

303303
if (\strlen($filename) > $maxPathLength) {
304304
throw new IOException(sprintf('Could not check if file is readable because path length exceeds %d characters.', $maxPathLength), 0, null, $filename);
@@ -594,15 +594,15 @@ public function mirror($originDir, $targetDir, \Traversable $iterator = null, $o
594594
public function isAbsolutePath($file)
595595
{
596596
if (null === $file) {
597-
@trigger_error(sprintf('Calling "%s()" with a null in the $file argument is deprecated since Symfony 4.4.', __METHOD__), E_USER_DEPRECATED);
597+
@trigger_error(sprintf('Calling "%s()" with a null in the $file argument is deprecated since Symfony 4.4.', __METHOD__), \E_USER_DEPRECATED);
598598
}
599599

600600
return strspn($file, '/\\', 0, 1)
601601
|| (\strlen($file) > 3 && ctype_alpha($file[0])
602602
&& ':' === $file[1]
603603
&& strspn($file, '/\\', 2, 1)
604604
)
605-
|| null !== parse_url($file, PHP_URL_SCHEME)
605+
|| null !== parse_url($file, \PHP_URL_SCHEME)
606606
;
607607
}
608608

@@ -669,7 +669,7 @@ public function tempnam($dir, $prefix)
669669
public function dumpFile($filename, $content)
670670
{
671671
if (\is_array($content)) {
672-
@trigger_error(sprintf('Calling "%s()" with an array in the $content argument is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
672+
@trigger_error(sprintf('Calling "%s()" with an array in the $content argument is deprecated since Symfony 4.3.', __METHOD__), \E_USER_DEPRECATED);
673673
}
674674

675675
$dir = \dirname($filename);
@@ -706,7 +706,7 @@ public function dumpFile($filename, $content)
706706
public function appendToFile($filename, $content)
707707
{
708708
if (\is_array($content)) {
709-
@trigger_error(sprintf('Calling "%s()" with an array in the $content argument is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED);
709+
@trigger_error(sprintf('Calling "%s()" with an array in the $content argument is deprecated since Symfony 4.3.', __METHOD__), \E_USER_DEPRECATED);
710710
}
711711

712712
$dir = \dirname($filename);
@@ -719,7 +719,7 @@ public function appendToFile($filename, $content)
719719
throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir);
720720
}
721721

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

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)