Skip to content

Commit c2cc86b

Browse files
committed
use value of DIRECTORY_SEPARATOR to detect Windows
This commit unifies the detection of Windows builds across the Symfony codebase.
1 parent 07b0c58 commit c2cc86b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Iterator/PathFilterIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function accept()
2828
{
2929
$filename = $this->current()->getRelativePathname();
3030

31-
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
31+
if ('\\' === DIRECTORY_SEPARATOR) {
3232
$filename = strtr($filename, '\\', '/');
3333
}
3434

Tests/FinderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ public function getTestPathData()
734734
*/
735735
public function testAccessDeniedException(Adapter\AdapterInterface $adapter)
736736
{
737-
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
737+
if ('\\' === DIRECTORY_SEPARATOR) {
738738
$this->markTestSkipped('chmod is not supported on Windows');
739739
}
740740

@@ -773,7 +773,7 @@ public function testAccessDeniedException(Adapter\AdapterInterface $adapter)
773773
*/
774774
public function testIgnoredAccessDeniedException(Adapter\AdapterInterface $adapter)
775775
{
776-
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
776+
if ('\\' === DIRECTORY_SEPARATOR) {
777777
$this->markTestSkipped('chmod is not supported on Windows');
778778
}
779779

0 commit comments

Comments
 (0)