Skip to content

Commit e70f025

Browse files
Merge branch '2.7' into 2.8
* 2.7: [DI] Remove unused props from the PhpDumper [ProxyManager] Cleanup fixtures [Debug] HTML-escape array key Add some phpdocs for IDE autocompletion and better SCA
2 parents d17e3e4 + 8388845 commit e70f025

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

Dumper/PhpDumper.php

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,11 @@ private function addProxyClasses()
255255
/**
256256
* Generates the require_once statement for service includes.
257257
*
258-
* @param string $id The service id
259258
* @param Definition $definition
260259
*
261260
* @return string
262261
*/
263-
private function addServiceInclude($id, $definition)
262+
private function addServiceInclude($definition)
264263
{
265264
$template = " require_once %s;\n";
266265
$code = '';
@@ -335,9 +334,9 @@ private function addServiceInlinedDefinitions($id, $definition)
335334
$code .= $this->addNewInstance($id, $sDefinition, '$'.$name, ' = ');
336335

337336
if (!$this->hasReference($id, $sDefinition->getMethodCalls(), true) && !$this->hasReference($id, $sDefinition->getProperties(), true)) {
338-
$code .= $this->addServiceProperties(null, $sDefinition, $name);
339-
$code .= $this->addServiceMethodCalls(null, $sDefinition, $name);
340-
$code .= $this->addServiceConfigurator(null, $sDefinition, $name);
337+
$code .= $this->addServiceProperties($sDefinition, $name);
338+
$code .= $this->addServiceMethodCalls($sDefinition, $name);
339+
$code .= $this->addServiceConfigurator($sDefinition, $name);
341340
}
342341

343342
$code .= "\n";
@@ -437,13 +436,12 @@ private function isSimpleInstance($id, Definition $definition)
437436
/**
438437
* Adds method calls to a service definition.
439438
*
440-
* @param string $id
441439
* @param Definition $definition
442440
* @param string $variableName
443441
*
444442
* @return string
445443
*/
446-
private function addServiceMethodCalls($id, Definition $definition, $variableName = 'instance')
444+
private function addServiceMethodCalls(Definition $definition, $variableName = 'instance')
447445
{
448446
$calls = '';
449447
foreach ($definition->getMethodCalls() as $call) {
@@ -458,7 +456,7 @@ private function addServiceMethodCalls($id, Definition $definition, $variableNam
458456
return $calls;
459457
}
460458

461-
private function addServiceProperties($id, Definition $definition, $variableName = 'instance')
459+
private function addServiceProperties(Definition $definition, $variableName = 'instance')
462460
{
463461
$code = '';
464462
foreach ($definition->getProperties() as $name => $value) {
@@ -501,9 +499,9 @@ private function addServiceInlinedDefinitionsSetup($id, Definition $definition)
501499
}
502500

503501
$name = (string) $this->definitionVariables->offsetGet($iDefinition);
504-
$code .= $this->addServiceProperties(null, $iDefinition, $name);
505-
$code .= $this->addServiceMethodCalls(null, $iDefinition, $name);
506-
$code .= $this->addServiceConfigurator(null, $iDefinition, $name);
502+
$code .= $this->addServiceProperties($iDefinition, $name);
503+
$code .= $this->addServiceMethodCalls($iDefinition, $name);
504+
$code .= $this->addServiceConfigurator($iDefinition, $name);
507505
}
508506

509507
if ('' !== $code) {
@@ -516,13 +514,12 @@ private function addServiceInlinedDefinitionsSetup($id, Definition $definition)
516514
/**
517515
* Adds configurator definition.
518516
*
519-
* @param string $id
520517
* @param Definition $definition
521518
* @param string $variableName
522519
*
523520
* @return string
524521
*/
525-
private function addServiceConfigurator($id, Definition $definition, $variableName = 'instance')
522+
private function addServiceConfigurator(Definition $definition, $variableName = 'instance')
526523
{
527524
if (!$callable = $definition->getConfigurator()) {
528525
return '';
@@ -646,14 +643,14 @@ private function addService($id, Definition $definition)
646643
}
647644

648645
$code .=
649-
$this->addServiceInclude($id, $definition).
646+
$this->addServiceInclude($definition).
650647
$this->addServiceLocalTempVariables($id, $definition).
651648
$this->addServiceInlinedDefinitions($id, $definition).
652649
$this->addServiceInstance($id, $definition).
653650
$this->addServiceInlinedDefinitionsSetup($id, $definition).
654-
$this->addServiceProperties($id, $definition).
655-
$this->addServiceMethodCalls($id, $definition).
656-
$this->addServiceConfigurator($id, $definition).
651+
$this->addServiceProperties($definition).
652+
$this->addServiceMethodCalls($definition).
653+
$this->addServiceConfigurator($definition).
657654
$this->addServiceReturn($id, $definition)
658655
;
659656
}

0 commit comments

Comments
 (0)