Skip to content

Commit e90bd80

Browse files
Merge branch '2.8' into 3.4
* 2.8: Enable native_constant_invocation CS fixer
2 parents 98db6db + ad2446d commit e90bd80

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
@@ -1653,7 +1653,7 @@ private function inVendors($path)
16531653
$path = realpath($path) ?: $path;
16541654

16551655
foreach ($this->vendors as $vendor) {
1656-
if (0 === strpos($path, $vendor) && false !== strpbrk(substr($path, \strlen($vendor), 1), '/'.DIRECTORY_SEPARATOR)) {
1656+
if (0 === strpos($path, $vendor) && false !== strpbrk(substr($path, \strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) {
16571657
return true;
16581658
}
16591659
}

Dumper/PhpDumper.php

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

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

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

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

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

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

Loader/XmlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ public function validateSchema(\DOMDocument $dom)
611611
$locationstart = 'phar:///';
612612
}
613613
}
614-
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
614+
$drive = '\\' === \DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
615615
$location = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));
616616

617617
$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
@@ -184,15 +184,15 @@ public function testAddServiceWithoutCompilation()
184184
{
185185
$container = include self::$fixturesPath.'/containers/container9.php';
186186
$dumper = new PhpDumper($container);
187-
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services9.php', str_replace(str_replace('\\', '\\\\', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR), '%path%', $dumper->dump()), '->dump() dumps services');
187+
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services9.php', str_replace(str_replace('\\', '\\\\', self::$fixturesPath.\DIRECTORY_SEPARATOR.'includes'.\DIRECTORY_SEPARATOR), '%path%', $dumper->dump()), '->dump() dumps services');
188188
}
189189

190190
public function testAddService()
191191
{
192192
$container = include self::$fixturesPath.'/containers/container9.php';
193193
$container->compile();
194194
$dumper = new PhpDumper($container);
195-
$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');
195+
$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');
196196

197197
$container = new ContainerBuilder();
198198
$container->register('foo', 'FooClass')->addArgument(new \stdClass())->setPublic(true);
@@ -214,7 +214,7 @@ public function testDumpAsFiles()
214214
$container->compile();
215215
$dumper = new PhpDumper($container);
216216
$dump = print_r($dumper->dump(array('as_files' => true, 'file' => __DIR__, 'hot_path_tag' => 'hot')), true);
217-
if ('\\' === DIRECTORY_SEPARATOR) {
217+
if ('\\' === \DIRECTORY_SEPARATOR) {
218218
$dump = str_replace('\\\\Fixtures\\\\includes\\\\foo.php', '/Fixtures/includes/foo.php', $dump);
219219
}
220220
$this->assertStringMatchesFormatFile(self::$fixturesPath.'/php/services9_as_files.txt', $dump);
@@ -867,7 +867,7 @@ public function testHotPathOptimizations()
867867
$dumper = new PhpDumper($container);
868868

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

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
@@ -633,8 +633,8 @@ public function testPrototype()
633633

634634
$resources = $container->getResources();
635635

636-
$fixturesDir = \dirname(__DIR__).DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR;
637-
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'xml'.DIRECTORY_SEPARATOR.'services_prototype.xml'), $resources));
636+
$fixturesDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures'.\DIRECTORY_SEPARATOR;
637+
$this->assertTrue(false !== array_search(new FileResource($fixturesDir.'xml'.\DIRECTORY_SEPARATOR.'services_prototype.xml'), $resources));
638638
$this->assertTrue(false !== array_search(new GlobResource($fixturesDir.'Prototype', '/*', true), $resources));
639639
$resources = array_map('strval', $resources);
640640
$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
@@ -393,8 +393,8 @@ public function testPrototype()
393393

394394
$resources = $container->getResources();
395395

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

0 commit comments

Comments
 (0)