Skip to content

Commit 642efc3

Browse files
Merge branch '4.0' into 4.1
* 4.0: Enable native_constant_invocation CS fixer
2 parents 7d055a3 + bda259d commit 642efc3

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

ContainerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,7 @@ private function inVendors($path)
15781578
$path = realpath($path) ?: $path;
15791579

15801580
foreach ($this->vendors as $vendor) {
1581-
if (0 === strpos($path, $vendor) && false !== strpbrk(substr($path, \strlen($vendor), 1), '/'.DIRECTORY_SEPARATOR)) {
1581+
if (0 === strpos($path, $vendor) && false !== strpbrk(substr($path, \strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) {
15821582
return true;
15831583
}
15841584
}

Dumper/PhpDumper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function dump(array $options = array())
155155
// but every other sub-dir is optional up to the full path in $dir
156156
// Mandate at least 2 root dirs and not more that 5 optional dirs.
157157

158-
$dir = explode(DIRECTORY_SEPARATOR, realpath($dir));
158+
$dir = explode(\DIRECTORY_SEPARATOR, realpath($dir));
159159
$i = \count($dir);
160160

161161
if (3 <= $i) {
@@ -164,11 +164,11 @@ public function dump(array $options = array())
164164
$this->targetDirMaxMatches = $i - $lastOptionalDir;
165165

166166
while (--$i >= $lastOptionalDir) {
167-
$regex = sprintf('(%s%s)?', preg_quote(DIRECTORY_SEPARATOR.$dir[$i], '#'), $regex);
167+
$regex = sprintf('(%s%s)?', preg_quote(\DIRECTORY_SEPARATOR.$dir[$i], '#'), $regex);
168168
}
169169

170170
do {
171-
$regex = preg_quote(DIRECTORY_SEPARATOR.$dir[$i], '#').$regex;
171+
$regex = preg_quote(\DIRECTORY_SEPARATOR.$dir[$i], '#').$regex;
172172
} while (0 < --$i);
173173

174174
$this->targetDirRegex = '#'.preg_quote($dir[0], '#').$regex.'#';

Loader/XmlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ public function validateSchema(\DOMDocument $dom)
600600
$locationstart = 'phar:///';
601601
}
602602
}
603-
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
603+
$drive = '\\' === \DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
604604
$location = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));
605605

606606
$imports .= sprintf(' <xsd:import namespace="%s" schemaLocation="%s" />'."\n", $namespace, $location);

Tests/Dumper/PhpDumperTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function testAddService()
190190
$container = include self::$fixturesPath.'/containers/container9.php';
191191
$container->compile();
192192
$dumper = new PhpDumper($container);
193-
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services9_compiled.php', str_replace(str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), '%path%', $dumper->dump()), '->dump() dumps services');
193+
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services9_compiled.php', str_replace(str_replace('\\', '\\\\', self::$fixturesPath.\DIRECTORY_SEPARATOR.'includes'.\DIRECTORY_SEPARATOR), '%path%', $dumper->dump()), '->dump() dumps services');
194194

