Skip to content

Commit

Permalink
Remove unused local variables in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyweb committed Oct 24, 2019
1 parent 9cf8179 commit 413a2c0
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Dumper/PhpDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public function dump(array $options = [])
foreach ($ids as $id) {
$c .= ' '.$this->doExport($id)." => true,\n";
}
$files['removed-ids.php'] = $c .= "];\n";
$files['removed-ids.php'] = $c."];\n";
}

foreach ($this->generateServiceFiles() as $file => $c) {
Expand Down
10 changes: 5 additions & 5 deletions Tests/Compiler/AnalyzeServiceReferencesPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@ public function testProcess()
{
$container = new ContainerBuilder();

$a = $container
$container
->register('a')
->addArgument($ref1 = new Reference('b'))
;

$b = $container
$container
->register('b')
->addMethodCall('setA', [$ref2 = new Reference('a')])
;

$c = $container
$container
->register('c')
->addArgument($ref3 = new Reference('a'))
->addArgument($ref4 = new Reference('b'))
;

$d = $container
$container
->register('d')
->setProperty('foo', $ref5 = new Reference('b'))
;

$e = $container
$container
->register('e')
->setConfigurator([$ref6 = new Reference('b'), 'methodName'])
;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Compiler/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testProcessRemovesAndInlinesRecursively()
->addArgument(new Reference('c'))
;

$b = $container
$container
->register('b', '\stdClass')
->addArgument(new Reference('c'))
->setPublic(false)
Expand Down
2 changes: 1 addition & 1 deletion Tests/Compiler/ResolveChildDefinitionsPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public function testBindings()
->setBindings(['a' => '1', 'b' => '2'])
;

$child = $container->setDefinition('child', new ChildDefinition('parent'))
$container->setDefinition('child', new ChildDefinition('parent'))
->setBindings(['b' => 'B', 'c' => 'C'])
;

Expand Down
4 changes: 2 additions & 2 deletions Tests/Compiler/ResolveClassPassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public function testAmbiguousChildDefinition()
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
$this->expectExceptionMessage('Service definition "App\Foo\Child" has a parent but no class, and its name looks like a FQCN. Either the class is missing or you want to inherit it from the parent service. To resolve this ambiguity, please rename this service to a non-FQCN (e.g. using dots), or create the missing class.');
$container = new ContainerBuilder();
$parent = $container->register('App\Foo', null);
$child = $container->setDefinition('App\Foo\Child', new ChildDefinition('App\Foo'));
$container->register('App\Foo', null);
$container->setDefinition('App\Foo\Child', new ChildDefinition('App\Foo'));

(new ResolveClassPass())->process($container);
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/ContainerBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ public function testNoClassFromGlobalNamespaceClassId()
$this->expectExceptionMessage('The definition for "DateTime" has no class attribute, and appears to reference a class or interface in the global namespace.');
$container = new ContainerBuilder();

$definition = $container->register(\DateTime::class);
$container->register(\DateTime::class);
$container->compile();
}

Expand Down Expand Up @@ -1295,7 +1295,7 @@ public function testNoClassFromNonClassId()
$this->expectExceptionMessage('The definition for "123_abc" has no class.');
$container = new ContainerBuilder();

$definition = $container->register('123_abc');
$container->register('123_abc');
$container->compile();
}

Expand All @@ -1305,7 +1305,7 @@ public function testNoClassFromNsSeparatorId()
$this->expectExceptionMessage('The definition for "\foo" has no class.');
$container = new ContainerBuilder();

$definition = $container->register('\\foo');
$container->register('\\foo');
$container->compile();
}

Expand Down
3 changes: 1 addition & 2 deletions Tests/Dumper/PhpDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ public function testInlineSelfRef()
->setPublic(true)
->addArgument($baz);

$passConfig = $container->getCompiler()->getPassConfig();
$container->getCompiler()->getPassConfig();
$container->compile();

$dumper = new PhpDumper($container);
Expand Down Expand Up @@ -978,7 +978,6 @@ public function testAdawsonContainer()
$container->compile();

$dumper = new PhpDumper($container);
$dump = $dumper->dump();
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services_adawson.php', $dumper->dump());
}

Expand Down
1 change: 0 additions & 1 deletion Tests/Loader/XmlFileLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,6 @@ public function testTsantosContainer()
$container->compile();

$dumper = new PhpDumper($container);
$dump = $dumper->dump();
$this->assertStringEqualsFile(self::$fixturesPath.'/php/services_tsantos.php', $dumper->dump());
}

Expand Down

0 comments on commit 413a2c0

Please sign in to comment.