diff --git a/src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php index 3ed12fc3f692d..9843893088074 100644 --- a/src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/DebugBundle/DependencyInjection/Configuration.php @@ -24,7 +24,7 @@ class Configuration implements ConfigurationInterface /** * {@inheritdoc} */ - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('debug'); diff --git a/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php b/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php index bce977e9b1197..731cc62b3116d 100644 --- a/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php +++ b/src/Symfony/Bundle/DebugBundle/DependencyInjection/DebugExtension.php @@ -100,7 +100,7 @@ public function load(array $configs, ContainerBuilder $container) /** * {@inheritdoc} */ - public function getXsdValidationBasePath() + public function getXsdValidationBasePath(): string|false { return __DIR__.'/../Resources/config/schema'; } @@ -108,7 +108,7 @@ public function getXsdValidationBasePath() /** * {@inheritdoc} */ - public function getNamespace() + public function getNamespace(): string { return 'http://symfony.com/schema/dic/debug'; } diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php index 17e066045a04c..f4a06a2cf1bc2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php @@ -32,7 +32,7 @@ public function __construct(string $phpArrayFile) /** * {@inheritdoc} */ - public function isOptional() + public function isOptional(): bool { return true; } @@ -42,7 +42,7 @@ public function isOptional() * * @return string[] A list of classes to preload on PHP 7.4+ */ - public function warmUp(string $cacheDir) + public function warmUp(string $cacheDir): array { $arrayAdapter = new ArrayAdapter(); @@ -66,7 +66,7 @@ public function warmUp(string $cacheDir) /** * @return string[] A list of classes to preload on PHP 7.4+ */ - protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values) + protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values): array { return (array) $phpArrayAdapter->warmUp($values); } @@ -85,5 +85,5 @@ final protected function ignoreAutoloadException(string $class, \Exception $exce /** * @return bool false if there is nothing to warm-up */ - abstract protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter); + abstract protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter): bool; } diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AnnotationsCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AnnotationsCacheWarmer.php index 3606b9e8ea8ce..c060959804dfc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AnnotationsCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AnnotationsCacheWarmer.php @@ -45,7 +45,7 @@ public function __construct(Reader $annotationReader, string $phpArrayFile, stri /** * {@inheritdoc} */ - protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter) + protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter): bool { $annotatedClassPatterns = $cacheDir.'/annotations.map'; @@ -76,7 +76,7 @@ protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter) /** * @return string[] A list of classes to preload on PHP 7.4+ */ - protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values) + protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values): array { // make sure we don't cache null values $values = array_filter($values, function ($val) { return null !== $val; }); diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ConfigBuilderCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ConfigBuilderCacheWarmer.php index ed20bbcb648d7..c0d96c5ea7b74 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ConfigBuilderCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ConfigBuilderCacheWarmer.php @@ -42,7 +42,7 @@ public function __construct(KernelInterface $kernel, LoggerInterface $logger = n * * @return string[] */ - public function warmUp(string $cacheDir) + public function warmUp(string $cacheDir): array { $generator = new ConfigBuilderGenerator($cacheDir); @@ -84,7 +84,7 @@ private function dumpExtension(ExtensionInterface $extension, ConfigBuilderGener /** * {@inheritdoc} */ - public function isOptional() + public function isOptional(): bool { return true; } diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php index 0ada0ffc94349..e574cea817596 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/SerializerCacheWarmer.php @@ -42,7 +42,7 @@ public function __construct(array $loaders, string $phpArrayFile) /** * {@inheritdoc} */ - protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter) + protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter): bool { if (!class_exists(CacheClassMetadataFactory::class) || !method_exists(XmlFileLoader::class, 'getMappedClasses') || !method_exists(YamlFileLoader::class, 'getMappedClasses')) { return false; diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php index 93423753b2e63..e16ef30b536e5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TranslationsCacheWarmer.php @@ -38,7 +38,7 @@ public function __construct(ContainerInterface $container) * * @return string[] */ - public function warmUp(string $cacheDir) + public function warmUp(string $cacheDir): array { if (null === $this->translator) { $this->translator = $this->container->get('translator'); @@ -54,7 +54,7 @@ public function warmUp(string $cacheDir) /** * {@inheritdoc} */ - public function isOptional() + public function isOptional(): bool { return true; } diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php index 3c6d582c43206..6b2c558be96e5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ValidatorCacheWarmer.php @@ -42,7 +42,7 @@ public function __construct(ValidatorBuilder $validatorBuilder, string $phpArray /** * {@inheritdoc} */ - protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter) + protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter): bool { if (!method_exists($this->validatorBuilder, 'getLoaders')) { return false; @@ -71,7 +71,7 @@ protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter) /** * @return string[] A list of classes to preload on PHP 7.4+ */ - protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values) + protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array $values): array { // make sure we don't cache null values $values = array_filter($values, function ($val) { return null !== $val; }); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php index 7650e2963ec03..41d3eddd9964e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php @@ -54,10 +54,7 @@ protected function listBundles(OutputInterface|StyleInterface $output) } } - /** - * @return ExtensionInterface - */ - protected function findExtension(string $name) + protected function findExtension(string $name): ExtensionInterface { $bundles = $this->initializeBundles(); $minScore = \INF; diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php index 7fe7bc937d315..42bed36f56445 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Application.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Application.php @@ -46,10 +46,8 @@ public function __construct(KernelInterface $kernel) /** * Gets the Kernel associated with this Console. - * - * @return KernelInterface */ - public function getKernel() + public function getKernel(): KernelInterface { return $this->kernel; } @@ -69,7 +67,7 @@ public function reset() * * @return int 0 if everything went fine, or an error code */ - public function doRun(InputInterface $input, OutputInterface $output) + public function doRun(InputInterface $input, OutputInterface $output): int { $this->registerCommands(); @@ -85,7 +83,7 @@ public function doRun(InputInterface $input, OutputInterface $output) /** * {@inheritdoc} */ - protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) + protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output): int { if (!$command instanceof ListCommand) { if ($this->registrationErrors) { @@ -109,7 +107,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI /** * {@inheritdoc} */ - public function find(string $name) + public function find(string $name): Command { $this->registerCommands(); @@ -119,7 +117,7 @@ public function find(string $name) /** * {@inheritdoc} */ - public function get(string $name) + public function get(string $name): Command { $this->registerCommands(); @@ -135,7 +133,7 @@ public function get(string $name) /** * {@inheritdoc} */ - public function all(string $namespace = null) + public function all(string $namespace = null): array { $this->registerCommands(); @@ -145,12 +143,12 @@ public function all(string $namespace = null) /** * {@inheritdoc} */ - public function getLongVersion() + public function getLongVersion(): string { return parent::getLongVersion().sprintf(' (env: %s, debug: %s)', $this->kernel->getEnvironment(), $this->kernel->isDebug() ? 'true' : 'false'); } - public function add(Command $command) + public function add(Command $command): ?Command { $this->registerCommands(); diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php index 1e88cddc307f7..fc5f3ef9b131c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php @@ -171,10 +171,7 @@ protected function formatParameter(mixed $value): string return (string) $value; } - /** - * @return mixed - */ - protected function resolveServiceDefinition(ContainerBuilder $builder, string $serviceId) + protected function resolveServiceDefinition(ContainerBuilder $builder, string $serviceId): mixed { if ($builder->hasDefinition($serviceId)) { return $builder->getDefinition($serviceId); diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php index 1d83b062f144f..d266faf4aa520 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php @@ -77,7 +77,7 @@ public function setContainer(ContainerInterface $container): ?ContainerInterface * * @return array|bool|float|int|string|null */ - protected function getParameter(string $name) + protected function getParameter(string $name): array|bool|float|int|string|null { if (!$this->container->has('parameter_bag')) { throw new ServiceNotFoundException('parameter_bag.', null, null, [], sprintf('The "%s::getParameter()" method is missing a parameter bag to work properly. Did you forget to register your controller as a service subscriber? This can be fixed either by using autoconfiguration or by manually wiring a "parameter_bag" in the service locator passed to the controller.', static::class)); @@ -399,7 +399,7 @@ protected function getDoctrine(): ManagerRegistry * * @see TokenInterface::getUser() */ - protected function getUser() + protected function getUser(): ?object { if (!$this->container->has('security.token_storage')) { throw new \LogicException('The SecurityBundle is not registered in your application. Try running "composer require symfony/security-bundle".'); diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 82171117ee739..96e7fa6d5e531 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -62,7 +62,7 @@ public function __construct(bool $debug) * * @return TreeBuilder The tree builder */ - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('framework'); $rootNode = $treeBuilder->getRootNode(); diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 7d2303dc4d9ab..5729cfe9bbf52 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -37,6 +37,7 @@ use Symfony\Component\Cache\Marshaller\DefaultMarshaller; use Symfony\Component\Cache\Marshaller\MarshallerInterface; use Symfony\Component\Cache\ResettableInterface; +use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Resource\DirectoryResource; @@ -585,7 +586,7 @@ public function load(array $configs, ContainerBuilder $container) /** * {@inheritdoc} */ - public function getConfiguration(array $config, ContainerBuilder $container) + public function getConfiguration(array $config, ContainerBuilder $container): ?ConfigurationInterface { return new Configuration($container->getParameter('kernel.debug')); } @@ -2583,12 +2584,12 @@ private function resolveTrustedHeaders(array $headers): int /** * {@inheritdoc} */ - public function getXsdValidationBasePath() + public function getXsdValidationBasePath(): string|false { return \dirname(__DIR__).'/Resources/config/schema'; } - public function getNamespace() + public function getNamespace(): string { return 'http://symfony.com/schema/dic/symfony'; } diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php b/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php index 5028cadc818a0..eda4928749c0e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php @@ -65,7 +65,7 @@ public function __construct(KernelInterface $kernel, string|StoreInterface $cach /** * {@inheritdoc} */ - protected function forward(Request $request, bool $catch = false, Response $entry = null) + protected function forward(Request $request, bool $catch = false, Response $entry = null): Response { $this->getKernel()->boot(); $this->getKernel()->getContainer()->set('cache', $this); @@ -78,7 +78,7 @@ protected function forward(Request $request, bool $catch = false, Response $entr * * @return array An array of options */ - protected function getOptions() + protected function getOptions(): array { return []; } diff --git a/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php b/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php index 7be3c17bb6d34..9fd548729cf23 100644 --- a/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php +++ b/src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php @@ -44,10 +44,8 @@ public function __construct(KernelInterface $kernel, array $server = [], History /** * Returns the container. - * - * @return ContainerInterface */ - public function getContainer() + public function getContainer(): ContainerInterface { $container = $this->kernel->getContainer(); @@ -56,10 +54,8 @@ public function getContainer() /** * Returns the kernel. - * - * @return KernelInterface */ - public function getKernel() + public function getKernel(): KernelInterface { return $this->kernel; } @@ -69,7 +65,7 @@ public function getKernel() * * @return HttpProfile|false|null */ - public function getProfile() + public function getProfile(): HttpProfile|false|null { if (null === $this->response || !$this->getContainer()->has('profiler')) { return false; @@ -146,10 +142,8 @@ public function loginUser(object $user, string $firewallContext = 'main'): self * {@inheritdoc} * * @param Request $request - * - * @return Response */ - protected function doRequest(object $request) + protected function doRequest(object $request): Response { // avoid shutting down the Kernel if no request has been performed yet // WebTestCase::createClient() boots the Kernel but do not handle a request @@ -173,10 +167,8 @@ protected function doRequest(object $request) * {@inheritdoc} * * @param Request $request - * - * @return Response */ - protected function doRequestInProcess(object $request) + protected function doRequestInProcess(object $request): Response { $response = parent::doRequestInProcess($request); @@ -194,10 +186,8 @@ protected function doRequestInProcess(object $request) * client and override this method. * * @param Request $request - * - * @return string */ - protected function getScript(object $request) + protected function getScript(object $request): string { $kernel = var_export(serialize($this->kernel), true); $request = var_export(serialize($request), true); diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php b/src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php index 511e87058b802..7e6fa732090eb 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php +++ b/src/Symfony/Bundle/FrameworkBundle/Routing/AnnotatedRouteControllerLoader.php @@ -36,10 +36,8 @@ protected function configureRoute(Route $route, \ReflectionClass $class, \Reflec /** * Makes the default route name more sane by removing common keywords. - * - * @return string */ - protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) + protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method): string { $name = preg_replace('/(bundle|controller)_/', '_', parent::getDefaultRouteName($class, $method)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php b/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php index d7900a2e23d59..bfbf787d2d09c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php +++ b/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php @@ -62,7 +62,7 @@ public function __construct(ContainerInterface $container, mixed $resource, arra /** * {@inheritdoc} */ - public function getRouteCollection() + public function getRouteCollection(): RouteCollection { if (null === $this->collection) { $this->collection = $this->container->get('routing.loader')->load($this->resource, $this->options['resource_type']); @@ -88,7 +88,7 @@ public function getRouteCollection() * * @return string[] A list of classes to preload on PHP 7.4+ */ - public function warmUp(string $cacheDir) + public function warmUp(string $cacheDir): array { $currentDir = $this->getOption('cache_dir'); diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php index 6ff70d85060d7..37e86f23c5b23 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php @@ -57,7 +57,7 @@ protected function tearDown(): void * @throws \RuntimeException * @throws \LogicException */ - protected static function getKernelClass() + protected static function getKernelClass(): string { if (!isset($_SERVER['KERNEL_CLASS']) && !isset($_ENV['KERNEL_CLASS'])) { throw new \LogicException(sprintf('You must set the KERNEL_CLASS environment variable to the fully-qualified class name of your Kernel in phpunit.xml / phpunit.xml.dist or override the "%1$s::createKernel()" or "%1$s::getKernelClass()" method.', static::class)); @@ -72,10 +72,8 @@ protected static function getKernelClass() /** * Boots the Kernel for this test. - * - * @return KernelInterface */ - protected static function bootKernel(array $options = []) + protected static function bootKernel(array $options = []): KernelInterface { static::ensureKernelShutdown(); @@ -117,10 +115,8 @@ protected static function getContainer(): ContainerInterface * * * environment * * debug - * - * @return KernelInterface */ - protected static function createKernel(array $options = []) + protected static function createKernel(array $options = []): KernelInterface { if (null === static::$class) { static::$class = static::getKernelClass(); diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/TestBrowserToken.php b/src/Symfony/Bundle/FrameworkBundle/Test/TestBrowserToken.php index 7580743f6d5cb..6d3c99039b0d8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/TestBrowserToken.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/TestBrowserToken.php @@ -39,7 +39,7 @@ public function getFirewallName(): string return $this->firewallName; } - public function getCredentials() + public function getCredentials(): mixed { return null; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php b/src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php index 7ccb549973901..04f5c9a2b05fa 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php @@ -66,7 +66,7 @@ public function getParameterBag(): ParameterBagInterface * * @return array|bool|float|int|string|null */ - public function getParameter(string $name) + public function getParameter(string $name): array|bool|float|int|string|null { return $this->getPublicContainer()->getParameter($name); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php index e1bceae331b32..1f7f0802d3ce1 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php @@ -34,10 +34,8 @@ protected function tearDown(): void * * @param array $options An array of options to pass to the createKernel method * @param array $server An array of server parameters - * - * @return KernelBrowser */ - protected static function createClient(array $options = [], array $server = []) + protected static function createClient(array $options = [], array $server = []): KernelBrowser { if (static::$booted) { throw new \LogicException(sprintf('Booting the kernel before calling "%s()" is not supported, the kernel should only be booted once.', __METHOD__)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php b/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php index 9d7db40406b09..4b7736032e543 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php +++ b/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php @@ -96,7 +96,7 @@ public function __construct(ContainerInterface $container, MessageFormatterInter * * @return string[] */ - public function warmUp(string $cacheDir) + public function warmUp(string $cacheDir): array { // skip warmUp when translator doesn't use cache if (null === $this->options['cache_dir']) { diff --git a/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php b/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php index 65f0ae5f067d0..81ef0c63de4bc 100644 --- a/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php +++ b/src/Symfony/Bundle/TwigBundle/CacheWarmer/TemplateCacheWarmer.php @@ -40,7 +40,7 @@ public function __construct(ContainerInterface $container, iterable $iterator) * * @return string[] A list of template files to preload on PHP 7.4+ */ - public function warmUp(string $cacheDir) + public function warmUp(string $cacheDir): array { if (null === $this->twig) { $this->twig = $this->container->get('twig'); @@ -73,7 +73,7 @@ public function warmUp(string $cacheDir) /** * {@inheritdoc} */ - public function isOptional() + public function isOptional(): bool { return true; } diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php index c7826cd5ff73b..d8a67f3aba938 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php @@ -28,7 +28,7 @@ class Configuration implements ConfigurationInterface * * @return TreeBuilder The tree builder */ - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('twig'); $rootNode = $treeBuilder->getRootNode(); diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php index f3c8dc2ce9cca..2fb47d3746aef 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php @@ -183,12 +183,12 @@ private function normalizeBundleName(string $name): string /** * {@inheritdoc} */ - public function getXsdValidationBasePath() + public function getXsdValidationBasePath(): string|false { return __DIR__.'/../Resources/config/schema'; } - public function getNamespace() + public function getNamespace(): string { return 'http://symfony.com/schema/dic/twig'; } diff --git a/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php index f0ac3571278aa..4233706aa2c62 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php @@ -29,7 +29,7 @@ class Configuration implements ConfigurationInterface * * @return TreeBuilder The tree builder */ - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('web_profiler'); diff --git a/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php b/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php index 0bb949c095a36..d460cf1462035 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php +++ b/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/WebProfilerExtension.php @@ -60,12 +60,12 @@ public function load(array $configs, ContainerBuilder $container) /** * {@inheritdoc} */ - public function getXsdValidationBasePath() + public function getXsdValidationBasePath(): string|false { return __DIR__.'/../Resources/config/schema'; } - public function getNamespace() + public function getNamespace(): string { return 'http://symfony.com/schema/dic/webprofiler'; }