195195
$container = new ContainerBuilder();
196196
$container->register('foo', 'FooClass')->addArgument(new \stdClass())->setPublic(true);
@@ -216,7 +216,7 @@ public function testDumpAsFiles()
216216
$container->compile();
217217
$dumper = new PhpDumper($container);
218218
$dump = print_r($dumper->dump(array('as_files' => true, 'file' => __DIR__, 'hot_path_tag' => 'hot')), true);
219-
if ('\\' === DIRECTORY_SEPARATOR) {
219+
if ('\\' === \DIRECTORY_SEPARATOR) {
220220
$dump = str_replace('\\\\Fixtures\\\\includes\\\\foo.php', '/Fixtures/includes/foo.php', $dump);
221221
}
222222
$this->assertStringMatchesFormatFile(self::$fixturesPath.'/php/services9_as_files.txt', $dump);
@@ -907,7 +907,7 @@ public function testHotPathOptimizations()
907907
$dumper = new PhpDumper($container);
908908

909909
$dump = $dumper->dump(array('hot_path_tag' => 'container.hot_path', 'inline_class_loader_parameter' => 'inline_requires', 'file' => self::$fixturesPath.'/php/services_inline_requires.php'));
910-
if ('\\' === DIRECTORY_SEPARATOR) {
910+
if ('\\' === \DIRECTORY_SEPARATOR) {
911911
$dump = str_replace("'\\\\includes\\\\HotPath\\\\", "'/includes/HotPath/", $dump);
912912
}
913913

@@ -1027,7 +1027,7 @@ public function testErroredDefinition()
10271027
$container->compile();
10281028
$dumper = new PhpDumper($container);
10291029
$dump = $dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Errored_Definition'));
1030-
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services_errored_definition.php', str_replace(str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), '%path%', $dump));
1030+
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services_errored_definition.php', str_replace(str_replace('\\', '\\\\', self::$fixturesPath.\DIRECTORY_SEPARATOR.'includes'.\DIRECTORY_SEPARATOR), '%path%', $dump));
10311031
eval('?>'.$dump);
10321032

10331033
$container = new \Symfony_DI_PhpDumper_Errored_Definition();

Tests/Dumper/XmlDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testAddService()
5454
$container = include self::$fixturesPath.'/containers/container9.php';
5555
$dumper = new XmlDumper($container);
5656

57-
$this->assertEquals(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/xml/services9.xml')), $dumper->dump(), '->dump() dumps services');
57+
$this->assertEquals(str_replace('%path%', self::$fixturesPath.\DIRECTORY_SEPARATOR.'includes'.\DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/xml/services9.xml')), $dumper->dump(), '->dump() dumps services');
5858

5959
$dumper = new XmlDumper($container = new ContainerBuilder());
6060
$container->register('foo', 'FooClass')->addArgument(new \stdClass())->setPublic(true);

Tests/Dumper/YamlDumperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testAddService()
4949
{
5050
$container = include self::$fixturesPath.'/containers/container9.php';
5151
$dumper = new YamlDumper($container);
52-
$this->assertEqualYamlStructure(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/yaml/services9.yml')), $dumper->dump(), '->dump() dumps services');
52+
$this->assertEqualYamlStructure(str_replace('%path%', self::$fixturesPath.\DIRECTORY_SEPARATOR.'includes'.\DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/yaml/services9.yml')), $dumper->dump(), '->dump() dumps services');
5353

5454
$dumper = new YamlDumper($container = new ContainerBuilder());
5555
$container->register('foo', 'FooClass')->addArgument(new \stdClass())->setPublic(true);

Tests/Loader/PhpFileLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testConfigServices()
4747

4848
$container->compile();
4949
$dumper = new PhpDumper($container);
50-
$this->assertStringEqualsFile($fixtures.'/php/services9_compiled.php', str_replace(str_replace('\\', '\\\\', $fixtures.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), '%path%', $dumper->dump()));
50+
$this->assertStringEqualsFile($fixtures.'/php/services9_compiled.php', str_replace(str_replace('\\', '\\\\', $fixtures.\DIRECTORY_SEPARATOR.'includes'.\DIRECTORY_SEPARATOR), '%path%', $dumper->dump()));
5151
}
5252

5353
/**

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ public function testPrototype()
609609

610610
$resources = $container->getResources();
611611

612-
$fixturesDir = \dirname(__DIR__).DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR;
613-
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'xml'.DIRECTORY_SEPARATOR.'services_prototype.xml'), $resources));
612+
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
613+
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype.xml'), $resources));
614614
$this->assertTrue(false !== array_search(new GlobResource($fixturesDir.'Prototype', '/*', true), $resources));
615615
$resources = array_map('strval', $resources);
616616
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);

Tests/Loader/YamlFileLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ public function testPrototype()
363363

364364
$resources = $container->getResources();
365365

366-
$fixturesDir = \dirname(__DIR__).DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR;
367-
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'yaml'.DIRECTORY_SEPARATOR.'services_prototype.yml'), $resources));
366+
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
367+
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'yaml'.\DIRECTORY_SEPARATOR.'services_prototype.yml'), $resources));
368368
$this->assertTrue(false !== array_search(new GlobResource($fixturesDir.'Prototype', '', true), $resources));
369369
$resources = array_map('strval', $resources);
370370
$this->assertContains('reflection.Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo', $resources);

0 commit comments

Comments
 (0)