Skip to content

Commit 3481163

Browse files
Merge branch '5.2' into 5.3
* 5.2: Fix CS in README files Fix markdown [HttpKernel] Fixes tests for PHP7.4+ [Filesystem] fix readlink for Windows
2 parents 2a73117 + 9aa1587 commit 3481163

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

Filesystem.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,14 @@ public function readlink(string $path, bool $canonicalize = false)
423423
return null;
424424
}
425425

426-
if ('\\' === \DIRECTORY_SEPARATOR) {
426+
if ('\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 70410) {
427427
$path = readlink($path);
428428
}
429429

430430
return realpath($path);
431431
}
432432

433-
if ('\\' === \DIRECTORY_SEPARATOR) {
433+
if ('\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 70400) {
434434
return realpath($path);
435435
}
436436

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ The Filesystem component provides basic utilities for the filesystem.
66
Resources
77
---------
88

9-
* [Documentation](https://symfony.com/doc/current/components/filesystem.html)
10-
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
11-
* [Report issues](https://github.com/symfony/symfony/issues) and
12-
[send Pull Requests](https://github.com/symfony/symfony/pulls)
13-
in the [main Symfony repository](https://github.com/symfony/symfony)
9+
* [Documentation](https://symfony.com/doc/current/components/filesystem.html)
10+
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
11+
* [Report issues](https://github.com/symfony/symfony/issues) and
12+
[send Pull Requests](https://github.com/symfony/symfony/pulls)
13+
in the [main Symfony repository](https://github.com/symfony/symfony)

Tests/FilesystemTest.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ public function testRemoveCleansInvalidLinks()
376376

377377
// create symlink to nonexistent dir
378378
rmdir($basePath.'dir');
379-
$this->assertFalse('\\' === \DIRECTORY_SEPARATOR ? @readlink($basePath.'dir-link') : is_dir($basePath.'dir-link'));
379+
$this->assertFalse('\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 70400 ? @readlink($basePath.'dir-link') : is_dir($basePath.'dir-link'));
380380

381381
$this->filesystem->remove($basePath);
382382

@@ -1076,7 +1076,12 @@ public function testReadAbsoluteLink()
10761076
$this->filesystem->symlink($link1, $link2);
10771077

10781078
$this->assertEquals($file, $this->filesystem->readlink($link1));
1079-
$this->assertEquals($link1, $this->filesystem->readlink($link2));
1079+
1080+
if (!('\\' == \DIRECTORY_SEPARATOR && \PHP_MAJOR_VERSION === 7 && \PHP_MINOR_VERSION === 3)) {
1081+
// Skip for Windows with PHP 7.3.*
1082+
$this->assertEquals($link1, $this->filesystem->readlink($link2));
1083+
}
1084+
10801085
$this->assertEquals($file, $this->filesystem->readlink($link1, true));
10811086
$this->assertEquals($file, $this->filesystem->readlink($link2, true));
10821087
$this->assertEquals($file, $this->filesystem->readlink($file, true));

0 commit comments

Comments
 (0)