Skip to content

Commit 06c0be4

Browse files
Enable native_constant_invocation CS fixer
1 parent e028d57 commit 06c0be4

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Exception/FileLoaderLoadException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct($resource, $sourceResource = null, $code = null, $pr
5656

5757
// Is the resource located inside a bundle?
5858
if ('@' === $resource[0]) {
59-
$parts = explode(DIRECTORY_SEPARATOR, $resource);
59+
$parts = explode(\DIRECTORY_SEPARATOR, $resource);
6060
$bundle = substr($parts[0], 1);
6161
$message .= sprintf(' Make sure the "%s" bundle is correctly registered and loaded in the application kernel class.', $bundle);
6262
$message .= sprintf(' If the bundle is registered, make sure the bundle path "%s" is not empty.', $resource);

FileLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function locate($name, $currentPath = null, $first = true)
5555
$filepaths = array();
5656

5757
foreach ($paths as $path) {
58-
if (@file_exists($file = $path.DIRECTORY_SEPARATOR.$name)) {
58+
if (@file_exists($file = $path.\DIRECTORY_SEPARATOR.$name)) {
5959
if (true === $first) {
6060
return $file;
6161
}

Tests/FileLocatorTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,41 +46,41 @@ public function testLocate()
4646
$loader = new FileLocator(__DIR__.'/Fixtures');
4747

4848
$this->assertEquals(
49-
__DIR__.DIRECTORY_SEPARATOR.'FileLocatorTest.php',
49+
__DIR__.\DIRECTORY_SEPARATOR.'FileLocatorTest.php',
5050
$loader->locate('FileLocatorTest.php', __DIR__),
5151
'->locate() returns the absolute filename if the file exists in the given path'
5252
);
5353

5454
$this->assertEquals(
55-
__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml',
55+
__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml',
5656
$loader->locate('foo.xml', __DIR__),
5757
'->locate() returns the absolute filename if the file exists in one of the paths given in the constructor'
5858
);
5959

6060
$this->assertEquals(
61-
__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml',
62-
$loader->locate(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__),
61+
__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml',
62+
$loader->locate(__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml', __DIR__),
6363
'->locate() returns the absolute filename if the file exists in one of the paths given in the constructor'
6464
);
6565

6666
$loader = new FileLocator(array(__DIR__.'/Fixtures', __DIR__.'/Fixtures/Again'));
6767

6868
$this->assertEquals(
69-
array(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.DIRECTORY_SEPARATOR.'foo.xml'),
69+
array(__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.\DIRECTORY_SEPARATOR.'foo.xml'),
7070
$loader->locate('foo.xml', __DIR__, false),
7171
'->locate() returns an array of absolute filenames'
7272
);
7373

7474
$this->assertEquals(
75-
array(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.DIRECTORY_SEPARATOR.'foo.xml'),
75+
array(__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.\DIRECTORY_SEPARATOR.'foo.xml'),
7676
$loader->locate('foo.xml', __DIR__.'/Fixtures', false),
7777
'->locate() returns an array of absolute filenames'
7878
);
7979

8080
$loader = new FileLocator(__DIR__.'/Fixtures/Again');
8181

8282
$this->assertEquals(
83-
array(__DIR__.'/Fixtures'.DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.DIRECTORY_SEPARATOR.'foo.xml'),
83+
array(__DIR__.'/Fixtures'.\DIRECTORY_SEPARATOR.'foo.xml', __DIR__.'/Fixtures/Again'.\DIRECTORY_SEPARATOR.'foo.xml'),
8484
$loader->locate('foo.xml', __DIR__.'/Fixtures', false),
8585
'->locate() returns an array of absolute filenames'
8686
);

Tests/Resource/DirectoryResourceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DirectoryResourceTest extends TestCase
2020

2121
protected function setUp()
2222
{
23-
$this->directory = sys_get_temp_dir().DIRECTORY_SEPARATOR.'symfonyDirectoryIterator';
23+
$this->directory = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'symfonyDirectoryIterator';
2424
if (!file_exists($this->directory)) {
2525
mkdir($this->directory);
2626
}

0 commit comments

Comments
 (0)