From 3ffe5573e9dd045e157c6f17358c700fceae3feb Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 22 Dec 2020 17:31:14 +0100 Subject: [PATCH] Add missing `@return` annotations to fix deprecations on PHP 8 --- .travis.yml | 13 +++---------- .../Tests/Fixtures/Type/StringWrapperType.php | 4 ++++ .../Tests/PropertyInfo/Fixtures/DoctrineFooType.php | 4 ++++ .../Bridge/Monolog/Formatter/ConsoleFormatter.php | 4 ++++ .../Bridge/Monolog/Formatter/VarDumperFormatter.php | 10 ++++++++++ .../Controller/AbstractController.php | 2 +- .../FrameworkBundle/Controller/Controller.php | 2 +- .../Routing/LegacyRouteLoaderContainer.php | 2 ++ .../Bundle/FrameworkBundle/Test/TestContainer.php | 2 ++ src/Symfony/Component/Cache/CacheItem.php | 2 ++ src/Symfony/Component/Cache/Psr16Cache.php | 2 ++ .../DependencyInjection/Argument/ServiceLocator.php | 2 ++ .../Component/DependencyInjection/Container.php | 2 +- .../DependencyInjection/ContainerInterface.php | 2 +- .../DependencyInjection/Dumper/PhpDumper.php | 3 +++ .../DependencyInjection/ServiceLocator.php | 5 +++++ .../Tests/Compiler/IntegrationTest.php | 3 +++ .../Tests/Fixtures/php/services10.php | 3 +++ .../Tests/Fixtures/php/services12.php | 3 +++ .../Tests/Fixtures/php/services19.php | 3 +++ .../Tests/Fixtures/php/services26.php | 3 +++ .../Tests/Fixtures/php/services8.php | 3 +++ .../Tests/Fixtures/php/services9_as_files.txt | 3 +++ .../Tests/Fixtures/php/services9_compiled.php | 3 +++ .../Fixtures/php/services9_inlined_factories.txt | 3 +++ .../php/services9_lazy_inlined_factories.txt | 3 +++ .../Tests/Fixtures/php/services_array_params.php | 3 +++ .../Tests/Fixtures/php/services_base64_env.php | 3 +++ .../Tests/Fixtures/php/services_csv_env.php | 3 +++ .../Tests/Fixtures/php/services_default_env.php | 3 +++ .../Tests/Fixtures/php/services_env_in_id.php | 3 +++ .../Fixtures/php/services_errored_definition.php | 3 +++ .../Tests/Fixtures/php/services_inline_requires.php | 3 +++ .../Tests/Fixtures/php/services_json_env.php | 3 +++ .../Fixtures/php/services_query_string_env.php | 3 +++ .../Tests/Fixtures/php/services_rot13_env.php | 3 +++ .../php/services_unsupported_characters.php | 3 +++ .../Tests/Fixtures/php/services_url_env.php | 3 +++ .../Form/Tests/Resources/TranslationFilesTest.php | 4 +++- .../Core/Tests/Resources/TranslationFilesTest.php | 4 +++- .../Tests/Resources/TranslationFilesTest.php | 4 +++- .../Contracts/Service/ServiceLocatorTrait.php | 2 ++ 42 files changed, 124 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index f04709b5fe..0d7bd87293 100644 --- a/.travis.yml +++ b/.travis.yml @@ -149,7 +149,7 @@ before_install: if [[ $PHP = 8.* ]]; then tfold ext.memcached tpecl memcached-3.1.5 memcached.so $INI else - tfold ext.mongodb tpecl mongodb-1.6.16 mongodb.so $INI + tfold ext.mongodb tpecl mongodb-1.8.1 mongodb.so $INI tfold ext.zookeeper tpecl zookeeper-0.7.2 zookeeper.so $INI tfold ext.amqp tpecl amqp-1.10.2 amqp.so $INI fi @@ -215,13 +215,6 @@ install: export COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -not -wholename '*/Bridge/PhpUnit/*' -printf '%h\n' | sort) fi - - | - # Set composer's platform to php 7.4 if we're on php 8. - if [[ $PHP = 8.* ]]; then - composer config platform.php 7.4.99 - export SYMFONY_DEPRECATIONS_HELPER=max[total]=999 - fi - - | # Install symfony/flex if [[ $deps = low ]]; then @@ -262,7 +255,7 @@ install: fi phpenv global $PHP rm vendor/composer/package-versions-deprecated -Rf - ([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; cp composer.json composer.bak; composer config platform.ext-mongodb 1.6.99; composer require --dev --no-update mongodb/mongodb ~1.5.0) + ([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; cp composer.json composer.bak; composer config platform.ext-mongodb 1.8.99; composer require --dev --no-update mongodb/mongodb ^1.8.1) tfold 'composer update' $COMPOSER_UP tfold 'phpunit install' ./phpunit install if [[ $deps = high ]]; then @@ -279,7 +272,7 @@ install: git fetch --depth=2 origin $SYMFONY_VERSION git checkout -m FETCH_HEAD COMPONENTS=$(echo "$COMPONENTS" | xargs dirname | xargs -n1 -I{} bash -c "[ -e '{}/phpunit.xml.dist' ] && echo '{}'" | sort) - (cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.6.99; composer require --dev --no-update mongodb/mongodb) + (cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.8.99; composer require --dev --no-update mongodb/mongodb) [[ ! $COMPONENTS ]] || tfold 'phpunit install' SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 ./phpunit install [[ ! $COMPONENTS ]] || echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && rm composer.lock vendor/ -Rf && $COMPOSER_UP && $PHPUNIT_X$LEGACY'" || X=1 fi diff --git a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Type/StringWrapperType.php b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Type/StringWrapperType.php index d3c93d1956..d01148f3b0 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Type/StringWrapperType.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Fixtures/Type/StringWrapperType.php @@ -18,6 +18,8 @@ class StringWrapperType extends StringType { /** * {@inheritdoc} + * + * @return mixed */ public function convertToDatabaseValue($value, AbstractPlatform $platform) { @@ -26,6 +28,8 @@ class StringWrapperType extends StringType /** * {@inheritdoc} + * + * @return mixed */ public function convertToPHPValue($value, AbstractPlatform $platform) { diff --git a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php index 37853b4815..d7dbb1eeb4 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php +++ b/src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/Fixtures/DoctrineFooType.php @@ -43,6 +43,8 @@ class DoctrineFooType extends Type /** * {@inheritdoc} + * + * @return mixed */ public function convertToDatabaseValue($value, AbstractPlatform $platform) { @@ -58,6 +60,8 @@ class DoctrineFooType extends Type /** * {@inheritdoc} + * + * @return mixed */ public function convertToPHPValue($value, AbstractPlatform $platform) { diff --git a/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php b/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php index be4838a795..502c36fb88 100644 --- a/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php +++ b/src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php @@ -83,6 +83,8 @@ class ConsoleFormatter implements FormatterInterface /** * {@inheritdoc} + * + * @return mixed */ public function formatBatch(array $records) { @@ -95,6 +97,8 @@ class ConsoleFormatter implements FormatterInterface /** * {@inheritdoc} + * + * @return mixed */ public function format(array $record) { diff --git a/src/Symfony/Bridge/Monolog/Formatter/VarDumperFormatter.php b/src/Symfony/Bridge/Monolog/Formatter/VarDumperFormatter.php index e96b510a8b..8fe52385cc 100644 --- a/src/Symfony/Bridge/Monolog/Formatter/VarDumperFormatter.php +++ b/src/Symfony/Bridge/Monolog/Formatter/VarDumperFormatter.php @@ -26,6 +26,11 @@ class VarDumperFormatter implements FormatterInterface $this->cloner = $cloner ?: new VarCloner(); } + /** + * {@inheritdoc} + * + * @return mixed + */ public function format(array $record) { $record['context'] = $this->cloner->cloneVar($record['context']); @@ -34,6 +39,11 @@ class VarDumperFormatter implements FormatterInterface return $record; } + /** + * {@inheritdoc} + * + * @return mixed + */ public function formatBatch(array $records) { foreach ($records as $k => $record) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php index 066678df2a..ac3701675c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php @@ -58,7 +58,7 @@ abstract class AbstractController implements ServiceSubscriberInterface /** * Gets a container parameter by its name. * - * @return mixed + * @return array|bool|float|int|string|null * * @final */ diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php index b6708db544..de68e41381 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php @@ -31,7 +31,7 @@ abstract class Controller implements ContainerAwareInterface /** * Gets a container configuration parameter by its name. * - * @return mixed + * @return array|bool|float|int|string|null * * @final */ diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/LegacyRouteLoaderContainer.php b/src/Symfony/Bundle/FrameworkBundle/Routing/LegacyRouteLoaderContainer.php index 66d09b9378..10529b459a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Routing/LegacyRouteLoaderContainer.php +++ b/src/Symfony/Bundle/FrameworkBundle/Routing/LegacyRouteLoaderContainer.php @@ -29,6 +29,8 @@ class LegacyRouteLoaderContainer implements ContainerInterface /** * {@inheritdoc} + * + * @return mixed */ public function get($id) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php b/src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php index 458720268d..31fd0a32c3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php @@ -58,6 +58,8 @@ class TestContainer extends Container /** * {@inheritdoc} + * + * @return array|bool|float|int|string|null */ public function getParameter($name) { diff --git a/src/Symfony/Component/Cache/CacheItem.php b/src/Symfony/Component/Cache/CacheItem.php index 3de8ddc81c..fe688c5f0c 100644 --- a/src/Symfony/Component/Cache/CacheItem.php +++ b/src/Symfony/Component/Cache/CacheItem.php @@ -43,6 +43,8 @@ final class CacheItem implements ItemInterface /** * {@inheritdoc} + * + * @return mixed */ public function get() { diff --git a/src/Symfony/Component/Cache/Psr16Cache.php b/src/Symfony/Component/Cache/Psr16Cache.php index ba8b5b37f9..fae7eb75a4 100644 --- a/src/Symfony/Component/Cache/Psr16Cache.php +++ b/src/Symfony/Component/Cache/Psr16Cache.php @@ -66,6 +66,8 @@ class Psr16Cache implements CacheInterface, PruneableInterface, ResettableInterf /** * {@inheritdoc} + * + * @return mixed */ public function get($key, $default = null) { diff --git a/src/Symfony/Component/DependencyInjection/Argument/ServiceLocator.php b/src/Symfony/Component/DependencyInjection/Argument/ServiceLocator.php index 2001a95617..4f3c19eb30 100644 --- a/src/Symfony/Component/DependencyInjection/Argument/ServiceLocator.php +++ b/src/Symfony/Component/DependencyInjection/Argument/ServiceLocator.php @@ -34,6 +34,8 @@ class ServiceLocator extends BaseServiceLocator /** * {@inheritdoc} + * + * @return mixed */ public function get($id) { diff --git a/src/Symfony/Component/DependencyInjection/Container.php b/src/Symfony/Component/DependencyInjection/Container.php index 4e2665745c..2988f18a36 100644 --- a/src/Symfony/Component/DependencyInjection/Container.php +++ b/src/Symfony/Component/DependencyInjection/Container.php @@ -109,7 +109,7 @@ class Container implements ResettableContainerInterface * * @param string $name The parameter name * - * @return mixed The parameter value + * @return array|bool|float|int|string|null The parameter value * * @throws InvalidArgumentException if the parameter is not defined */ diff --git a/src/Symfony/Component/DependencyInjection/ContainerInterface.php b/src/Symfony/Component/DependencyInjection/ContainerInterface.php index 41079cd13b..92eeb1f13f 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerInterface.php +++ b/src/Symfony/Component/DependencyInjection/ContainerInterface.php @@ -76,7 +76,7 @@ interface ContainerInterface extends PsrContainerInterface * * @param string $name The parameter name * - * @return mixed The parameter value + * @return array|bool|float|int|string|null The parameter value * * @throws InvalidArgumentException if the parameter is not defined */ diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index c4c0ddcdd2..e6e51054d9 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1449,6 +1449,9 @@ EOF; $code = <<<'EOF' + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; diff --git a/src/Symfony/Component/DependencyInjection/ServiceLocator.php b/src/Symfony/Component/DependencyInjection/ServiceLocator.php index 350c987297..bdd1041014 100644 --- a/src/Symfony/Component/DependencyInjection/ServiceLocator.php +++ b/src/Symfony/Component/DependencyInjection/ServiceLocator.php @@ -33,6 +33,11 @@ class ServiceLocator implements ServiceProviderInterface private $externalId; private $container; + /** + * {@inheritdoc} + * + * @return mixed + */ public function get($id) { if (!$this->externalId) { diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php index 26e50f484b..4923533c08 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php @@ -537,6 +537,9 @@ class DecoratedServiceLocator implements ServiceProviderInterface $this->locator = $locator; } + /** + * @return mixed + */ public function get($id) { return $this->locator->get($id); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php index bc5a096746..ce53539210 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php @@ -59,6 +59,9 @@ class ProjectServiceContainer extends Container return $this->services['test'] = new \stdClass(['only dot' => '.', 'concatenation as value' => '.\'\'.', 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => 'string1-string2', 'optimize concatenation with empty string' => 'string1string2', 'optimize concatenation from the start' => 'start', 'optimize concatenation at the end' => 'end', 'new line' => 'string with '."\n".'new line']); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php index bf71b4216a..36f55be001 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services12.php @@ -59,6 +59,9 @@ class ProjectServiceContainer extends Container return $this->services['test'] = new \stdClass(('file://'.\dirname(__DIR__, 1)), [('file://'.\dirname(__DIR__, 1)) => (\dirname(__DIR__, 2).'/')]); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php index b5ff25acb8..2344547145 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services19.php @@ -74,6 +74,9 @@ class ProjectServiceContainer extends Container return $instance; } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php index 063ebfd14d..5b6d6d7ba4 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services26.php @@ -70,6 +70,9 @@ class Symfony_DI_PhpDumper_Test_EnvParameters extends Container return $this->services['test'] = new ${($_ = $this->getEnv('FOO')) && false ?: "_"}($this->getEnv('Bar'), 'foo'.$this->getEnv('string:FOO').'baz', $this->getEnv('int:Baz')); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php index aefde3a473..a2473e1c31 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services8.php @@ -46,6 +46,9 @@ class ProjectServiceContainer extends Container ]; } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 1845785fb5..d3ef7465d5 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 @@ -460,6 +460,9 @@ class ProjectServiceContainer extends Container return $instance; } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 512994ef12..ddc9228b64 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services9_compiled.php @@ -409,6 +409,9 @@ class ProjectServiceContainer extends Container return new \SimpleFactoryClass('foo'); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 6172b88443..2ce28b8a37 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 @@ -458,6 +458,9 @@ class ProjectServiceContainer extends Container return new \SimpleFactoryClass('foo'); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 936baf422b..6c50daf2a4 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 @@ -94,6 +94,9 @@ class ProjectServiceContainer extends Container return new \Bar\FooClass(new \Bar\FooLazyClass()); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 4e704e469c..044e4e9f8a 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 @@ -63,6 +63,9 @@ class ProjectServiceContainer extends Container return $instance; } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 fe5a60a0df..fd7da6241f 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 @@ -46,6 +46,9 @@ class Symfony_DI_PhpDumper_Test_Base64Parameters extends Container ]; } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 4fbb831885..1f89a77b73 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 @@ -46,6 +46,9 @@ class Symfony_DI_PhpDumper_Test_CsvParameters extends Container ]; } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 582ac453af..8d30fcae95 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 @@ -46,6 +46,9 @@ class Symfony_DI_PhpDumper_Test_DefaultParameters extends Container ]; } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 3d381cabd1..716a52a3f1 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 @@ -72,6 +72,9 @@ class ProjectServiceContainer extends Container return $this->services['foo'] = new \stdClass(($this->privates['bar_%env(BAR)%'] ?? ($this->privates['bar_%env(BAR)%'] = new \stdClass())), ['baz_'.$this->getEnv('string:BAR') => new \stdClass()]); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 3e84e304a7..015949d4fe 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 @@ -409,6 +409,9 @@ class Symfony_DI_PhpDumper_Errored_Definition extends Container return new \SimpleFactoryClass('foo'); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 14bbc1ff31..ba3c0cba89 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 @@ -92,6 +92,9 @@ class ProjectServiceContainer extends Container return $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C2'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C2(new \Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C3()); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 18b5253092..f2368dc216 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 @@ -46,6 +46,9 @@ class Symfony_DI_PhpDumper_Test_JsonParameters extends Container ]; } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 be3d8dcadb..c62cd98e34 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 @@ -46,6 +46,9 @@ class Symfony_DI_PhpDumper_Test_QueryStringParameters extends Container ]; } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 5dcfa4159e..8b3fe88c48 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 @@ -77,6 +77,9 @@ class Symfony_DI_PhpDumper_Test_Rot13Parameters extends Container ]); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 a958e8ee05..77d28cda7c 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 @@ -81,6 +81,9 @@ class Symfony_DI_PhpDumper_Test_Unsupported_Characters extends Container return $this->services['foo*/oh-no'] = new \FooClass(); } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; 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 1ef02e372c..3477243249 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 @@ -46,6 +46,9 @@ class Symfony_DI_PhpDumper_Test_UrlParameters extends Container ]; } + /** + * @return array|bool|float|int|string|null + */ public function getParameter($name) { $name = (string) $name; diff --git a/src/Symfony/Component/Form/Tests/Resources/TranslationFilesTest.php b/src/Symfony/Component/Form/Tests/Resources/TranslationFilesTest.php index 5a9669e92b..4d59b73583 100644 --- a/src/Symfony/Component/Form/Tests/Resources/TranslationFilesTest.php +++ b/src/Symfony/Component/Form/Tests/Resources/TranslationFilesTest.php @@ -37,7 +37,9 @@ class TranslationFilesTest extends TestCase { $document = new \DOMDocument(); $document->loadXML(file_get_contents($filePath)); - libxml_disable_entity_loader(true); + if (\LIBXML_VERSION < 20900) { + libxml_disable_entity_loader(true); + } $errors = XliffUtils::validateSchema($document); diff --git a/src/Symfony/Component/Security/Core/Tests/Resources/TranslationFilesTest.php b/src/Symfony/Component/Security/Core/Tests/Resources/TranslationFilesTest.php index 4255e91d92..c0607ed107 100644 --- a/src/Symfony/Component/Security/Core/Tests/Resources/TranslationFilesTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Resources/TranslationFilesTest.php @@ -36,7 +36,9 @@ class TranslationFilesTest extends TestCase { $document = new \DOMDocument(); $document->loadXML(file_get_contents($filePath)); - libxml_disable_entity_loader(true); + if (\LIBXML_VERSION < 20900) { + libxml_disable_entity_loader(true); + } $errors = XliffUtils::validateSchema($document); diff --git a/src/Symfony/Component/Validator/Tests/Resources/TranslationFilesTest.php b/src/Symfony/Component/Validator/Tests/Resources/TranslationFilesTest.php index 6e0620b517..7fa81d9fe0 100644 --- a/src/Symfony/Component/Validator/Tests/Resources/TranslationFilesTest.php +++ b/src/Symfony/Component/Validator/Tests/Resources/TranslationFilesTest.php @@ -36,7 +36,9 @@ class TranslationFilesTest extends TestCase { $document = new \DOMDocument(); $document->loadXML(file_get_contents($filePath)); - libxml_disable_entity_loader(true); + if (\LIBXML_VERSION < 20900) { + libxml_disable_entity_loader(true); + } $errors = XliffUtils::validateSchema($document); diff --git a/src/Symfony/Contracts/Service/ServiceLocatorTrait.php b/src/Symfony/Contracts/Service/ServiceLocatorTrait.php index 1737f50e99..da797edca5 100644 --- a/src/Symfony/Contracts/Service/ServiceLocatorTrait.php +++ b/src/Symfony/Contracts/Service/ServiceLocatorTrait.php @@ -50,6 +50,8 @@ trait ServiceLocatorTrait /** * {@inheritdoc} + * + * @return mixed */ public function get($id) {