Skip to content

Commit bda259d

Browse files
Merge branch '3.4' into 4.0
* 3.4: Enable native_constant_invocation CS fixer
2 parents 2f3bd1c + e90bd80 commit bda259d

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

ContainerBuilder.php

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

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

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
@@ -593,7 +593,7 @@ public function validateSchema(\DOMDocument $dom)
593593
$locationstart = 'phar:///';
594594
}
595595
}
596-
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
596+
$drive = '\\' === \DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
597597
$location = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));
598598

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

Tests/Dumper/PhpDumperTest.php

Lines changed: 3 additions & 3 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);
@@ -212,7 +212,7 @@ public function testDumpAsFiles()
212212
$container->compile();
213213
$dumper = new PhpDumper($container);
214214
$dump = print_r($dumper->dump(array('as_files' => true, 'file' => __DIR__, 'hot_path_tag' => 'hot')), true);
215-
if ('\\' === DIRECTORY_SEPARATOR) {
215+
if ('\\' === \DIRECTORY_SEPARATOR) {
216216
$dump = str_replace('\\\\Fixtures\\\\includes\\\\foo.php', '/Fixtures/includes/foo.php', $dump);
217217
}
218218
$this->assertStringMatchesFormatFile(self::$fixturesPath.'/php/services9_as_files.txt', $dump);
@@ -865,7 +865,7 @@ public function testHotPathOptimizations()
865865
$dumper = new PhpDumper($container);
866866

867867
$dump = $dumper->dump(array('hot_path_tag' => 'container.hot_path', 'inline_class_loader_parameter' => 'inline_requires', 'file' => self::$fixturesPath.'/php/services_inline_requires.php'));
868-
if ('\\' === DIRECTORY_SEPARATOR) {
868+
if ('\\' === \DIRECTORY_SEPARATOR) {
869869
$dump = str_replace("'\\\\includes\\\\HotPath\\\\", "'/includes/HotPath/", $dump);
870870
}
871871

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
@@ -46,7 +46,7 @@ public function testConfigServices()
4646

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

5252
/**

Tests/Loader/XmlFileLoaderTest.php

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

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

611-
$fixturesDir = \dirname(__DIR__).DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR;
612-
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'xml'.DIRECTORY_SEPARATOR.'services_prototype.xml'), $resources));
611+
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
612+
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype.xml'), $resources));
613613
$this->assertTrue(false !== array_search(new GlobResource($fixturesDir.'Prototype', '/*', true), $resources));
614614
$resources = array_map('strval', $resources);
615615
$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
@@ -362,8 +362,8 @@ public function testPrototype()
362362

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

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

0 commit comments

Comments
 (0)