diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index dd1581dc040e..1a694a8d099b 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1030,12 +1030,13 @@ private function startClass(string $class, string $baseClass, string $baseClassW use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /*{$this->docStar} * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class $class extends $baseClass { @@ -1088,12 +1089,12 @@ public function __construct() $code .= <<parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; if (isset($this->buildParameters[$name])) { @@ -1373,12 +1374,12 @@ public function hasParameter($name) return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -1421,26 +1422,12 @@ public function getParameterBag() private \$loadedDynamicParameters = {$loadedDynamicParameters}; private \$dynamicParameters = []; - /*{$this->docStar} - * Computes a dynamic parameter. - * - * @param string \$name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter(\$name) + private function getDynamicParameter(string \$name) { {$getDynamicParameter} } - /*{$this->docStar} - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return $parameters; } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_alias_deprecation.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_alias_deprecation.php index cd77753e7bec..5b415ef0f379 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_alias_deprecation.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/container_alias_deprecation.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_Aliases_Deprecation extends Container { @@ -31,17 +32,17 @@ public function __construct() ]; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php index a5ea8d401581..0066ebcac519 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_constructor_without_arguments.php @@ -9,12 +9,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tests\Fixtures\Container\ConstructorWithoutArgumentsContainer { @@ -31,17 +32,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_mandatory_constructor_arguments.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_mandatory_constructor_arguments.php index 371c9e353c7a..e065fce00852 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_mandatory_constructor_arguments.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_mandatory_constructor_arguments.php @@ -9,12 +9,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tests\Fixtures\Container\ConstructorWithMandatoryArgumentsContainer { @@ -28,17 +29,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php index c10c8a91830c..c3fe6abea157 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_with_optional_constructor_arguments.php @@ -9,12 +9,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tests\Fixtures\Container\ConstructorWithOptionalArgumentsContainer { @@ -31,17 +32,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_without_constructor.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_without_constructor.php index a397e9b2792f..1c007a5f1c5e 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_without_constructor.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/custom_container_class_without_constructor.php @@ -9,12 +9,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tests\Fixtures\Container\NoConstructorContainer { @@ -28,17 +29,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php index e66edba4a64d..a42d7785185e 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1-1.php @@ -9,12 +9,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Container extends \Symfony\Component\DependencyInjection\Dump\AbstractContainer { @@ -28,17 +29,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php index 831aefb5cae5..af24b8cf4412 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services1.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -26,17 +27,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php index 081fd05102e2..9dbeb0eae1ee 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -31,17 +32,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -73,19 +74,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -101,26 +102,12 @@ public function getParameterBag() private $loadedDynamicParameters = []; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name)); } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'empty_value' => '', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php index 978bd775cff4..02f2469abc56 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -35,17 +36,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -77,19 +78,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -108,16 +109,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'foo': $value = ('wiz'.$this->targetDirs[1]); break; @@ -129,12 +121,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'bar' => __DIR__, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php index 4cbb648a7880..8e62b81ab28b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services13.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -29,17 +30,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php index a0a29ba8b105..d5482b1ddeb4 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -32,17 +33,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -88,19 +89,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -118,16 +119,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'foo': $value = $this->getEnv('FOO'); break; @@ -138,12 +130,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'env(FOO)' => 'Bar\\FaooClass', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services24.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services24.php index 9909d88589ee..7be80e1856f8 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services24.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services24.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -29,17 +30,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php index 9be6b232b2ec..ccf7e7ddde8a 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_EnvParameters extends Container { @@ -36,17 +37,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -88,19 +89,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -122,16 +123,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'bar': $value = $this->getEnv('FOO'); break; @@ -146,12 +138,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'project_dir' => '/foo/bar', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services33.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services33.php index 97d67b78b302..9c30be1b9777 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services33.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services33.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -30,17 +31,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php index dc3d321ebfe8..93c7ff45145a 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -28,17 +29,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -60,19 +61,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -88,26 +89,12 @@ public function getParameterBag() private $loadedDynamicParameters = []; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name)); } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'foo' => 'bar', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt index 1589c53c59c9..fadd8f2f2850 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_as_files.txt @@ -362,12 +362,13 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -426,17 +427,17 @@ class ProjectServiceContainer extends Container ]; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return require $this->containerDir.\DIRECTORY_SEPARATOR.'removed-ids.php'; } @@ -479,7 +480,7 @@ class ProjectServiceContainer extends Container return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; if (isset($this->buildParameters[$name])) { @@ -489,12 +490,12 @@ class ProjectServiceContainer extends Container return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -513,26 +514,12 @@ class ProjectServiceContainer extends Container private $loadedDynamicParameters = []; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name)); } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'baz_class' => 'BazClass', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php index ea405d4895d4..24c9b6f55fc6 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -59,17 +60,17 @@ public function __construct() ]; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -423,19 +424,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -451,26 +452,12 @@ public function getParameterBag() private $loadedDynamicParameters = []; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name)); } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'baz_class' => 'BazClass', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_inlined_factories.txt b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_inlined_factories.txt index 04e7de8981e5..73d2a4909395 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_inlined_factories.txt +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_inlined_factories.txt @@ -28,12 +28,13 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -94,17 +95,17 @@ class ProjectServiceContainer extends Container }; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return require $this->containerDir.\DIRECTORY_SEPARATOR.'removed-ids.php'; } @@ -477,7 +478,7 @@ class ProjectServiceContainer extends Container return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; if (isset($this->buildParameters[$name])) { @@ -487,12 +488,12 @@ class ProjectServiceContainer extends Container return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -511,26 +512,12 @@ class ProjectServiceContainer extends Container private $loadedDynamicParameters = []; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name)); } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'baz_class' => 'BazClass', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_lazy_inlined_factories.txt b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_lazy_inlined_factories.txt index 39388a6a35c3..713de1b8ff49 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_lazy_inlined_factories.txt +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_lazy_inlined_factories.txt @@ -18,12 +18,13 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -50,17 +51,17 @@ class ProjectServiceContainer extends Container $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return require $this->containerDir.\DIRECTORY_SEPARATOR.'removed-ids.php'; } @@ -113,7 +114,7 @@ class ProjectServiceContainer extends Container return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; if (isset($this->buildParameters[$name])) { @@ -123,12 +124,12 @@ class ProjectServiceContainer extends Container return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -147,26 +148,12 @@ class ProjectServiceContainer extends Container private $loadedDynamicParameters = []; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name)); } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'container.dumper.inline_factories' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_adawson.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_adawson.php index 43aa60c5ce2f..4c584f4aa434 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_adawson.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_adawson.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -30,17 +31,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'App\\Handler1' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_private.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_private.php index 3ca495283e13..ca85686f6e67 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_private.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_private.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container { @@ -46,17 +47,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_public.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_public.php index 8834fc727ec7..f7eb154f09fd 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_public.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_almost_circular_public.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container { @@ -55,17 +56,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_array_params.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_array_params.php index 563c3b7ae601..2b6664cf85e0 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_array_params.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_array_params.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -35,17 +36,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -81,19 +82,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -111,16 +112,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'array_2': $value = [ @@ -133,12 +125,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'array_1' => [ diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_base64_env.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_base64_env.php index 5652844e3764..ca1292a214e6 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_base64_env.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_base64_env.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_Base64Parameters extends Container { @@ -28,17 +29,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -60,19 +61,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -90,16 +91,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'hello': $value = $this->getEnv('base64:foo'); break; @@ -110,12 +102,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'env(foo)' => 'd29ybGQ=', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_csv_env.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_csv_env.php index 22fd21e0752e..cb25eb4f99d6 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_csv_env.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_csv_env.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_CsvParameters extends Container { @@ -28,17 +29,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -60,19 +61,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -90,16 +91,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'hello': $value = $this->getEnv('csv:foo'); break; @@ -110,12 +102,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'env(foo)' => 'foo,bar', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_dedup_lazy_proxy.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_dedup_lazy_proxy.php index 72b08f7bca60..47112f57454f 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_dedup_lazy_proxy.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_dedup_lazy_proxy.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -30,17 +31,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_deep_graph.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_deep_graph.php index 60f683e512b4..fca5c8504f99 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_deep_graph.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_deep_graph.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_Deep_Graph extends Container { @@ -30,17 +31,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_default_env.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_default_env.php index f565cf5f86ba..56f50dd22047 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_default_env.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_default_env.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_DefaultParameters extends Container { @@ -28,17 +29,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -60,19 +61,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -92,16 +93,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'fallback_env': $value = $this->getEnv('foobar'); break; @@ -114,12 +106,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'fallback_param' => 'baz', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_env_in_id.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_env_in_id.php index f0cca3ccfe56..c5c5536ebfb6 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_env_in_id.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_env_in_id.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -32,17 +33,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -86,19 +87,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -114,26 +115,12 @@ public function getParameterBag() private $loadedDynamicParameters = []; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name)); } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'env(BAR)' => 'bar', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_errored_definition.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_errored_definition.php index 39e2299f4cdf..01ec2e858076 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_errored_definition.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_errored_definition.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Errored_Definition extends Container { @@ -59,17 +60,17 @@ public function __construct() ]; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -423,19 +424,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -451,26 +452,12 @@ public function getParameterBag() private $loadedDynamicParameters = []; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name)); } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'baz_class' => 'BazClass', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_inline_requires.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_inline_requires.php index 8947bc37b63b..5d1c62522863 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_inline_requires.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_inline_requires.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -44,17 +45,17 @@ public function __construct() }; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -110,19 +111,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -138,26 +139,12 @@ public function getParameterBag() private $loadedDynamicParameters = []; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name)); } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'inline_requires' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_inline_self_ref.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_inline_self_ref.php index 60a39c608aeb..55de46ff1216 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_inline_self_ref.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_inline_self_ref.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_Inline_Self_Ref extends Container { @@ -29,17 +30,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_json_env.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_json_env.php index 47f2e73ac7ab..7d8cb9bfc06c 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_json_env.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_json_env.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_JsonParameters extends Container { @@ -28,17 +29,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -60,19 +61,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -91,16 +92,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'hello': $value = $this->getEnv('json:foo'); break; @@ -112,12 +104,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'env(foo)' => '["foo","bar"]', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php index dc120fb118ae..3855cc45dcab 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -36,17 +37,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy.php index 8536f6c67406..243596005d42 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -29,17 +30,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy_as_files.txt b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy_as_files.txt index 3eece3ef66aa..8f94683ed92d 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy_as_files.txt +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy_as_files.txt @@ -34,12 +34,13 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -64,17 +65,17 @@ class ProjectServiceContainer extends Container $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return require $this->containerDir.\DIRECTORY_SEPARATOR.'removed-ids.php'; } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php index 155220112721..6c498821996d 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -30,17 +31,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_in_expression.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_in_expression.php index 58b0d5b1926f..f058ae8bdbdf 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_in_expression.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_in_expression.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -29,17 +30,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_query_string_env.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_query_string_env.php index a357d16a7370..64fef86a844b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_query_string_env.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_query_string_env.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_QueryStringParameters extends Container { @@ -28,17 +29,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -60,19 +61,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -90,16 +91,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'hello': $value = $this->getEnv('query_string:foo'); break; @@ -110,12 +102,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'env(foo)' => 'foo=bar&baz[]=qux', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_rot13_env.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_rot13_env.php index 7c1a8a7c774c..3dc9a9263f73 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_rot13_env.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_rot13_env.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_Rot13Parameters extends Container { @@ -34,17 +35,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ '.service_locator.GU08LT9' => true, @@ -91,19 +92,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -121,16 +122,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'hello': $value = $this->getEnv('rot13:foo'); break; @@ -141,12 +133,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'env(foo)' => 'jbeyq', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_service_locator_argument.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_service_locator_argument.php index 1fbe964dfb19..19617f2cc592 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_service_locator_argument.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_service_locator_argument.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Service_Locator_Argument extends Container { @@ -35,17 +36,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ '.service_locator.38dy3OH' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php index b881b676b755..b8126d542728 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -32,17 +33,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ '.service_locator.nZQiwdg' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_tsantos.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_tsantos.php index d301e88ad50b..099a6e0b66c4 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_tsantos.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_tsantos.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class ProjectServiceContainer extends Container { @@ -30,17 +31,17 @@ public function __construct() ]; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_uninitialized_ref.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_uninitialized_ref.php index 95fcf89d26d9..5accf7553d3e 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_uninitialized_ref.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_uninitialized_ref.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_Uninitialized_Reference extends Container { @@ -31,17 +32,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_unsupported_characters.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_unsupported_characters.php index f6e1a2da5bd2..b1cb22986c29 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_unsupported_characters.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_unsupported_characters.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_Unsupported_Characters extends Container { @@ -33,17 +34,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -95,19 +96,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -123,26 +124,12 @@ public function getParameterBag() private $loadedDynamicParameters = []; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { throw new InvalidArgumentException(sprintf('The dynamic parameter "%s" must be defined.', $name)); } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ '\'' => 'oh-no', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_url_env.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_url_env.php index 65a31a1962de..abe0e39a34f4 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_url_env.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_url_env.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Test_UrlParameters extends Container { @@ -28,17 +29,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true, @@ -60,19 +61,19 @@ public function getParameter($name) return $this->parameters[$name]; } - public function hasParameter($name) + public function hasParameter($name): bool { $name = (string) $name; return isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || array_key_exists($name, $this->parameters); } - public function setParameter($name, $value) + public function setParameter($name, $value): void { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); } - public function getParameterBag() + public function getParameterBag(): ParameterBagInterface { if (null === $this->parameterBag) { $parameters = $this->parameters; @@ -90,16 +91,7 @@ public function getParameterBag() ]; private $dynamicParameters = []; - /** - * Computes a dynamic parameter. - * - * @param string $name The name of the dynamic parameter to load - * - * @return mixed The value of the dynamic parameter - * - * @throws InvalidArgumentException When the dynamic parameter does not exist - */ - private function getDynamicParameter($name) + private function getDynamicParameter(string $name) { switch ($name) { case 'hello': $value = $this->getEnv('url:foo'); break; @@ -110,12 +102,7 @@ private function getDynamicParameter($name) return $this->dynamicParameters[$name] = $value; } - /** - * Gets the default parameters. - * - * @return array An array of the default parameters - */ - protected function getDefaultParameters() + protected function getDefaultParameters(): array { return [ 'env(foo)' => 'postgres://user@localhost:5432/database?sslmode=disable', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_wither.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_wither.php index 9e28c238db67..545638d90f79 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_wither.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_wither.php @@ -7,12 +7,13 @@ use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * This class has been auto-generated * by the Symfony Dependency Injection Component. * - * @final since Symfony 3.3 + * @final */ class Symfony_DI_PhpDumper_Service_Wither extends Container { @@ -29,17 +30,17 @@ public function __construct() $this->aliases = []; } - public function compile() + public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.'); } - public function isCompiled() + public function isCompiled(): bool { return true; } - public function getRemovedIds() + public function getRemovedIds(): array { return [ 'Psr\\Container\\ContainerInterface' => true,