Skip to content

Commit 413a2c0

Browse files
committed
Remove unused local variables in tests
1 parent 9cf8179 commit 413a2c0

8 files changed

+14
-16
lines changed

Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public function dump(array $options = [])
219219
foreach ($ids as $id) {
220220
$c .= ' '.$this->doExport($id)." => true,\n";
221221
}
222-
$files['removed-ids.php'] = $c .= "];\n";
222+
$files['removed-ids.php'] = $c."];\n";
223223
}
224224

225225
foreach ($this->generateServiceFiles() as $file => $c) {

Tests/Compiler/AnalyzeServiceReferencesPassTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,28 @@ public function testProcess()
2525
{
2626
$container = new ContainerBuilder();
2727

28-
$a = $container
28+
$container
2929
->register('a')
3030
->addArgument($ref1 = new Reference('b'))
3131
;
3232

33-
$b = $container
33+
$container
3434
->register('b')
3535
->addMethodCall('setA', [$ref2 = new Reference('a')])
3636
;
3737

38-
$c = $container
38+
$container
3939
->register('c')
4040
->addArgument($ref3 = new Reference('a'))
4141
->addArgument($ref4 = new Reference('b'))
4242
;
4343

44-
$d = $container
44+
$container
4545
->register('d')
4646
->setProperty('foo', $ref5 = new Reference('b'))
4747
;
4848

49-
$e = $container
49+
$container
5050
->register('e')
5151
->setConfigurator([$ref6 = new Reference('b'), 'methodName'])
5252
;

Tests/Compiler/IntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testProcessRemovesAndInlinesRecursively()
4343
->addArgument(new Reference('c'))
4444
;
4545

46-
$b = $container
46+
$container
4747
->register('b', '\stdClass')
4848
->addArgument(new Reference('c'))
4949
->setPublic(false)

Tests/Compiler/ResolveChildDefinitionsPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public function testBindings()
390390
->setBindings(['a' => '1', 'b' => '2'])
391391
;
392392

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

Tests/Compiler/ResolveClassPassTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ public function testAmbiguousChildDefinition()
8787
$this->expectException('Symfony\Component\DependencyInjection\Exception\InvalidArgumentException');
8888
$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.');
8989
$container = new ContainerBuilder();
90-
$parent = $container->register('App\Foo', null);
91-
$child = $container->setDefinition('App\Foo\Child', new ChildDefinition('App\Foo'));
90+
$container->register('App\Foo', null);
91+
$container->setDefinition('App\Foo\Child', new ChildDefinition('App\Foo'));
9292

9393
(new ResolveClassPass())->process($container);
9494
}

Tests/ContainerBuilderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ public function testNoClassFromGlobalNamespaceClassId()
12651265
$this->expectExceptionMessage('The definition for "DateTime" has no class attribute, and appears to reference a class or interface in the global namespace.');
12661266
$container = new ContainerBuilder();
12671267

1268-
$definition = $container->register(\DateTime::class);
1268+
$container->register(\DateTime::class);
12691269
$container->compile();
12701270
}
12711271

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

1298-
$definition = $container->register('123_abc');
1298+
$container->register('123_abc');
12991299
$container->compile();
13001300
}
13011301

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

1308-
$definition = $container->register('\\foo');
1308+
$container->register('\\foo');
13091309
$container->compile();
13101310
}
13111311

Tests/Dumper/PhpDumperTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ public function testInlineSelfRef()
886886
->setPublic(true)
887887
->addArgument($baz);
888888

889-
$passConfig = $container->getCompiler()->getPassConfig();
889+
$container->getCompiler()->getPassConfig();
890890
$container->compile();
891891

892892
$dumper = new PhpDumper($container);
@@ -978,7 +978,6 @@ public function testAdawsonContainer()
978978
$container->compile();
979979

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

Tests/Loader/XmlFileLoaderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,6 @@ public function testTsantosContainer()
808808
$container->compile();
809809

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

0 commit comments

Comments
 (0)