diff --git a/CHANGELOG.md b/CHANGELOG.md index ce62c9cdf..1e3224462 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,36 @@ CHANGELOG ========= +8.0 +--- + + * Remove `errors.xml` and `webhook.xml` routing configuration files (use their PHP equivalent instead) + * Enable the property info constructor extractor by default + * Remove deprecated `Symfony\Bundle\FrameworkBundle\Console\Application::add()` method in favor of `Symfony\Bundle\FrameworkBundle\Console\Application::addCommand()` + * Make `Router` class `final` + * Make `SerializerCacheWarmer` class `final` + * Make `Translator` class `final` + * Make `ConfigBuilderCacheWarmer` class `final` + * Make `TranslationsCacheWarmer` class `final` + * Make `ValidatorCacheWarmer` class `final` + * Remove autowiring aliases for `RateLimiterFactory`; use `RateLimiterFactoryInterface` instead + * Remove `session.sid_length` and `session.sid_bits_per_character` config options + * Remove the `router.cache_dir` config option + * Remove the `validation.cache` option + * Remove `TranslationUpdateCommand` in favor of `TranslationExtractCommand` + +7.4 +--- + + * Auto-register routes from attributes found on controller services + * Add `ControllerHelper`; the helpers from AbstractController as a standalone service + * Allow using their name without added suffix when using `#[Target]` for custom services + * Deprecate `Symfony\Bundle\FrameworkBundle\Console\Application::add()` in favor of `Symfony\Bundle\FrameworkBundle\Console\Application::addCommand()` + * Add `assertEmailAddressNotContains()` to the `MailerAssertionsTrait` + * Add `framework.type_info.aliases` option + * Add `KernelBrowser::getSession()` + * Add support for configuring workflow places with glob patterns matching consts/backed enums + 7.3 --- @@ -698,7 +728,7 @@ CHANGELOG * added Client::enableProfiler() * a new parameter has been added to the DIC: `router.request_context.base_url` You can customize it for your functional tests or for generating URLs with - the right base URL when your are in the CLI context. + the right base URL when you are in the CLI context. * added support for default templates per render tag 2.1.0 diff --git a/CacheWarmer/ConfigBuilderCacheWarmer.php b/CacheWarmer/ConfigBuilderCacheWarmer.php index 48ed51aec..46aeeb71d 100644 --- a/CacheWarmer/ConfigBuilderCacheWarmer.php +++ b/CacheWarmer/ConfigBuilderCacheWarmer.php @@ -29,10 +29,8 @@ * Generate all config builders. * * @author Tobias Nyholm - * - * @final since Symfony 7.1 */ -class ConfigBuilderCacheWarmer implements CacheWarmerInterface +final class ConfigBuilderCacheWarmer implements CacheWarmerInterface { public function __construct( private KernelInterface $kernel, diff --git a/CacheWarmer/SerializerCacheWarmer.php b/CacheWarmer/SerializerCacheWarmer.php index fbf7083b7..0c4f7c035 100644 --- a/CacheWarmer/SerializerCacheWarmer.php +++ b/CacheWarmer/SerializerCacheWarmer.php @@ -14,19 +14,18 @@ use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory; +use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader; use Symfony\Component\Serializer\Mapping\Loader\LoaderChain; use Symfony\Component\Serializer\Mapping\Loader\LoaderInterface; use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader; use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader; /** - * Warms up XML and YAML serializer metadata. + * Warms up serializer metadata. * * @author Titouan Galopin - * - * @final since Symfony 7.1 */ -class SerializerCacheWarmer extends AbstractPhpFileCacheWarmer +final class SerializerCacheWarmer extends AbstractPhpFileCacheWarmer { /** * @param LoaderInterface[] $loaders The serializer metadata loaders @@ -66,14 +65,14 @@ protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter, ?strin /** * @param LoaderInterface[] $loaders * - * @return XmlFileLoader[]|YamlFileLoader[] + * @return list */ private function extractSupportedLoaders(array $loaders): array { $supportedLoaders = []; foreach ($loaders as $loader) { - if ($loader instanceof XmlFileLoader || $loader instanceof YamlFileLoader) { + if (method_exists($loader, 'getMappedClasses')) { $supportedLoaders[] = $loader; } elseif ($loader instanceof LoaderChain) { $supportedLoaders = array_merge($supportedLoaders, $this->extractSupportedLoaders($loader->getLoaders())); diff --git a/CacheWarmer/TranslationsCacheWarmer.php b/CacheWarmer/TranslationsCacheWarmer.php index 40341cc10..c6c534879 100644 --- a/CacheWarmer/TranslationsCacheWarmer.php +++ b/CacheWarmer/TranslationsCacheWarmer.php @@ -21,10 +21,8 @@ * Generates the catalogues for translations. * * @author Xavier Leune - * - * @final since Symfony 7.1 */ -class TranslationsCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface +final class TranslationsCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface { private TranslatorInterface $translator; diff --git a/CacheWarmer/ValidatorCacheWarmer.php b/CacheWarmer/ValidatorCacheWarmer.php index 9c313f80a..936b332a6 100644 --- a/CacheWarmer/ValidatorCacheWarmer.php +++ b/CacheWarmer/ValidatorCacheWarmer.php @@ -14,6 +14,7 @@ use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Cache\Adapter\PhpArrayAdapter; use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory; +use Symfony\Component\Validator\Mapping\Loader\AttributeLoader; use Symfony\Component\Validator\Mapping\Loader\LoaderChain; use Symfony\Component\Validator\Mapping\Loader\LoaderInterface; use Symfony\Component\Validator\Mapping\Loader\XmlFileLoader; @@ -21,13 +22,11 @@ use Symfony\Component\Validator\ValidatorBuilder; /** - * Warms up XML and YAML validator metadata. + * Warms up validator metadata. * * @author Titouan Galopin - * - * @final since Symfony 7.1 */ -class ValidatorCacheWarmer extends AbstractPhpFileCacheWarmer +final class ValidatorCacheWarmer extends AbstractPhpFileCacheWarmer { /** * @param string $phpArrayFile The PHP file where metadata are cached @@ -77,14 +76,14 @@ protected function warmUpPhpArrayAdapter(PhpArrayAdapter $phpArrayAdapter, array /** * @param LoaderInterface[] $loaders * - * @return XmlFileLoader[]|YamlFileLoader[] + * @return list */ private function extractSupportedLoaders(array $loaders): array { $supportedLoaders = []; foreach ($loaders as $loader) { - if ($loader instanceof XmlFileLoader || $loader instanceof YamlFileLoader) { + if (method_exists($loader, 'getMappedClasses')) { $supportedLoaders[] = $loader; } elseif ($loader instanceof LoaderChain) { $supportedLoaders = array_merge($supportedLoaders, $this->extractSupportedLoaders($loader->getLoaders())); diff --git a/Command/AboutCommand.php b/Command/AboutCommand.php index 0c6899328..1f4287aab 100644 --- a/Command/AboutCommand.php +++ b/Command/AboutCommand.php @@ -36,11 +36,11 @@ protected function configure(): void { $this ->setHelp(<<<'EOT' -The %command.name% command displays information about the current Symfony project. + The %command.name% command displays information about the current Symfony project. -The PHP section displays important configuration that could affect your application. The values might -be different between web and CLI. -EOT + The PHP section displays important configuration that could affect your application. The values might + be different between web and CLI. + EOT ) ; } @@ -52,11 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int /** @var KernelInterface $kernel */ $kernel = $this->getApplication()->getKernel(); - if (method_exists($kernel, 'getBuildDir')) { - $buildDir = $kernel->getBuildDir(); - } else { - $buildDir = $kernel->getCacheDir(); - } + $buildDir = $kernel->getBuildDir(); $xdebugMode = getenv('XDEBUG_MODE') ?: \ini_get('xdebug.mode'); diff --git a/Command/AssetsInstallCommand.php b/Command/AssetsInstallCommand.php index 5dc8c828e..099204cae 100644 --- a/Command/AssetsInstallCommand.php +++ b/Command/AssetsInstallCommand.php @@ -23,7 +23,6 @@ use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Finder\Finder; -use Symfony\Component\HttpKernel\Bundle\BundleInterface; use Symfony\Component\HttpKernel\KernelInterface; /** @@ -58,24 +57,24 @@ protected function configure(): void ->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks') ->addOption('no-cleanup', null, InputOption::VALUE_NONE, 'Do not remove the assets of the bundles that no longer exist') ->setHelp(<<<'EOT' -The %command.name% command installs bundle assets into a given -directory (e.g. the public directory). + The %command.name% command installs bundle assets into a given + directory (e.g. the public directory). - php %command.full_name% public + php %command.full_name% public -A "bundles" directory will be created inside the target directory and the -"Resources/public" directory of each bundle will be copied into it. + A "bundles" directory will be created inside the target directory and the + "Resources/public" directory of each bundle will be copied into it. -To create a symlink to each bundle instead of copying its assets, use the ---symlink option (will fall back to hard copies when symbolic links aren't possible: + To create a symlink to each bundle instead of copying its assets, use the + --symlink option (will fall back to hard copies when symbolic links aren't possible: - php %command.full_name% public --symlink + php %command.full_name% public --symlink -To make symlink relative, add the --relative option: + To make symlink relative, add the --relative option: - php %command.full_name% public --symlink --relative + php %command.full_name% public --symlink --relative -EOT + EOT ) ; } @@ -119,7 +118,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int $copyUsed = false; $exitCode = 0; $validAssetDirs = []; - /** @var BundleInterface $bundle */ foreach ($kernel->getBundles() as $bundle) { if (!is_dir($originDir = $bundle->getPath().'/Resources/public') && !is_dir($originDir = $bundle->getPath().'/public')) { continue; @@ -239,7 +237,7 @@ private function symlink(string $originDir, string $targetDir, bool $relative = */ private function hardCopy(string $originDir, string $targetDir): string { - $this->filesystem->mkdir($targetDir, 0777); + $this->filesystem->mkdir($targetDir, 0o777); // We use a custom iterator to ignore VCS files $this->filesystem->mirror($originDir, $targetDir, Finder::create()->ignoreDotFiles(false)->in($originDir)); diff --git a/Command/BuildDebugContainerTrait.php b/Command/BuildDebugContainerTrait.php index 2f625e9e3..011510095 100644 --- a/Command/BuildDebugContainerTrait.php +++ b/Command/BuildDebugContainerTrait.php @@ -39,7 +39,9 @@ protected function getContainerBuilder(KernelInterface $kernel): ContainerBuilde return $this->container; } - if (!$kernel->isDebug() || !$kernel->getContainer()->getParameter('debug.container.dump') || !(new ConfigCache($kernel->getContainer()->getParameter('debug.container.dump'), true))->isFresh()) { + $file = $kernel->isDebug() ? $kernel->getContainer()->getParameter('debug.container.dump') : false; + + if (!$file || !(new ConfigCache($file, true))->isFresh()) { $buildContainer = \Closure::bind(function () { $this->initializeBundles(); @@ -57,13 +59,17 @@ protected function getContainerBuilder(KernelInterface $kernel): ContainerBuilde return $containerBuilder; }, $kernel, $kernel::class); $container = $buildContainer(); - (new XmlFileLoader($container, new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump')); - $locatorPass = new ServiceLocatorTagPass(); - $locatorPass->process($container); - $container->getCompilerPassConfig()->setBeforeOptimizationPasses([]); - $container->getCompilerPassConfig()->setOptimizationPasses([]); - $container->getCompilerPassConfig()->setBeforeRemovingPasses([]); + if (str_ends_with($file, '.xml') && is_file(substr_replace($file, '.ser', -4))) { + $dumpedContainer = unserialize(file_get_contents(substr_replace($file, '.ser', -4))); + $container->setDefinitions($dumpedContainer->getDefinitions()); + $container->setAliases($dumpedContainer->getAliases()); + $container->__construct($dumpedContainer->getParameterBag()); + } else { + (new XmlFileLoader($container, new FileLocator()))->load($file); + $locatorPass = new ServiceLocatorTagPass(); + $locatorPass->process($container); + } } return $this->container = $container; diff --git a/Command/CacheClearCommand.php b/Command/CacheClearCommand.php index 0e48ead59..3f3960ef8 100644 --- a/Command/CacheClearCommand.php +++ b/Command/CacheClearCommand.php @@ -56,12 +56,12 @@ protected function configure(): void new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'), ]) ->setHelp(<<<'EOF' -The %command.name% command clears and warms up the application cache for a given environment -and debug mode: + The %command.name% command clears and warms up the application cache for a given environment + and debug mode: - php %command.full_name% --env=dev - php %command.full_name% --env=prod --no-debug -EOF + php %command.full_name% --env=dev + php %command.full_name% --env=prod --no-debug + EOF ) ; } @@ -213,7 +213,7 @@ private function isNfs(string $dir): bool if ('/' === \DIRECTORY_SEPARATOR && @is_readable('/proc/mounts') && $files = @file('/proc/mounts')) { foreach ($files as $mount) { $mount = \array_slice(explode(' ', $mount), 1, -3); - if (!\in_array(array_pop($mount), ['vboxsf', 'nfs'])) { + if (!\in_array(array_pop($mount), ['vboxsf', 'nfs'], true)) { continue; } $mounts[] = implode(' ', $mount).'/'; diff --git a/Command/CachePoolClearCommand.php b/Command/CachePoolClearCommand.php index 5d840e597..d4bca0d8f 100644 --- a/Command/CachePoolClearCommand.php +++ b/Command/CachePoolClearCommand.php @@ -51,10 +51,10 @@ protected function configure(): void ->addOption('all', null, InputOption::VALUE_NONE, 'Clear all cache pools') ->addOption('exclude', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'A list of cache pools or cache pool clearers to exclude') ->setHelp(<<<'EOF' -The %command.name% command clears the given cache pools or cache pool clearers. + The %command.name% command clears the given cache pools or cache pool clearers. - %command.full_name% [...] -EOF + %command.full_name% [...] + EOF ) ; } diff --git a/Command/CachePoolDeleteCommand.php b/Command/CachePoolDeleteCommand.php index 8fb1d1aaa..c3c23a391 100644 --- a/Command/CachePoolDeleteCommand.php +++ b/Command/CachePoolDeleteCommand.php @@ -47,10 +47,10 @@ protected function configure(): void new InputArgument('key', InputArgument::REQUIRED, 'The cache key to delete from the pool'), ]) ->setHelp(<<<'EOF' -The %command.name% deletes an item from a given cache pool. + The %command.name% deletes an item from a given cache pool. - %command.full_name% -EOF + %command.full_name% + EOF ) ; } diff --git a/Command/CachePoolListCommand.php b/Command/CachePoolListCommand.php index 6b8e71eb0..6aedfb0c0 100644 --- a/Command/CachePoolListCommand.php +++ b/Command/CachePoolListCommand.php @@ -38,8 +38,8 @@ protected function configure(): void { $this ->setHelp(<<<'EOF' -The %command.name% command lists all available cache pools. -EOF + The %command.name% command lists all available cache pools. + EOF ) ; } diff --git a/Command/CachePoolPruneCommand.php b/Command/CachePoolPruneCommand.php index 745a001cc..5036da8ef 100644 --- a/Command/CachePoolPruneCommand.php +++ b/Command/CachePoolPruneCommand.php @@ -39,10 +39,10 @@ protected function configure(): void { $this ->setHelp(<<<'EOF' -The %command.name% command deletes all expired items from all pruneable pools. + The %command.name% command deletes all expired items from all pruneable pools. - %command.full_name% -EOF + %command.full_name% + EOF ) ; } diff --git a/Command/CacheWarmupCommand.php b/Command/CacheWarmupCommand.php index cc9665eb1..6dd01447e 100644 --- a/Command/CacheWarmupCommand.php +++ b/Command/CacheWarmupCommand.php @@ -44,11 +44,11 @@ protected function configure(): void new InputOption('no-optional-warmers', '', InputOption::VALUE_NONE, 'Skip optional cache warmers (faster)'), ]) ->setHelp(<<<'EOF' -The %command.name% command warms up the cache. + The %command.name% command warms up the cache. -Before running this command, the cache must be empty. + Before running this command, the cache must be empty. -EOF + EOF ) ; } diff --git a/Command/ConfigDebugCommand.php b/Command/ConfigDebugCommand.php index 8d5f85cee..50c8dddf5 100644 --- a/Command/ConfigDebugCommand.php +++ b/Command/ConfigDebugCommand.php @@ -49,23 +49,23 @@ protected function configure(): void new InputOption('format', null, InputOption::VALUE_REQUIRED, \sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), class_exists(Yaml::class) ? 'txt' : 'json'), ]) ->setHelp(<<%command.name% command dumps the current configuration for an -extension/bundle. + The %command.name% command dumps the current configuration for an + extension/bundle. -Either the extension alias or bundle name can be used: + Either the extension alias or bundle name can be used: - php %command.full_name% framework - php %command.full_name% FrameworkBundle + php %command.full_name% framework + php %command.full_name% FrameworkBundle -The --format option specifies the format of the command output: + The --format option specifies the format of the command output: - php %command.full_name% framework --format=json + php %command.full_name% framework --format=json -For dumping a specific option, add its path as second argument: + For dumping a specific option, add its path as second argument: - php %command.full_name% framework serializer.enabled + php %command.full_name% framework serializer.enabled -EOF + EOF ) ; } diff --git a/Command/ConfigDumpReferenceCommand.php b/Command/ConfigDumpReferenceCommand.php index 3cb744d74..3a6d1252d 100644 --- a/Command/ConfigDumpReferenceCommand.php +++ b/Command/ConfigDumpReferenceCommand.php @@ -47,23 +47,23 @@ protected function configure(): void new InputOption('format', null, InputOption::VALUE_REQUIRED, \sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())), 'yaml'), ]) ->setHelp(<<%command.name% command dumps the default configuration for an -extension/bundle. + The %command.name% command dumps the default configuration for an + extension/bundle. -Either the extension alias or bundle name can be used: + Either the extension alias or bundle name can be used: - php %command.full_name% framework - php %command.full_name% FrameworkBundle + php %command.full_name% framework + php %command.full_name% FrameworkBundle -The --format option specifies the format of the command output: + The --format option specifies the format of the command output: - php %command.full_name% FrameworkBundle --format=json + php %command.full_name% FrameworkBundle --format=json -For dumping a specific option, add its path as second argument (only available for the yaml format): + For dumping a specific option, add its path as second argument (only available for the yaml format): - php %command.full_name% framework http_client.default_options + php %command.full_name% framework http_client.default_options -EOF + EOF ) ; } diff --git a/Command/ContainerDebugCommand.php b/Command/ContainerDebugCommand.php index 17c71bdca..f0f7d5a1b 100644 --- a/Command/ContainerDebugCommand.php +++ b/Command/ContainerDebugCommand.php @@ -57,59 +57,59 @@ protected function configure(): void new InputOption('deprecations', null, InputOption::VALUE_NONE, 'Display deprecations generated when compiling and warming up the container'), ]) ->setHelp(<<<'EOF' -The %command.name% command displays all configured public services: + The %command.name% command displays all configured public services: - php %command.full_name% + php %command.full_name% -To see deprecations generated during container compilation and cache warmup, use the --deprecations option: + To see deprecations generated during container compilation and cache warmup, use the --deprecations option: - php %command.full_name% --deprecations + php %command.full_name% --deprecations -To get specific information about a service, specify its name: + To get specific information about a service, specify its name: - php %command.full_name% validator + php %command.full_name% validator -To get specific information about a service including all its arguments, use the --show-arguments flag: + To get specific information about a service including all its arguments, use the --show-arguments flag: - php %command.full_name% validator --show-arguments + php %command.full_name% validator --show-arguments -To see available types that can be used for autowiring, use the --types flag: + To see available types that can be used for autowiring, use the --types flag: - php %command.full_name% --types + php %command.full_name% --types -To see environment variables used by the container, use the --env-vars flag: + To see environment variables used by the container, use the --env-vars flag: - php %command.full_name% --env-vars + php %command.full_name% --env-vars -Display a specific environment variable by specifying its name with the --env-var option: + Display a specific environment variable by specifying its name with the --env-var option: - php %command.full_name% --env-var=APP_ENV + php %command.full_name% --env-var=APP_ENV -Use the --tags option to display tagged public services grouped by tag: + Use the --tags option to display tagged public services grouped by tag: - php %command.full_name% --tags + php %command.full_name% --tags -Find all services with a specific tag by specifying the tag name with the --tag option: + Find all services with a specific tag by specifying the tag name with the --tag option: - php %command.full_name% --tag=form.type + php %command.full_name% --tag=form.type -Use the --parameters option to display all parameters: + Use the --parameters option to display all parameters: - php %command.full_name% --parameters + php %command.full_name% --parameters -Display a specific parameter by specifying its name with the --parameter option: + Display a specific parameter by specifying its name with the --parameter option: - php %command.full_name% --parameter=kernel.debug + php %command.full_name% --parameter=kernel.debug -By default, internal services are hidden. You can display them -using the --show-hidden flag: + By default, internal services are hidden. You can display them + using the --show-hidden flag: - php %command.full_name% --show-hidden + php %command.full_name% --show-hidden -The --format option specifies the format of the command output: + The --format option specifies the format of the command output: - php %command.full_name% --format=json -EOF + php %command.full_name% --format=json + EOF ) ; } diff --git a/Command/ContainerLintCommand.php b/Command/ContainerLintCommand.php index d71fd6810..2fc0be7c5 100644 --- a/Command/ContainerLintCommand.php +++ b/Command/ContainerLintCommand.php @@ -25,7 +25,6 @@ use Symfony\Component\DependencyInjection\Compiler\PassConfig; use Symfony\Component\DependencyInjection\Compiler\ResolveFactoryClassPass; use Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass; -use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; @@ -82,9 +81,10 @@ private function getContainerBuilder(bool $resolveEnvVars): ContainerBuilder } $kernel = $this->getApplication()->getKernel(); - $kernelContainer = $kernel->getContainer(); + $container = $kernel->getContainer(); + $file = $kernel->isDebug() ? $container->getParameter('debug.container.dump') : false; - if (!$kernel->isDebug() || !$kernelContainer->getParameter('debug.container.dump') || !(new ConfigCache($kernelContainer->getParameter('debug.container.dump'), true))->isFresh()) { + if (!$file || !(new ConfigCache($file, true))->isFresh()) { if (!$kernel instanceof Kernel) { throw new RuntimeException(\sprintf('This command does not support the application kernel: "%s" does not extend "%s".', get_debug_type($kernel), Kernel::class)); } @@ -96,15 +96,20 @@ private function getContainerBuilder(bool $resolveEnvVars): ContainerBuilder }, $kernel, $kernel::class); $container = $buildContainer(); } else { - if (!$kernelContainer instanceof Container) { - throw new RuntimeException(\sprintf('This command does not support the application container: "%s" does not extend "%s".', get_debug_type($kernelContainer), Container::class)); + if (str_ends_with($file, '.xml') && is_file(substr_replace($file, '.ser', -4))) { + $container = unserialize(file_get_contents(substr_replace($file, '.ser', -4))); + } else { + (new XmlFileLoader($container = new ContainerBuilder(new EnvPlaceholderParameterBag()), new FileLocator()))->load($file); } - (new XmlFileLoader($container = new ContainerBuilder($parameterBag = new EnvPlaceholderParameterBag()), new FileLocator()))->load($kernelContainer->getParameter('debug.container.dump')); + if (!$container instanceof ContainerBuilder) { + throw new RuntimeException(\sprintf('This command does not support the application container: "%s" is not a "%s".', get_debug_type($container), ContainerBuilder::class)); + } if ($resolveEnvVars) { $container->getCompilerPassConfig()->setOptimizationPasses([new ResolveParameterPlaceHoldersPass(), new ResolveFactoryClassPass()]); } else { + $parameterBag = $container->getParameterBag(); $refl = new \ReflectionProperty($parameterBag, 'resolved'); $refl->setValue($parameterBag, true); diff --git a/Command/DebugAutowiringCommand.php b/Command/DebugAutowiringCommand.php index e159c5a39..5c1869c6a 100644 --- a/Command/DebugAutowiringCommand.php +++ b/Command/DebugAutowiringCommand.php @@ -20,7 +20,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\DependencyInjection\Attribute\Target; use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter; /** @@ -48,16 +47,16 @@ protected function configure(): void new InputOption('all', null, InputOption::VALUE_NONE, 'Show also services that are not aliased'), ]) ->setHelp(<<<'EOF' -The %command.name% command displays the classes and interfaces that -you can use as type-hints for autowiring: + The %command.name% command displays the classes and interfaces that + you can use as type-hints for autowiring: - php %command.full_name% + php %command.full_name% -You can also pass a search term to filter the list: + You can also pass a search term to filter the list: - php %command.full_name% log + php %command.full_name% log -EOF + EOF ) ; } @@ -137,7 +136,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $target = substr($id, \strlen($previousId) + 3); - if ($previousId.' $'.(new Target($target))->getParsedName() === $serviceId) { + if ($container->findDefinition($id) === $container->findDefinition($serviceId)) { $serviceLine .= ' - target:'.$target.''; break; } @@ -185,7 +184,7 @@ private function getFileLink(string $class): string return ''; } - return (string) $this->fileLinkFormatter->format($r->getFileName(), $r->getStartLine()); + return $r->getFileName() ? ($this->fileLinkFormatter->format($r->getFileName(), $r->getStartLine()) ?: '') : ''; } public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void diff --git a/Command/EventDispatcherDebugCommand.php b/Command/EventDispatcherDebugCommand.php index 3c51cb1b7..43766ed92 100644 --- a/Command/EventDispatcherDebugCommand.php +++ b/Command/EventDispatcherDebugCommand.php @@ -53,18 +53,18 @@ protected function configure(): void new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'), ]) ->setHelp(<<<'EOF' -The %command.name% command displays all configured listeners: + The %command.name% command displays all configured listeners: - php %command.full_name% + php %command.full_name% -To get specific listeners for an event, specify its name: + To get specific listeners for an event, specify its name: - php %command.full_name% kernel.request + php %command.full_name% kernel.request -The --format option specifies the format of the command output: + The --format option specifies the format of the command output: - php %command.full_name% --format=json -EOF + php %command.full_name% --format=json + EOF ) ; } diff --git a/Command/RouterDebugCommand.php b/Command/RouterDebugCommand.php index e54377115..3daf865b3 100644 --- a/Command/RouterDebugCommand.php +++ b/Command/RouterDebugCommand.php @@ -58,14 +58,14 @@ protected function configure(): void new InputOption('method', null, InputOption::VALUE_REQUIRED, 'Filter by HTTP method', '', ['GET', 'POST', 'PUT', 'DELETE', 'PATCH']), ]) ->setHelp(<<<'EOF' -The %command.name% displays the configured routes: + The %command.name% displays the configured routes: - php %command.full_name% + php %command.full_name% -The --format option specifies the format of the command output: + The --format option specifies the format of the command output: - php %command.full_name% --format=json -EOF + php %command.full_name% --format=json + EOF ) ; } diff --git a/Command/RouterMatchCommand.php b/Command/RouterMatchCommand.php index 3f0ea3cb5..dee448517 100644 --- a/Command/RouterMatchCommand.php +++ b/Command/RouterMatchCommand.php @@ -53,15 +53,15 @@ protected function configure(): void new InputOption('host', null, InputOption::VALUE_REQUIRED, 'Set the URI host'), ]) ->setHelp(<<<'EOF' -The %command.name% shows which routes match a given request and which don't and for what reason: + The %command.name% shows which routes match a given request and which don't and for what reason: - php %command.full_name% /foo + php %command.full_name% /foo -or + or - php %command.full_name% /foo --method POST --scheme https --host symfony.com --verbose + php %command.full_name% /foo --method POST --scheme https --host symfony.com --verbose -EOF + EOF ) ; } diff --git a/Command/SecretsDecryptToLocalCommand.php b/Command/SecretsDecryptToLocalCommand.php index 4e392b677..3dee29450 100644 --- a/Command/SecretsDecryptToLocalCommand.php +++ b/Command/SecretsDecryptToLocalCommand.php @@ -40,14 +40,14 @@ protected function configure(): void $this ->addOption('force', 'f', InputOption::VALUE_NONE, 'Force overriding of secrets that already exist in the local vault') ->setHelp(<<<'EOF' -The %command.name% command decrypts all secrets and copies them in the local vault. + The %command.name% command decrypts all secrets and copies them in the local vault. - %command.full_name% + %command.full_name% -When the --force option is provided, secrets that already exist in the local vault are overridden. + When the --force option is provided, secrets that already exist in the local vault are overridden. - %command.full_name% --force -EOF + %command.full_name% --force + EOF ) ; } diff --git a/Command/SecretsEncryptFromLocalCommand.php b/Command/SecretsEncryptFromLocalCommand.php index 9740098e5..248f10966 100644 --- a/Command/SecretsEncryptFromLocalCommand.php +++ b/Command/SecretsEncryptFromLocalCommand.php @@ -38,10 +38,10 @@ protected function configure(): void { $this ->setHelp(<<<'EOF' -The %command.name% command encrypts all locally overridden secrets to the vault. + The %command.name% command encrypts all locally overridden secrets to the vault. - %command.full_name% -EOF + %command.full_name% + EOF ) ; } diff --git a/Command/SecretsGenerateKeysCommand.php b/Command/SecretsGenerateKeysCommand.php index f721c786e..e0d5d9c52 100644 --- a/Command/SecretsGenerateKeysCommand.php +++ b/Command/SecretsGenerateKeysCommand.php @@ -43,16 +43,16 @@ protected function configure(): void ->addOption('local', 'l', InputOption::VALUE_NONE, 'Update the local vault.') ->addOption('rotate', 'r', InputOption::VALUE_NONE, 'Re-encrypt existing secrets with the newly generated keys.') ->setHelp(<<<'EOF' -The %command.name% command generates a new encryption key. + The %command.name% command generates a new encryption key. - %command.full_name% + %command.full_name% -If encryption keys already exist, the command must be called with -the --rotate option in order to override those keys and re-encrypt -existing secrets. + If encryption keys already exist, the command must be called with + the --rotate option in order to override those keys and re-encrypt + existing secrets. - %command.full_name% --rotate -EOF + %command.full_name% --rotate + EOF ) ; } diff --git a/Command/SecretsListCommand.php b/Command/SecretsListCommand.php index 920b3b1fc..9057f58d1 100644 --- a/Command/SecretsListCommand.php +++ b/Command/SecretsListCommand.php @@ -43,14 +43,14 @@ protected function configure(): void $this ->addOption('reveal', 'r', InputOption::VALUE_NONE, 'Display decrypted values alongside names') ->setHelp(<<<'EOF' -The %command.name% command list all stored secrets. + The %command.name% command list all stored secrets. - %command.full_name% + %command.full_name% -When the option --reveal is provided, the decrypted secrets are also displayed. + When the option --reveal is provided, the decrypted secrets are also displayed. - %command.full_name% --reveal -EOF + %command.full_name% --reveal + EOF ) ; } diff --git a/Command/SecretsRemoveCommand.php b/Command/SecretsRemoveCommand.php index 59bbe8211..2c3bbb18e 100644 --- a/Command/SecretsRemoveCommand.php +++ b/Command/SecretsRemoveCommand.php @@ -45,10 +45,10 @@ protected function configure(): void ->addArgument('name', InputArgument::REQUIRED, 'The name of the secret') ->addOption('local', 'l', InputOption::VALUE_NONE, 'Update the local vault.') ->setHelp(<<<'EOF' -The %command.name% command removes a secret from the vault. + The %command.name% command removes a secret from the vault. - %command.full_name% -EOF + %command.full_name% + EOF ) ; } diff --git a/Command/SecretsRevealCommand.php b/Command/SecretsRevealCommand.php index c2110ee76..8a678e14d 100644 --- a/Command/SecretsRevealCommand.php +++ b/Command/SecretsRevealCommand.php @@ -38,10 +38,10 @@ protected function configure(): void $this ->addArgument('name', InputArgument::REQUIRED, 'The name of the secret to reveal', null, fn () => array_keys($this->vault->list())) ->setHelp(<<<'EOF' -The %command.name% command reveals a stored secret. + The %command.name% command reveals a stored secret. - %command.full_name% -EOF + %command.full_name% + EOF ) ; } diff --git a/Command/SecretsSetCommand.php b/Command/SecretsSetCommand.php index f7e8eeaa6..c9eabb25a 100644 --- a/Command/SecretsSetCommand.php +++ b/Command/SecretsSetCommand.php @@ -48,24 +48,24 @@ protected function configure(): void ->addOption('local', 'l', InputOption::VALUE_NONE, 'Update the local vault.') ->addOption('random', 'r', InputOption::VALUE_OPTIONAL, 'Generate a random value.', false) ->setHelp(<<<'EOF' -The %command.name% command stores a secret in the vault. + The %command.name% command stores a secret in the vault. - %command.full_name% + %command.full_name% -To reference secrets in services.yaml or any other config -files, use "%env()%". + To reference secrets in services.yaml or any other config + files, use "%env()%". -By default, the secret value should be entered interactively. -Alternatively, provide a file where to read the secret from: + By default, the secret value should be entered interactively. + Alternatively, provide a file where to read the secret from: - php %command.full_name% filename + php %command.full_name% filename -Use "-" as a file name to read from STDIN: + Use "-" as a file name to read from STDIN: - cat filename | php %command.full_name% - + cat filename | php %command.full_name% - -Use --local to override secrets for local needs. -EOF + Use --local to override secrets for local needs. + EOF ) ; } diff --git a/Command/TranslationDebugCommand.php b/Command/TranslationDebugCommand.php index a320130d5..b186646a3 100644 --- a/Command/TranslationDebugCommand.php +++ b/Command/TranslationDebugCommand.php @@ -75,35 +75,35 @@ protected function configure(): void new InputOption('all', null, InputOption::VALUE_NONE, 'Load messages from all registered bundles'), ]) ->setHelp(<<<'EOF' -The %command.name% command helps finding unused or missing translation -messages and comparing them with the fallback ones by inspecting the -templates and translation files of a given bundle or the default translations directory. + The %command.name% command helps finding unused or missing translation + messages and comparing them with the fallback ones by inspecting the + templates and translation files of a given bundle or the default translations directory. -You can display information about bundle translations in a specific locale: + You can display information about bundle translations in a specific locale: - php %command.full_name% en AcmeDemoBundle + php %command.full_name% en AcmeDemoBundle -You can also specify a translation domain for the search: + You can also specify a translation domain for the search: - php %command.full_name% --domain=messages en AcmeDemoBundle + php %command.full_name% --domain=messages en AcmeDemoBundle -You can only display missing messages: + You can only display missing messages: - php %command.full_name% --only-missing en AcmeDemoBundle + php %command.full_name% --only-missing en AcmeDemoBundle -You can only display unused messages: + You can only display unused messages: - php %command.full_name% --only-unused en AcmeDemoBundle + php %command.full_name% --only-unused en AcmeDemoBundle -You can display information about application translations in a specific locale: + You can display information about application translations in a specific locale: - php %command.full_name% en + php %command.full_name% en -You can display information about translations in all registered bundles in a specific locale: + You can display information about translations in all registered bundles in a specific locale: - php %command.full_name% --all en + php %command.full_name% --all en -EOF + EOF ) ; } diff --git a/Command/TranslationExtractCommand.php b/Command/TranslationExtractCommand.php index c8e61b61a..32f19fbe4 100644 --- a/Command/TranslationExtractCommand.php +++ b/Command/TranslationExtractCommand.php @@ -83,34 +83,34 @@ protected function configure(): void new InputOption('as-tree', null, InputOption::VALUE_REQUIRED, 'Dump the messages as a tree-like structure: The given value defines the level where to switch to inline YAML'), ]) ->setHelp(<<<'EOF' -The %command.name% command extracts translation strings from templates -of a given bundle or the default translations directory. It can display them or merge -the new ones into the translation files. + The %command.name% command extracts translation strings from templates + of a given bundle or the default translations directory. It can display them or merge + the new ones into the translation files. -When new translation strings are found it can automatically add a prefix to the translation -message. However, if the --no-fill option is used, the --prefix -option has no effect, since the translation values are left empty. + When new translation strings are found it can automatically add a prefix to the translation + message. However, if the --no-fill option is used, the --prefix + option has no effect, since the translation values are left empty. -Example running against a Bundle (AcmeBundle) + Example running against a Bundle (AcmeBundle) - php %command.full_name% --dump-messages en AcmeBundle - php %command.full_name% --force --prefix="new_" fr AcmeBundle + php %command.full_name% --dump-messages en AcmeBundle + php %command.full_name% --force --prefix="new_" fr AcmeBundle -Example running against default messages directory + Example running against default messages directory - php %command.full_name% --dump-messages en - php %command.full_name% --force --prefix="new_" fr + php %command.full_name% --dump-messages en + php %command.full_name% --force --prefix="new_" fr -You can sort the output with the --sort flag: + You can sort the output with the --sort flag: - php %command.full_name% --dump-messages --sort=asc en AcmeBundle - php %command.full_name% --force --sort=desc fr + php %command.full_name% --dump-messages --sort=asc en AcmeBundle + php %command.full_name% --force --sort=desc fr -You can dump a tree-like structure using the yaml format with --as-tree flag: + You can dump a tree-like structure using the yaml format with --as-tree flag: - php %command.full_name% --force --format=yaml --as-tree=3 en AcmeBundle + php %command.full_name% --force --format=yaml --as-tree=3 en AcmeBundle -EOF + EOF ) ; } diff --git a/Command/TranslationUpdateCommand.php b/Command/TranslationUpdateCommand.php deleted file mode 100644 index de5aa9389..000000000 --- a/Command/TranslationUpdateCommand.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\FrameworkBundle\Command; - -use Symfony\Component\Translation\Extractor\ExtractorInterface; -use Symfony\Component\Translation\Reader\TranslationReaderInterface; -use Symfony\Component\Translation\Writer\TranslationWriterInterface; - -class TranslationUpdateCommand extends TranslationExtractCommand -{ - public function __construct( - private TranslationWriterInterface $writer, - private TranslationReaderInterface $reader, - private ExtractorInterface $extractor, - private string $defaultLocale, - private ?string $defaultTransPath = null, - private ?string $defaultViewsPath = null, - private array $transPaths = [], - private array $codePaths = [], - private array $enabledLocales = [], - ) { - trigger_deprecation('symfony/framework-bundle', '7.3', 'The "%s" class is deprecated, use "%s" instead.', __CLASS__, TranslationExtractCommand::class); - parent::__construct($writer, $reader, $extractor, $defaultLocale, $defaultTransPath, $defaultViewsPath, $transPaths, $codePaths, $enabledLocales); - } -} diff --git a/Command/WorkflowDumpCommand.php b/Command/WorkflowDumpCommand.php index 201fb8be8..06570e9ea 100644 --- a/Command/WorkflowDumpCommand.php +++ b/Command/WorkflowDumpCommand.php @@ -59,13 +59,13 @@ protected function configure(): void new InputOption('dump-format', null, InputOption::VALUE_REQUIRED, 'The dump format ['.implode('|', self::DUMP_FORMAT_OPTIONS).']', 'dot'), ]) ->setHelp(<<<'EOF' -The %command.name% command dumps the graphical representation of a -workflow in different formats + The %command.name% command dumps the graphical representation of a + workflow in different formats -DOT: %command.full_name% | dot -Tpng > workflow.png -PUML: %command.full_name% --dump-format=puml | java -jar plantuml.jar -p > workflow.png -MERMAID: %command.full_name% --dump-format=mermaid | mmdc -o workflow.svg -EOF + DOT: %command.full_name% | dot -Tpng > workflow.png + PUML: %command.full_name% --dump-format=puml | java -jar plantuml.jar -p > workflow.png + MERMAID: %command.full_name% --dump-format=mermaid | mmdc -o workflow.svg + EOF ) ; } diff --git a/Command/XliffLintCommand.php b/Command/XliffLintCommand.php index 5b094f165..9bbe39db1 100644 --- a/Command/XliffLintCommand.php +++ b/Command/XliffLintCommand.php @@ -47,11 +47,11 @@ protected function configure(): void $this->setHelp($this->getHelp().<<<'EOF' -Or find all files in a bundle: + Or find all files in a bundle: - php %command.full_name% @AcmeDemoBundle + php %command.full_name% @AcmeDemoBundle -EOF + EOF ); } } diff --git a/Command/YamlLintCommand.php b/Command/YamlLintCommand.php index 141390812..5948add7c 100644 --- a/Command/YamlLintCommand.php +++ b/Command/YamlLintCommand.php @@ -46,11 +46,11 @@ protected function configure(): void $this->setHelp($this->getHelp().<<<'EOF' -Or find all files in a bundle: + Or find all files in a bundle: - php %command.full_name% @AcmeDemoBundle + php %command.full_name% @AcmeDemoBundle -EOF + EOF ); } } diff --git a/Console/Application.php b/Console/Application.php index 274e7b06d..2a0eb2907 100644 --- a/Console/Application.php +++ b/Console/Application.php @@ -159,11 +159,11 @@ 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): ?Command + public function addCommand(callable|Command $command): ?Command { $this->registerCommands(); - return parent::add($command); + return parent::addCommand($command); } protected function registerCommands(): void @@ -197,7 +197,7 @@ protected function registerCommands(): void foreach ($container->getParameter('console.command.ids') as $id) { if (!isset($lazyCommandIds[$id])) { try { - $this->add($container->get($id)); + $this->addCommand($container->get($id)); } catch (\Throwable $e) { $this->registrationErrors[] = $e; } diff --git a/Console/Descriptor/JsonDescriptor.php b/Console/Descriptor/JsonDescriptor.php index c7705a1a0..cfae075ed 100644 --- a/Console/Descriptor/JsonDescriptor.php +++ b/Console/Descriptor/JsonDescriptor.php @@ -248,7 +248,7 @@ private function getContainerDefinitionData(Definition $definition, bool $omitTa { $data = [ 'class' => (string) $definition->getClass(), - 'public' => $definition->isPublic() && !$definition->isPrivate(), + 'public' => $definition->isPublic(), 'synthetic' => $definition->isSynthetic(), 'lazy' => $definition->isLazy(), 'shared' => $definition->isShared(), @@ -313,7 +313,7 @@ private function getContainerAliasData(Alias $alias): array { return [ 'service' => (string) $alias, - 'public' => $alias->isPublic() && !$alias->isPrivate(), + 'public' => $alias->isPublic(), ]; } diff --git a/Console/Descriptor/MarkdownDescriptor.php b/Console/Descriptor/MarkdownDescriptor.php index d057c598d..faa92e918 100644 --- a/Console/Descriptor/MarkdownDescriptor.php +++ b/Console/Descriptor/MarkdownDescriptor.php @@ -214,7 +214,7 @@ protected function describeContainerDefinition(Definition $definition, array $op } $output .= '- Class: `'.$definition->getClass().'`' - ."\n".'- Public: '.($definition->isPublic() && !$definition->isPrivate() ? 'yes' : 'no') + ."\n".'- Public: '.($definition->isPublic() ? 'yes' : 'no') ."\n".'- Synthetic: '.($definition->isSynthetic() ? 'yes' : 'no') ."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no') ."\n".'- Shared: '.($definition->isShared() ? 'yes' : 'no') @@ -276,7 +276,7 @@ protected function describeContainerDefinition(Definition $definition, array $op protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $container = null): void { $output = '- Service: `'.$alias.'`' - ."\n".'- Public: '.($alias->isPublic() && !$alias->isPrivate() ? 'yes' : 'no'); + ."\n".'- Public: '.($alias->isPublic() ? 'yes' : 'no'); if (!isset($options['id'])) { $this->write($output); diff --git a/Console/Descriptor/TextDescriptor.php b/Console/Descriptor/TextDescriptor.php index 12b345411..69e4b395c 100644 --- a/Console/Descriptor/TextDescriptor.php +++ b/Console/Descriptor/TextDescriptor.php @@ -38,6 +38,18 @@ */ class TextDescriptor extends Descriptor { + private const VERB_COLORS = [ + 'ANY' => 'default', + 'GET' => 'blue', + 'QUERY' => 'blue', + 'HEAD' => 'magenta', + 'OPTIONS' => 'blue', + 'POST' => 'green', + 'PUT' => 'yellow', + 'PATCH' => 'yellow', + 'DELETE' => 'red', + ]; + public function __construct( private ?FileLinkFormatter $fileLinkFormatter = null, ) { @@ -45,40 +57,64 @@ public function __construct( protected function describeRouteCollection(RouteCollection $routes, array $options = []): void { - $showControllers = isset($options['show_controllers']) && $options['show_controllers']; - - $tableHeaders = ['Name', 'Method', 'Scheme', 'Host', 'Path']; - if ($showControllers) { - $tableHeaders[] = 'Controller'; - } - - if ($showAliases = $options['show_aliases'] ?? false) { - $tableHeaders[] = 'Aliases'; - } + $showAliases = $options['show_aliases'] ?? false; + $showControllers = $options['show_controllers'] ?? false; $tableRows = []; + $shouldShowScheme = false; + $shouldShowHost = false; foreach ($routes->all() as $name => $route) { $controller = $route->getDefault('_controller'); + $scheme = $route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY'; + $shouldShowScheme = $shouldShowScheme || 'ANY' !== $scheme; + + $host = '' !== $route->getHost() ? $route->getHost() : 'ANY'; + $shouldShowHost = $shouldShowHost || 'ANY' !== $host; + $row = [ - $name, - $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY', - $route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY', - '' !== $route->getHost() ? $route->getHost() : 'ANY', - $this->formatControllerLink($controller, $route->getPath(), $options['container'] ?? null), + 'Name' => $name, + 'Methods' => $this->formatMethods($route->getMethods()), + 'Scheme' => $scheme, + 'Host' => $host, + 'Path' => $route->getPath(), ]; if ($showControllers) { - $row[] = $controller ? $this->formatControllerLink($controller, $this->formatCallable($controller), $options['container'] ?? null) : ''; + $row['Controller'] = $controller ? $this->formatControllerLink($controller, $this->formatCallable($controller), $options['container'] ?? null) : ''; } if ($showAliases) { - $row[] = implode('|', ($reverseAliases ??= $this->getReverseAliases($routes))[$name] ?? []); + $row['Aliases'] = implode('|', $this->getReverseAliases($routes)[$name] ?? []); } $tableRows[] = $row; } + $tableHeaders = ['Name', 'Method']; + + if ($shouldShowScheme) { + $tableHeaders[] = 'Scheme'; + } else { + array_walk($tableRows, function (&$row) { unset($row['Scheme']); }); + } + + if ($shouldShowHost) { + $tableHeaders[] = 'Host'; + } else { + array_walk($tableRows, function (&$row) { unset($row['Host']); }); + } + + $tableHeaders[] = 'Path'; + + if ($showControllers) { + $tableHeaders[] = 'Controller'; + } + + if ($showAliases) { + $tableHeaders[] = 'Aliases'; + } + if (isset($options['output'])) { $options['output']->table($tableHeaders, $tableRows); } else { @@ -103,7 +139,7 @@ protected function describeRoute(Route $route, array $options = []): void ['Host', '' !== $route->getHost() ? $route->getHost() : 'ANY'], ['Host Regex', '' !== $route->getHost() ? $route->compile()->getHostRegex() : ''], ['Scheme', $route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY'], - ['Method', $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY'], + ['Method', $this->formatMethods($route->getMethods())], ['Requirements', $route->getRequirements() ? $this->formatRouterConfig($route->getRequirements()) : 'NO CUSTOM'], ['Class', $route::class], ['Defaults', $this->formatRouterConfig($defaults)], @@ -324,7 +360,7 @@ protected function describeContainerDefinition(Definition $definition, array $op $tableRows[] = ['Calls', implode(', ', $callInformation)]; } - $tableRows[] = ['Public', $definition->isPublic() && !$definition->isPrivate() ? 'yes' : 'no']; + $tableRows[] = ['Public', $definition->isPublic() ? 'yes' : 'no']; $tableRows[] = ['Synthetic', $definition->isSynthetic() ? 'yes' : 'no']; $tableRows[] = ['Lazy', $definition->isLazy() ? 'yes' : 'no']; $tableRows[] = ['Shared', $definition->isShared() ? 'yes' : 'no']; @@ -419,7 +455,7 @@ protected function describeContainerDeprecations(ContainerBuilder $container, ar protected function describeContainerAlias(Alias $alias, array $options = [], ?ContainerBuilder $container = null): void { - if ($alias->isPublic() && !$alias->isPrivate()) { + if ($alias->isPublic()) { $options['output']->comment(\sprintf('This service is a public alias for the service %s', (string) $alias)); } else { $options['output']->comment(\sprintf('This service is a private alias for the service %s', (string) $alias)); @@ -576,6 +612,24 @@ private function formatRouterConfig(array $config): string return trim($configAsString); } + /** + * @param array $methods + */ + private function formatMethods(array $methods): string + { + if ([] === $methods) { + $methods = ['ANY']; + } + + return implode('|', array_map( + fn (string $method): string => \sprintf('%s', self::VERB_COLORS[$method] ?? 'default', $method), + $methods + )); + } + + /** + * @param (callable():ContainerBuilder)|null $getContainer + */ private function formatControllerLink(mixed $controller, string $anchorText, ?callable $getContainer = null): string { if (null === $this->fileLinkFormatter) { diff --git a/Console/Descriptor/XmlDescriptor.php b/Console/Descriptor/XmlDescriptor.php index 8daa61d2a..08ef443f1 100644 --- a/Console/Descriptor/XmlDescriptor.php +++ b/Console/Descriptor/XmlDescriptor.php @@ -288,6 +288,9 @@ private function getContainerServiceDocument(object $service, string $id, ?Conta return $dom; } + /** + * @param (callable(string):bool)|null $filter + */ private function getContainerServicesDocument(ContainerBuilder $container, ?string $tag = null, bool $showHidden = false, ?callable $filter = null): \DOMDocument { $dom = new \DOMDocument('1.0', 'UTF-8'); @@ -351,7 +354,7 @@ private function getContainerDefinitionDocument(Definition $definition, ?string } } - $serviceXML->setAttribute('public', $definition->isPublic() && !$definition->isPrivate() ? 'true' : 'false'); + $serviceXML->setAttribute('public', $definition->isPublic() ? 'true' : 'false'); $serviceXML->setAttribute('synthetic', $definition->isSynthetic() ? 'true' : 'false'); $serviceXML->setAttribute('lazy', $definition->isLazy() ? 'true' : 'false'); $serviceXML->setAttribute('shared', $definition->isShared() ? 'true' : 'false'); @@ -474,7 +477,7 @@ private function getContainerAliasDocument(Alias $alias, ?string $id = null): \D } $aliasXML->setAttribute('service', (string) $alias); - $aliasXML->setAttribute('public', $alias->isPublic() && !$alias->isPrivate() ? 'true' : 'false'); + $aliasXML->setAttribute('public', $alias->isPublic() ? 'true' : 'false'); return $dom; } diff --git a/Controller/AbstractController.php b/Controller/AbstractController.php index de7395d5a..7d04cc708 100644 --- a/Controller/AbstractController.php +++ b/Controller/AbstractController.php @@ -67,18 +67,6 @@ public function setContainer(ContainerInterface $container): ?ContainerInterface return $previous; } - /** - * Gets a container parameter by its name. - */ - protected function getParameter(string $name): array|bool|string|int|float|\UnitEnum|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)); - } - - return $this->container->get('parameter_bag')->get($name); - } - public static function getSubscribedServices(): array { return [ @@ -96,6 +84,18 @@ public static function getSubscribedServices(): array ]; } + /** + * Gets a container parameter by its name. + */ + protected function getParameter(string $name): array|bool|string|int|float|\UnitEnum|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)); + } + + return $this->container->get('parameter_bag')->get($name); + } + /** * Generates a URL from the given parameters. * @@ -226,13 +226,8 @@ protected function getAccessDecision(mixed $attribute, mixed $subject = null): A */ protected function denyAccessUnlessGranted(mixed $attribute, mixed $subject = null, string $message = 'Access Denied.'): void { - if (class_exists(AccessDecision::class)) { - $accessDecision = $this->getAccessDecision($attribute, $subject); - $isGranted = $accessDecision->isGranted; - } else { - $accessDecision = null; - $isGranted = $this->isGranted($attribute, $subject); - } + $accessDecision = $this->getAccessDecision($attribute, $subject); + $isGranted = $accessDecision->isGranted; if (!$isGranted) { $e = $this->createAccessDeniedException(3 > \func_num_args() && $accessDecision ? $accessDecision->getMessage() : $message); diff --git a/Controller/ControllerHelper.php b/Controller/ControllerHelper.php new file mode 100644 index 000000000..8d19f8c2d --- /dev/null +++ b/Controller/ControllerHelper.php @@ -0,0 +1,468 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Controller; + +use Psr\Container\ContainerInterface; +use Psr\Link\EvolvableLinkInterface; +use Psr\Link\LinkInterface; +use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; +use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface; +use Symfony\Component\Form\Extension\Core\Type\FormType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormFactoryInterface; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\HttpFoundation\BinaryFileResponse; +use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException; +use Symfony\Component\HttpFoundation\JsonResponse; +use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\ResponseHeaderBag; +use Symfony\Component\HttpFoundation\Session\FlashBagAwareSessionInterface; +use Symfony\Component\HttpFoundation\StreamedResponse; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\HttpKernel\HttpKernelInterface; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Symfony\Component\Routing\RouterInterface; +use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; +use Symfony\Component\Security\Core\Authorization\AccessDecision; +use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; +use Symfony\Component\Security\Core\Exception\AccessDeniedException; +use Symfony\Component\Security\Core\User\UserInterface; +use Symfony\Component\Security\Csrf\CsrfToken; +use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; +use Symfony\Component\Serializer\SerializerInterface; +use Symfony\Component\WebLink\EventListener\AddLinkHeaderListener; +use Symfony\Component\WebLink\GenericLinkProvider; +use Symfony\Component\WebLink\HttpHeaderSerializer; +use Symfony\Contracts\Service\ServiceSubscriberInterface; +use Twig\Environment; + +/** + * Provides the helpers from AbstractControler as a standalone service. + * + * Best used together with #[AutowireMethodOf] to remove any coupling. + */ +class ControllerHelper implements ServiceSubscriberInterface +{ + public function __construct( + private ContainerInterface $container, + ) { + } + + public static function getSubscribedServices(): array + { + return [ + 'router' => '?'.RouterInterface::class, + 'request_stack' => '?'.RequestStack::class, + 'http_kernel' => '?'.HttpKernelInterface::class, + 'serializer' => '?'.SerializerInterface::class, + 'security.authorization_checker' => '?'.AuthorizationCheckerInterface::class, + 'twig' => '?'.Environment::class, + 'form.factory' => '?'.FormFactoryInterface::class, + 'security.token_storage' => '?'.TokenStorageInterface::class, + 'security.csrf.token_manager' => '?'.CsrfTokenManagerInterface::class, + 'parameter_bag' => '?'.ContainerBagInterface::class, + 'web_link.http_header_serializer' => '?'.HttpHeaderSerializer::class, + ]; + } + + /** + * Gets a container parameter by its name. + */ + public function getParameter(string $name): array|bool|string|int|float|\UnitEnum|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)); + } + + return $this->container->get('parameter_bag')->get($name); + } + + /** + * Generates a URL from the given parameters. + * + * @see UrlGeneratorInterface + */ + public function generateUrl(string $route, array $parameters = [], int $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): string + { + return $this->container->get('router')->generate($route, $parameters, $referenceType); + } + + /** + * Forwards the request to another controller. + * + * @param string $controller The controller name (a string like "App\Controller\PostController::index" or "App\Controller\PostController" if it is invokable) + */ + public function forward(string $controller, array $path = [], array $query = []): Response + { + $request = $this->container->get('request_stack')->getCurrentRequest(); + $path['_controller'] = $controller; + $subRequest = $request->duplicate($query, null, $path); + + return $this->container->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST); + } + + /** + * Returns a RedirectResponse to the given URL. + * + * @param int $status The HTTP status code (302 "Found" by default) + */ + public function redirect(string $url, int $status = 302): RedirectResponse + { + return new RedirectResponse($url, $status); + } + + /** + * Returns a RedirectResponse to the given route with the given parameters. + * + * @param int $status The HTTP status code (302 "Found" by default) + */ + public function redirectToRoute(string $route, array $parameters = [], int $status = 302): RedirectResponse + { + return $this->redirect($this->generateUrl($route, $parameters), $status); + } + + /** + * Returns a JsonResponse that uses the serializer component if enabled, or json_encode. + * + * @param int $status The HTTP status code (200 "OK" by default) + */ + public function json(mixed $data, int $status = 200, array $headers = [], array $context = []): JsonResponse + { + if ($this->container->has('serializer')) { + $json = $this->container->get('serializer')->serialize($data, 'json', array_merge([ + 'json_encode_options' => JsonResponse::DEFAULT_ENCODING_OPTIONS, + ], $context)); + + return new JsonResponse($json, $status, $headers, true); + } + + return new JsonResponse($data, $status, $headers); + } + + /** + * Returns a BinaryFileResponse object with original or customized file name and disposition header. + */ + public function file(\SplFileInfo|string $file, ?string $fileName = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT): BinaryFileResponse + { + $response = new BinaryFileResponse($file); + $response->setContentDisposition($disposition, $fileName ?? $response->getFile()->getFilename()); + + return $response; + } + + /** + * Adds a flash message to the current session for type. + * + * @throws \LogicException + */ + public function addFlash(string $type, mixed $message): void + { + try { + $session = $this->container->get('request_stack')->getSession(); + } catch (SessionNotFoundException $e) { + throw new \LogicException('You cannot use the addFlash method if sessions are disabled. Enable them in "config/packages/framework.yaml".', 0, $e); + } + + if (!$session instanceof FlashBagAwareSessionInterface) { + throw new \LogicException(\sprintf('You cannot use the addFlash method because class "%s" doesn\'t implement "%s".', get_debug_type($session), FlashBagAwareSessionInterface::class)); + } + + $session->getFlashBag()->add($type, $message); + } + + /** + * Checks if the attribute is granted against the current authentication token and optionally supplied subject. + * + * @throws \LogicException + */ + public function isGranted(mixed $attribute, mixed $subject = null): bool + { + if (!$this->container->has('security.authorization_checker')) { + throw new \LogicException('The SecurityBundle is not registered in your application. Try running "composer require symfony/security-bundle".'); + } + + return $this->container->get('security.authorization_checker')->isGranted($attribute, $subject); + } + + /** + * Checks if the attribute is granted against the current authentication token and optionally supplied subject. + */ + public function getAccessDecision(mixed $attribute, mixed $subject = null): AccessDecision + { + if (!$this->container->has('security.authorization_checker')) { + throw new \LogicException('The SecurityBundle is not registered in your application. Try running "composer require symfony/security-bundle".'); + } + + $accessDecision = new AccessDecision(); + $accessDecision->isGranted = $this->container->get('security.authorization_checker')->isGranted($attribute, $subject, $accessDecision); + + return $accessDecision; + } + + /** + * Throws an exception unless the attribute is granted against the current authentication token and optionally + * supplied subject. + * + * @throws AccessDeniedException + */ + public function denyAccessUnlessGranted(mixed $attribute, mixed $subject = null, string $message = 'Access Denied.'): void + { + $accessDecision = $this->getAccessDecision($attribute, $subject); + $isGranted = $accessDecision->isGranted; + + if (!$isGranted) { + $e = $this->createAccessDeniedException(3 > \func_num_args() && $accessDecision ? $accessDecision->getMessage() : $message); + $e->setAttributes([$attribute]); + $e->setSubject($subject); + + if ($accessDecision) { + $e->setAccessDecision($accessDecision); + } + + throw $e; + } + } + + /** + * Returns a rendered view. + * + * Forms found in parameters are auto-cast to form views. + */ + public function renderView(string $view, array $parameters = []): string + { + return $this->doRenderView($view, null, $parameters, __FUNCTION__); + } + + /** + * Returns a rendered block from a view. + * + * Forms found in parameters are auto-cast to form views. + */ + public function renderBlockView(string $view, string $block, array $parameters = []): string + { + return $this->doRenderView($view, $block, $parameters, __FUNCTION__); + } + + /** + * Renders a view. + * + * If an invalid form is found in the list of parameters, a 422 status code is returned. + * Forms found in parameters are auto-cast to form views. + */ + public function render(string $view, array $parameters = [], ?Response $response = null): Response + { + return $this->doRender($view, null, $parameters, $response, __FUNCTION__); + } + + /** + * Renders a block in a view. + * + * If an invalid form is found in the list of parameters, a 422 status code is returned. + * Forms found in parameters are auto-cast to form views. + */ + public function renderBlock(string $view, string $block, array $parameters = [], ?Response $response = null): Response + { + return $this->doRender($view, $block, $parameters, $response, __FUNCTION__); + } + + /** + * Streams a view. + */ + public function stream(string $view, array $parameters = [], ?StreamedResponse $response = null): StreamedResponse + { + if (!$this->container->has('twig')) { + throw new \LogicException('You cannot use the "stream" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".'); + } + + $twig = $this->container->get('twig'); + + $callback = function () use ($twig, $view, $parameters) { + $twig->display($view, $parameters); + }; + + if (null === $response) { + return new StreamedResponse($callback); + } + + $response->setCallback($callback); + + return $response; + } + + /** + * Returns a NotFoundHttpException. + * + * This will result in a 404 response code. Usage example: + * + * throw $this->createNotFoundException('Page not found!'); + */ + public function createNotFoundException(string $message = 'Not Found', ?\Throwable $previous = null): NotFoundHttpException + { + return new NotFoundHttpException($message, $previous); + } + + /** + * Returns an AccessDeniedException. + * + * This will result in a 403 response code. Usage example: + * + * throw $this->createAccessDeniedException('Unable to access this page!'); + * + * @throws \LogicException If the Security component is not available + */ + public function createAccessDeniedException(string $message = 'Access Denied.', ?\Throwable $previous = null): AccessDeniedException + { + if (!class_exists(AccessDeniedException::class)) { + throw new \LogicException('You cannot use the "createAccessDeniedException" method if the Security component is not available. Try running "composer require symfony/security-bundle".'); + } + + return new AccessDeniedException($message, $previous); + } + + /** + * Creates and returns a Form instance from the type of the form. + */ + public function createForm(string $type, mixed $data = null, array $options = []): FormInterface + { + return $this->container->get('form.factory')->create($type, $data, $options); + } + + /** + * Creates and returns a form builder instance. + */ + public function createFormBuilder(mixed $data = null, array $options = []): FormBuilderInterface + { + return $this->container->get('form.factory')->createBuilder(FormType::class, $data, $options); + } + + /** + * Get a user from the Security Token Storage. + * + * @throws \LogicException If SecurityBundle is not available + * + * @see TokenInterface::getUser() + */ + public function getUser(): ?UserInterface + { + 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".'); + } + + if (null === $token = $this->container->get('security.token_storage')->getToken()) { + return null; + } + + return $token->getUser(); + } + + /** + * Checks the validity of a CSRF token. + * + * @param string $id The id used when generating the token + * @param string|null $token The actual token sent with the request that should be validated + */ + public function isCsrfTokenValid(string $id, #[\SensitiveParameter] ?string $token): bool + { + if (!$this->container->has('security.csrf.token_manager')) { + throw new \LogicException('CSRF protection is not enabled in your application. Enable it with the "csrf_protection" key in "config/packages/framework.yaml".'); + } + + return $this->container->get('security.csrf.token_manager')->isTokenValid(new CsrfToken($id, $token)); + } + + /** + * Adds a Link HTTP header to the current response. + * + * @see https://tools.ietf.org/html/rfc5988 + */ + public function addLink(Request $request, LinkInterface $link): void + { + if (!class_exists(AddLinkHeaderListener::class)) { + throw new \LogicException('You cannot use the "addLink" method if the WebLink component is not available. Try running "composer require symfony/web-link".'); + } + + if (null === $linkProvider = $request->attributes->get('_links')) { + $request->attributes->set('_links', new GenericLinkProvider([$link])); + + return; + } + + $request->attributes->set('_links', $linkProvider->withLink($link)); + } + + /** + * @param LinkInterface[] $links + */ + public function sendEarlyHints(iterable $links = [], ?Response $response = null): Response + { + if (!$this->container->has('web_link.http_header_serializer')) { + throw new \LogicException('You cannot use the "sendEarlyHints" method if the WebLink component is not available. Try running "composer require symfony/web-link".'); + } + + $response ??= new Response(); + + $populatedLinks = []; + foreach ($links as $link) { + if ($link instanceof EvolvableLinkInterface && !$link->getRels()) { + $link = $link->withRel('preload'); + } + + $populatedLinks[] = $link; + } + + $response->headers->set('Link', $this->container->get('web_link.http_header_serializer')->serialize($populatedLinks), false); + $response->sendHeaders(103); + + return $response; + } + + private function doRenderView(string $view, ?string $block, array $parameters, string $method): string + { + if (!$this->container->has('twig')) { + throw new \LogicException(\sprintf('You cannot use the "%s" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".', $method)); + } + + foreach ($parameters as $k => $v) { + if ($v instanceof FormInterface) { + $parameters[$k] = $v->createView(); + } + } + + if (null !== $block) { + return $this->container->get('twig')->load($view)->renderBlock($block, $parameters); + } + + return $this->container->get('twig')->render($view, $parameters); + } + + private function doRender(string $view, ?string $block, array $parameters, ?Response $response, string $method): Response + { + $content = $this->doRenderView($view, $block, $parameters, $method); + $response ??= new Response(); + + if (200 === $response->getStatusCode()) { + foreach ($parameters as $v) { + if ($v instanceof FormInterface && $v->isSubmitted() && !$v->isValid()) { + $response->setStatusCode(422); + break; + } + } + } + + $response->setContent($content); + + return $response; + } +} diff --git a/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php b/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php index e4023e623..456305bc9 100644 --- a/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php +++ b/DependencyInjection/Compiler/ContainerBuilderDebugDumpPass.php @@ -13,8 +13,11 @@ use Symfony\Component\Config\ConfigCache; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\Compiler\ResolveEnvPlaceholdersPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Dumper\XmlDumper; +use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag; +use Symfony\Component\Filesystem\Filesystem; /** * Dumps the ContainerBuilder to a cache file so that it can be used by @@ -31,9 +34,52 @@ public function process(ContainerBuilder $container): void return; } - $cache = new ConfigCache($container->getParameter('debug.container.dump'), true); - if (!$cache->isFresh()) { - $cache->write((new XmlDumper($container))->dump(), $container->getResources()); + $file = $container->getParameter('debug.container.dump'); + $cache = new ConfigCache($file, true); + if ($cache->isFresh()) { + return; + } + $cache->write((new XmlDumper($container))->dump(), $container->getResources()); + + if (!str_ends_with($file, '.xml')) { + return; + } + + $file = substr_replace($file, '.ser', -4); + + try { + $dump = new ContainerBuilder(clone $container->getParameterBag()); + $dump->setDefinitions(unserialize(serialize($container->getDefinitions()))); + $dump->setAliases($container->getAliases()); + + if (($bag = $container->getParameterBag()) instanceof EnvPlaceholderParameterBag) { + (new ResolveEnvPlaceholdersPass(null))->process($dump); + $dump->__construct(new EnvPlaceholderParameterBag($container->resolveEnvPlaceholders($this->escapeParameters($bag->all())))); + } + + $fs = new Filesystem(); + $fs->dumpFile($file, serialize($dump)); + $fs->chmod($file, 0o666, umask()); + } catch (\Throwable $e) { + $container->getCompiler()->log($this, $e->getMessage()); + // ignore serialization and file-system errors + if (file_exists($file)) { + @unlink($file); + } } } + + private function escapeParameters(array $parameters): array + { + $params = []; + foreach ($parameters as $k => $v) { + $params[$k] = match (true) { + \is_array($v) => $this->escapeParameters($v), + \is_string($v) => str_replace('%', '%%', $v), + default => $v, + }; + } + + return $params; + } } diff --git a/DependencyInjection/Compiler/TestServiceContainerWeakRefPass.php b/DependencyInjection/Compiler/TestServiceContainerWeakRefPass.php index 3b3dfcc06..084c6066b 100644 --- a/DependencyInjection/Compiler/TestServiceContainerWeakRefPass.php +++ b/DependencyInjection/Compiler/TestServiceContainerWeakRefPass.php @@ -31,7 +31,7 @@ public function process(ContainerBuilder $container): void $definitions = $container->getDefinitions(); foreach ($definitions as $id => $definition) { - if ($id && '.' !== $id[0] && (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag('container.private')) && !$definition->hasErrors() && !$definition->isAbstract()) { + if ($id && '.' !== $id[0] && ($definition->isPrivate() || $definition->hasTag('container.private')) && !$definition->hasErrors() && !$definition->isAbstract()) { $privateServices[$id] = new Reference($id, ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE); } } @@ -39,7 +39,7 @@ public function process(ContainerBuilder $container): void $aliases = $container->getAliases(); foreach ($aliases as $id => $alias) { - if ($id && '.' !== $id[0] && (!$alias->isPublic() || $alias->isPrivate())) { + if ($id && '.' !== $id[0] && $alias->isPrivate()) { while (isset($aliases[$target = (string) $alias])) { $alias = $aliases[$target]; } diff --git a/DependencyInjection/Compiler/UnusedTagsPass.php b/DependencyInjection/Compiler/UnusedTagsPass.php index 53361e312..36e3ee1ae 100644 --- a/DependencyInjection/Compiler/UnusedTagsPass.php +++ b/DependencyInjection/Compiler/UnusedTagsPass.php @@ -78,6 +78,7 @@ class UnusedTagsPass implements CompilerPassInterface 'proxy', 'remote_event.consumer', 'routing.condition_service', + 'routing.controller', 'routing.expression_language_function', 'routing.expression_language_provider', 'routing.loader', @@ -101,6 +102,7 @@ class UnusedTagsPass implements CompilerPassInterface 'twig.extension', 'twig.loader', 'twig.runtime', + 'validator.attribute_metadata', 'validator.auto_mapper', 'validator.constraint_validator', 'validator.group_provider', diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 1931306eb..99337d554 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -26,6 +26,7 @@ use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\LogicException; +use Symfony\Component\Finder\Glob; use Symfony\Component\Form\Form; use Symfony\Component\HtmlSanitizer\HtmlSanitizerInterface; use Symfony\Component\HttpClient\HttpClient; @@ -85,8 +86,6 @@ public function getConfigTreeBuilder(): TreeBuilder return $v; }) ->end() - ->fixXmlConfig('enabled_locale') - ->fixXmlConfig('trusted_header') ->children() ->scalarNode('secret')->end() ->booleanNode('http_method_override') @@ -108,7 +107,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->info('Whether to set the Content-Language HTTP header on the Response using the Request locale.') ->defaultFalse() ->end() - ->arrayNode('enabled_locales') + ->arrayNode('enabled_locales', 'enabled_locale') ->info('Defines the possible locales for the application. This list is used for generating translations files, but also to restrict which locales are allowed when it is set from Accept-Language header (using "set_locale_from_accept_language").') ->prototype('scalar')->end() ->end() @@ -124,7 +123,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->end() ->defaultValue(['%env(default::SYMFONY_TRUSTED_PROXIES)%']) ->end() - ->arrayNode('trusted_headers') + ->arrayNode('trusted_headers', 'trusted_header') ->performNoDeepMerging() ->beforeNormalization()->ifString()->then(static fn ($v) => $v ? [$v] : [])->end() ->prototype('scalar')->end() @@ -161,7 +160,6 @@ public function getConfigTreeBuilder(): TreeBuilder $this->addAssetMapperSection($rootNode, $enableIfStandalone); $this->addTranslatorSection($rootNode, $enableIfStandalone); $this->addValidationSection($rootNode, $enableIfStandalone); - $this->addAnnotationsSection($rootNode); $this->addSerializerSection($rootNode, $enableIfStandalone); $this->addPropertyAccessSection($rootNode, $willBeAvailable); $this->addTypeInfoSection($rootNode, $enableIfStandalone); @@ -214,11 +212,10 @@ private function addCsrfSection(ArrayNodeDefinition $rootNode): void ->treatTrueLike(['enabled' => true]) ->treatNullLike(['enabled' => true]) ->addDefaultsIfNotSet() - ->fixXmlConfig('stateless_token_id') ->children() // defaults to (framework.csrf_protection.stateless_token_ids || framework.session.enabled) && !class_exists(FullStack::class) && interface_exists(CsrfTokenManagerInterface::class) ->scalarNode('enabled')->defaultNull()->end() - ->arrayNode('stateless_token_ids') + ->arrayNode('stateless_token_ids', 'stateless_token_id') ->scalarPrototype()->end() ->info('Enable headers/cookies-based CSRF validation for the listed token ids.') ->end() @@ -275,8 +272,6 @@ private function addHttpCacheSection(ArrayNodeDefinition $rootNode): void ->arrayNode('http_cache') ->info('HTTP cache configuration') ->canBeEnabled() - ->fixXmlConfig('private_header') - ->fixXmlConfig('skip_response_header') ->children() ->booleanNode('debug')->defaultValue('%kernel.debug%')->end() ->enumNode('trace_level') @@ -284,11 +279,11 @@ private function addHttpCacheSection(ArrayNodeDefinition $rootNode): void ->end() ->scalarNode('trace_header')->end() ->integerNode('default_ttl')->end() - ->arrayNode('private_headers') + ->arrayNode('private_headers', 'private_header') ->performNoDeepMerging() ->scalarPrototype()->end() ->end() - ->arrayNode('skip_response_headers') + ->arrayNode('skip_response_headers', 'skip_response_header') ->performNoDeepMerging() ->scalarPrototype()->end() ->end() @@ -355,7 +350,7 @@ private function addProfilerSection(ArrayNodeDefinition $rootNode): void ->booleanNode('only_exceptions')->defaultFalse()->end() ->booleanNode('only_main_requests')->defaultFalse()->end() ->scalarNode('dsn')->defaultValue('file:%kernel.cache_dir%/profiler')->end() - ->booleanNode('collect_serializer_data')->info('Enables the serializer data collector and profiler panel.')->defaultFalse()->end() + ->enumNode('collect_serializer_data')->values([true])->defaultTrue()->end() // to be @deprecated in Symfony 8.1 ->end() ->end() ->end() @@ -365,9 +360,8 @@ private function addProfilerSection(ArrayNodeDefinition $rootNode): void private function addWorkflowSection(ArrayNodeDefinition $rootNode): void { $rootNode - ->fixXmlConfig('workflow') ->children() - ->arrayNode('workflows') + ->arrayNode('workflows', 'workflow') ->canBeEnabled() ->beforeNormalization() ->always(static function ($v) { @@ -401,14 +395,9 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void }) ->end() ->children() - ->arrayNode('workflows') + ->arrayNode('workflows', 'workflow') ->useAttributeAsKey('name') ->prototype('array') - ->fixXmlConfig('support') - ->fixXmlConfig('definition_validator') - ->fixXmlConfig('place') - ->fixXmlConfig('transition') - ->fixXmlConfig('event_to_dispatch', 'events_to_dispatch') ->children() ->arrayNode('audit_trail') ->canBeEnabled() @@ -430,7 +419,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void ->end() ->end() ->end() - ->arrayNode('supports') + ->arrayNode('supports', 'support') ->beforeNormalization()->castToArray()->end() ->prototype('scalar') ->cannotBeEmpty() @@ -440,7 +429,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void ->end() ->end() ->end() - ->arrayNode('definition_validators') + ->arrayNode('definition_validators', 'definition_validator') ->prototype('scalar') ->cannotBeEmpty() ->validate() @@ -465,22 +454,17 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void ->defaultValue([]) ->prototype('scalar')->end() ->end() - ->variableNode('events_to_dispatch') - ->defaultValue(null) + ->arrayNode('events_to_dispatch', 'event_to_dispatch') + ->defaultNull() + ->stringPrototype()->end() ->validate() ->ifTrue(static function ($v) { - if (null === $v) { + if (!class_exists(WorkflowEvents::class)) { return false; } - if (!\is_array($v)) { - return true; - } foreach ($v as $value) { - if (!\is_string($value)) { - return true; - } - if (class_exists(WorkflowEvents::class) && !\in_array($value, WorkflowEvents::ALIASES, true)) { + if (!\in_array($value, WorkflowEvents::ALIASES, true)) { return true; } } @@ -492,17 +476,38 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void ->info('Select which Transition events should be dispatched for this Workflow.') ->example(['workflow.enter', 'workflow.transition']) ->end() - ->arrayNode('places') + ->arrayNode('places', 'place') ->beforeNormalization() - ->always() - ->then(static function ($places) { - if (!\is_array($places)) { - throw new InvalidConfigurationException('The "places" option must be an array in workflow configuration.'); + ->always(static function ($places) { + if (\is_string($places)) { + if (2 !== \count($places = explode('::', $places, 2))) { + throw new InvalidConfigurationException('The "places" option must be a "FQCN::glob" pattern in workflow configuration.'); + } + [$class, $pattern] = $places; + if (!class_exists($class) && !interface_exists($class, false)) { + throw new InvalidConfigurationException(\sprintf('The "places" option must be a "FQCN::glob" pattern in workflow configuration, but class "%s" is not found.', $class)); + } + + $places = []; + $regex = Glob::toRegex($pattern, false); + + foreach ((new \ReflectionClass($class))->getConstants() as $name => $value) { + if (preg_match($regex, $name)) { + $places[] = $value; + } + } + if (!$places) { + throw new InvalidConfigurationException(\sprintf('No places found for pattern "%s::%s" in workflow configuration.', $class, $pattern)); + } + } elseif (!\is_array($places)) { + throw new InvalidConfigurationException('The "places" option must be an array or a "FQCN::glob" pattern in workflow configuration.'); } $normalizedPlaces = []; foreach ($places as $key => $value) { - if (!\is_array($value)) { + if ($value instanceof \BackedEnum) { + $value = ['name' => $value->value]; + } elseif (!\is_array($value)) { $value = ['name' => $value]; } $value['name'] ??= $key; @@ -528,7 +533,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void ->end() ->end() ->end() - ->arrayNode('transitions') + ->arrayNode('transitions', 'transition') ->beforeNormalization() ->always(static function ($transitions) { if (!\is_array($transitions)) { @@ -567,7 +572,9 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void ->end() ->arrayNode('from') ->performNoDeepMerging() - ->beforeNormalization()->castToArray()->end() + ->beforeNormalization() + ->always(static fn ($from) => array_map(static fn ($v) => $v instanceof \BackedEnum ? $v->value : $v, \is_array($from) ? $from : [$from])) + ->end() ->requiresAtLeastOneElement() ->prototype('scalar') ->cannotBeEmpty() @@ -575,7 +582,9 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void ->end() ->arrayNode('to') ->performNoDeepMerging() - ->beforeNormalization()->castToArray()->end() + ->beforeNormalization() + ->always(static fn ($to) => array_map(static fn ($v) => $v instanceof \BackedEnum ? $v->value : $v, \is_array($to) ? $to : [$to])) + ->end() ->requiresAtLeastOneElement() ->prototype('scalar') ->cannotBeEmpty() @@ -600,28 +609,23 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode): void ->end() ->end() ->validate() - ->ifTrue(static function ($v) { - return $v['supports'] && isset($v['support_strategy']); - }) + ->ifTrue(static fn ($v) => $v['supports'] && isset($v['support_strategy'])) ->thenInvalid('"supports" and "support_strategy" cannot be used together.') ->end() ->validate() - ->ifTrue(static function ($v) { - return !$v['supports'] && !isset($v['support_strategy']); - }) + ->ifTrue(static fn ($v) => !$v['supports'] && !isset($v['support_strategy'])) ->thenInvalid('"supports" or "support_strategy" should be configured.') ->end() ->beforeNormalization() - ->always() - ->then(static function ($values) { - // Special case to deal with XML when the user wants an empty array - if (\array_key_exists('event_to_dispatch', $values) && null === $values['event_to_dispatch']) { - $values['events_to_dispatch'] = []; - unset($values['event_to_dispatch']); - } + ->always(static function ($values) { + // Special case to deal with XML when the user wants an empty array + if (\array_key_exists('event_to_dispatch', $values) && null === $values['event_to_dispatch']) { + $values['events_to_dispatch'] = []; + unset($values['event_to_dispatch']); + } - return $values; - }) + return $values; + }) ->end() ->end() ->end() @@ -641,10 +645,6 @@ private function addRouterSection(ArrayNodeDefinition $rootNode): void ->children() ->scalarNode('resource')->isRequired()->end() ->scalarNode('type')->end() - ->scalarNode('cache_dir') - ->defaultValue('%kernel.build_dir%') - ->setDeprecated('symfony/framework-bundle', '7.1', 'Setting the "%path%.%node%" configuration option is deprecated. It will be removed in version 8.0.') - ->end() ->scalarNode('default_uri') ->info('The default URI used to generate URLs in a non-HTTP context.') ->defaultNull() @@ -706,16 +706,6 @@ private function addSessionSection(ArrayNodeDefinition $rootNode): void ->defaultValue(0) ->info('Seconds to wait between 2 session metadata updates.') ->end() - ->integerNode('sid_length') - ->min(22) - ->max(256) - ->setDeprecated('symfony/framework-bundle', '7.2', 'Setting the "%path%.%node%" configuration option is deprecated. It will be removed in version 8.0. No alternative is provided as PHP 8.4 has deprecated the related option.') - ->end() - ->integerNode('sid_bits_per_character') - ->min(4) - ->max(6) - ->setDeprecated('symfony/framework-bundle', '7.2', 'Setting the "%path%.%node%" configuration option is deprecated. It will be removed in version 8.0. No alternative is provided as PHP 8.4 has deprecated the related option.') - ->end() ->end() ->end() ->end() @@ -729,9 +719,8 @@ private function addRequestSection(ArrayNodeDefinition $rootNode): void ->arrayNode('request') ->info('Request configuration') ->canBeEnabled() - ->fixXmlConfig('format') ->children() - ->arrayNode('formats') + ->arrayNode('formats', 'format') ->useAttributeAsKey('name') ->prototype('array') ->beforeNormalization() @@ -755,7 +744,6 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode, callable $enabl ->arrayNode('assets') ->info('Assets configuration') ->{$enableIfStandalone('symfony/asset', Package::class)}() - ->fixXmlConfig('base_url') ->children() ->booleanNode('strict_mode') ->info('Throw an exception if an entry is missing from the manifest.json.') @@ -766,7 +754,7 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode, callable $enabl ->scalarNode('version_format')->defaultValue('%%s?%%s')->end() ->scalarNode('json_manifest_path')->defaultNull()->end() ->scalarNode('base_path')->defaultValue('')->end() - ->arrayNode('base_urls') + ->arrayNode('base_urls', 'base_url') ->requiresAtLeastOneElement() ->beforeNormalization()->castToArray()->end() ->prototype('scalar')->end() @@ -790,13 +778,11 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode, callable $enabl }) ->thenInvalid('You cannot use both "version" and "json_manifest_path" at the same time under "assets".') ->end() - ->fixXmlConfig('package') ->children() - ->arrayNode('packages') + ->arrayNode('packages', 'package') ->normalizeKeys(false) ->useAttributeAsKey('name') ->prototype('array') - ->fixXmlConfig('base_url') ->children() ->booleanNode('strict_mode') ->info('Throw an exception if an entry is missing from the manifest.json.') @@ -812,7 +798,7 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode, callable $enabl ->scalarNode('version_format')->defaultNull()->end() ->scalarNode('json_manifest_path')->defaultNull()->end() ->scalarNode('base_path')->defaultValue('')->end() - ->arrayNode('base_urls') + ->arrayNode('base_urls', 'base_url') ->requiresAtLeastOneElement() ->beforeNormalization()->castToArray()->end() ->prototype('scalar')->end() @@ -851,13 +837,9 @@ private function addAssetMapperSection(ArrayNodeDefinition $rootNode, callable $ ->arrayNode('asset_mapper') ->info('Asset Mapper configuration') ->{$enableIfStandalone('symfony/asset-mapper', AssetMapper::class)}() - ->fixXmlConfig('path') - ->fixXmlConfig('excluded_pattern') - ->fixXmlConfig('extension') - ->fixXmlConfig('importmap_script_attribute') ->children() // add array node called "paths" that will be an array of strings - ->arrayNode('paths') + ->arrayNode('paths', 'path') ->info('Directories that hold assets that should be in the mapper. Can be a simple array of an array of ["path/to/assets": "namespace"].') ->example(['assets/']) ->normalizeKeys(false) @@ -888,7 +870,7 @@ private function addAssetMapperSection(ArrayNodeDefinition $rootNode, callable $ ->end() ->prototype('scalar')->end() ->end() - ->arrayNode('excluded_patterns') + ->arrayNode('excluded_patterns', 'excluded_pattern') ->info('Array of glob patterns of asset file paths that should not be in the asset mapper.') ->prototype('scalar')->end() ->example(['*/assets/build/*', '*/*_.scss']) @@ -911,7 +893,7 @@ private function addAssetMapperSection(ArrayNodeDefinition $rootNode, callable $ ->info('Behavior if an asset cannot be found when imported from JavaScript or CSS files - e.g. "import \'./non-existent.js\'". "strict" means an exception is thrown, "warn" means a warning is logged, "ignore" means the import is left as-is.') ->defaultValue('warn') ->end() - ->arrayNode('extensions') + ->arrayNode('extensions', 'extension') ->info('Key-value pair of file extensions set to their mime type.') ->normalizeKeys(false) ->useAttributeAsKey('extension') @@ -930,7 +912,7 @@ private function addAssetMapperSection(ArrayNodeDefinition $rootNode, callable $ ->end() ->defaultValue('es-module-shims') ->end() - ->arrayNode('importmap_script_attributes') + ->arrayNode('importmap_script_attributes', 'importmap_script_attribute') ->info('Key-value pair of attributes to add to script tags output for the importmap.') ->normalizeKeys(false) ->useAttributeAsKey('key') @@ -944,10 +926,8 @@ private function addAssetMapperSection(ArrayNodeDefinition $rootNode, callable $ ->arrayNode('precompress') ->info('Precompress assets with Brotli, Zstandard and gzip.') ->canBeEnabled() - ->fixXmlConfig('format') - ->fixXmlConfig('extension') ->children() - ->arrayNode('formats') + ->arrayNode('formats', 'format') ->info('Array of formats to enable. "brotli", "zstandard" and "gzip" are supported. Defaults to all formats supported by the system. The entire list must be provided.') ->prototype('scalar')->end() ->performNoDeepMerging() @@ -956,7 +936,7 @@ private function addAssetMapperSection(ArrayNodeDefinition $rootNode, callable $ ->thenInvalid('Unsupported format: "brotli", "zstandard" and "gzip" are supported.') ->end() ->end() - ->arrayNode('extensions') + ->arrayNode('extensions', 'extension') ->info('Array of extensions to compress. The entire list must be provided, no merging occurs.') ->prototype('scalar')->end() ->performNoDeepMerging() @@ -977,12 +957,8 @@ private function addTranslatorSection(ArrayNodeDefinition $rootNode, callable $e ->arrayNode('translator') ->info('Translator configuration') ->{$enableIfStandalone('symfony/translation', Translator::class)}() - ->fixXmlConfig('fallback') - ->fixXmlConfig('path') - ->fixXmlConfig('provider') - ->fixXmlConfig('global') ->children() - ->arrayNode('fallbacks') + ->arrayNode('fallbacks', 'fallback') ->info('Defaults to the value of "default_locale".') ->beforeNormalization()->castToArray()->end() ->prototype('scalar')->end() @@ -995,12 +971,11 @@ private function addTranslatorSection(ArrayNodeDefinition $rootNode, callable $e ->info('The default path used to load translations.') ->defaultValue('%kernel.project_dir%/translations') ->end() - ->arrayNode('paths') + ->arrayNode('paths', 'path') ->prototype('scalar')->end() ->end() ->arrayNode('pseudo_localization') ->canBeEnabled() - ->fixXmlConfig('localizable_html_attribute') ->children() ->booleanNode('accents')->defaultTrue()->end() ->floatNode('expansion_factor') @@ -1009,24 +984,22 @@ private function addTranslatorSection(ArrayNodeDefinition $rootNode, callable $e ->end() ->booleanNode('brackets')->defaultTrue()->end() ->booleanNode('parse_html')->defaultFalse()->end() - ->arrayNode('localizable_html_attributes') + ->arrayNode('localizable_html_attributes', 'localizable_html_attribute') ->prototype('scalar')->end() ->end() ->end() ->end() - ->arrayNode('providers') + ->arrayNode('providers', 'provider') ->info('Translation providers you can read/write your translations from.') ->useAttributeAsKey('name') ->prototype('array') - ->fixXmlConfig('domain') - ->fixXmlConfig('locale') ->children() ->scalarNode('dsn')->end() - ->arrayNode('domains') + ->arrayNode('domains', 'domain') ->prototype('scalar')->end() ->defaultValue([]) ->end() - ->arrayNode('locales') + ->arrayNode('locales', 'locale') ->prototype('scalar')->end() ->defaultValue([]) ->info('If not set, all locales listed under framework.enabled_locales are used.') @@ -1035,17 +1008,16 @@ private function addTranslatorSection(ArrayNodeDefinition $rootNode, callable $e ->end() ->defaultValue([]) ->end() - ->arrayNode('globals') + ->arrayNode('globals', 'global') ->info('Global parameters.') ->example(['app_version' => 3.14]) ->normalizeKeys(false) ->useAttributeAsKey('name') ->arrayPrototype() - ->fixXmlConfig('parameter') ->children() ->variableNode('value')->end() ->stringNode('message')->end() - ->arrayNode('parameters') + ->arrayNode('parameters', 'parameter') ->normalizeKeys(false) ->useAttributeAsKey('name') ->scalarPrototype()->end() @@ -1076,9 +1048,6 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e ->info('Validation configuration') ->{$enableIfStandalone('symfony/validator', Validation::class)}() ->children() - ->scalarNode('cache') - ->setDeprecated('symfony/framework-bundle', '7.3', 'Setting the "%path%.%node%" configuration option is deprecated. It will be removed in version 8.0.') - ->end() ->booleanNode('enable_attributes')->{class_exists(FullStack::class) ? 'defaultFalse' : 'defaultTrue'}()->end() ->arrayNode('static_method') ->defaultValue(['loadValidatorMetadata']) @@ -1087,12 +1056,11 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e ->validate()->castToArray()->end() ->end() ->scalarNode('translation_domain')->defaultValue('validators')->end() - ->enumNode('email_validation_mode')->values(['html5', 'html5-allow-no-tld', 'strict', 'loose'])->defaultValue('html5')->end() + ->enumNode('email_validation_mode')->values(['html5', 'html5-allow-no-tld', 'strict'])->defaultValue('html5')->end() ->arrayNode('mapping') ->addDefaultsIfNotSet() - ->fixXmlConfig('path') ->children() - ->arrayNode('paths') + ->arrayNode('paths', 'path') ->prototype('scalar')->end() ->end() ->end() @@ -1145,9 +1113,8 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e }) ->end() ->arrayPrototype() - ->fixXmlConfig('service') ->children() - ->arrayNode('services') + ->arrayNode('services', 'service') ->prototype('scalar')->end() ->end() ->end() @@ -1159,20 +1126,6 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e ; } - private function addAnnotationsSection(ArrayNodeDefinition $rootNode): void - { - $rootNode - ->children() - ->arrayNode('annotations') - ->canBeEnabled() - ->validate() - ->ifTrue(static fn (array $v) => $v['enabled']) - ->thenInvalid('Enabling the doctrine/annotations integration is not supported anymore.') - ->end() - ->end() - ; - } - private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $enableIfStandalone): void { $defaultContextNode = fn () => (new NodeBuilder()) @@ -1190,7 +1143,6 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $e ->children() ->arrayNode('serializer') ->info('Serializer configuration') - ->fixXmlConfig('named_serializer', 'named_serializers') ->{$enableIfStandalone('symfony/serializer', Serializer::class)}() ->children() ->booleanNode('enable_attributes')->{class_exists(FullStack::class) ? 'defaultFalse' : 'defaultTrue'}()->end() @@ -1199,15 +1151,14 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $e ->scalarNode('max_depth_handler')->end() ->arrayNode('mapping') ->addDefaultsIfNotSet() - ->fixXmlConfig('path') ->children() - ->arrayNode('paths') + ->arrayNode('paths', 'path') ->prototype('scalar')->end() ->end() ->end() ->end() ->append($defaultContextNode()) - ->arrayNode('named_serializers') + ->arrayNode('named_serializers', 'named_serializer') ->useAttributeAsKey('name') ->arrayPrototype() ->children() @@ -1272,20 +1223,11 @@ private function addPropertyInfoSection(ArrayNodeDefinition $rootNode, callable ->children() ->booleanNode('with_constructor_extractor') ->info('Registers the constructor extractor.') + ->defaultTrue() ->end() ->end() ->end() ->end() - ->validate() - ->ifTrue(fn ($v) => $v['property_info']['enabled'] && !isset($v['property_info']['with_constructor_extractor'])) - ->then(function ($v) { - $v['property_info']['with_constructor_extractor'] = false; - - trigger_deprecation('symfony/framework-bundle', '7.3', 'Not setting the "property_info.with_constructor_extractor" option explicitly is deprecated because its default value will change in version 8.0.'); - - return $v; - }) - ->end() ; } @@ -1296,6 +1238,16 @@ private function addTypeInfoSection(ArrayNodeDefinition $rootNode, callable $ena ->arrayNode('type_info') ->info('Type info configuration') ->{$enableIfStandalone('symfony/type-info', Type::class)}() + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('aliases', 'alias') + ->info('Additional type aliases to be used during type context creation.') + ->defaultValue([]) + ->normalizeKeys(false) + ->useAttributeAsKey('name') + ->scalarPrototype()->end() + ->end() + ->end() ->end() ->end() ; @@ -1308,7 +1260,6 @@ private function addCacheSection(ArrayNodeDefinition $rootNode, callable $willBe ->arrayNode('cache') ->info('Cache configuration') ->addDefaultsIfNotSet() - ->fixXmlConfig('pool') ->children() ->scalarNode('prefix_seed') ->info('Used to namespace cache keys when using several apps with the same shared backend.') @@ -1330,16 +1281,15 @@ private function addCacheSection(ArrayNodeDefinition $rootNode, callable $willBe ->scalarNode('default_memcached_provider')->defaultValue('memcached://localhost')->end() ->scalarNode('default_doctrine_dbal_provider')->defaultValue('database_connection')->end() ->scalarNode('default_pdo_provider')->defaultValue($willBeAvailable('doctrine/dbal', Connection::class) && class_exists(DoctrineAdapter::class) ? 'database_connection' : null)->end() - ->arrayNode('pools') + ->arrayNode('pools', 'pool') ->useAttributeAsKey('name') ->prototype('array') - ->fixXmlConfig('adapter') ->beforeNormalization() ->ifTrue(fn ($v) => isset($v['provider']) && \is_array($v['adapters'] ?? $v['adapter'] ?? null) && 1 < \count($v['adapters'] ?? $v['adapter'])) ->thenInvalid('Pool cannot have a "provider" while more than one adapter is defined') ->end() ->children() - ->arrayNode('adapters') + ->arrayNode('adapters', 'adapter') ->performNoDeepMerging() ->info('One or more adapters to chain for creating the pool, defaults to "cache.app".') ->beforeNormalization()->castToArray()->end() @@ -1444,9 +1394,8 @@ private function addExceptionsSection(ArrayNodeDefinition $rootNode): void $logLevels = (new \ReflectionClass(LogLevel::class))->getConstants(); $rootNode - ->fixXmlConfig('exception') ->children() - ->arrayNode('exceptions') + ->arrayNode('exceptions', 'exception') ->info('Exception handling configuration') ->useAttributeAsKey('class') ->prototype('array') @@ -1510,9 +1459,8 @@ private function addLockSection(ArrayNodeDefinition $rootNode, callable $enableI ->ifTrue(fn ($config) => $config['enabled'] && !$config['resources']) ->thenInvalid('At least one resource must be defined.') ->end() - ->fixXmlConfig('resource') ->children() - ->arrayNode('resources') + ->arrayNode('resources', 'resource') ->normalizeKeys(false) ->useAttributeAsKey('name') ->defaultValue(['default' => [class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock']]) @@ -1569,9 +1517,8 @@ private function addSemaphoreSection(ArrayNodeDefinition $rootNode, callable $en }) ->end() ->addDefaultsIfNotSet() - ->fixXmlConfig('resource') ->children() - ->arrayNode('resources') + ->arrayNode('resources', 'resource') ->normalizeKeys(false) ->useAttributeAsKey('name') ->requiresAtLeastOneElement() @@ -1619,9 +1566,6 @@ private function addMessengerSection(ArrayNodeDefinition $rootNode, callable $en ->arrayNode('messenger') ->info('Messenger configuration') ->{$enableIfStandalone('symfony/messenger', MessageBusInterface::class)}() - ->fixXmlConfig('transport') - ->fixXmlConfig('bus', 'buses') - ->fixXmlConfig('stop_worker_on_signal') ->validate() ->ifTrue(fn ($v) => isset($v['buses']) && \count($v['buses']) > 1 && null === $v['default_bus']) ->thenInvalid('You must specify the "default_bus" if you define more than one bus.') @@ -1696,7 +1640,7 @@ function ($a) { ->end() ->end() ->end() - ->arrayNode('transports') + ->arrayNode('transports', 'transport') ->normalizeKeys(false) ->useAttributeAsKey('name') ->arrayPrototype() @@ -1706,11 +1650,10 @@ function ($a) { return ['dsn' => $dsn]; }) ->end() - ->fixXmlConfig('option') ->children() ->scalarNode('dsn')->end() ->scalarNode('serializer')->defaultNull()->info('Service id of a custom serializer to use.')->end() - ->arrayNode('options') + ->arrayNode('options', 'option') ->normalizeKeys(false) ->defaultValue([]) ->prototype('variable') @@ -1751,7 +1694,7 @@ function ($a) { ->defaultNull() ->info('Transport name to send failed messages to (after all retries have failed).') ->end() - ->arrayNode('stop_worker_on_signals') + ->arrayNode('stop_worker_on_signals', 'stop_worker_on_signal') ->defaultValue([]) ->info('A list of signals that should stop the worker; defaults to SIGTERM and SIGINT.') ->beforeNormalization() @@ -1776,7 +1719,7 @@ function ($a) { ->scalarPrototype()->end() ->end() ->scalarNode('default_bus')->defaultNull()->end() - ->arrayNode('buses') + ->arrayNode('buses', 'bus') ->defaultValue(['messenger.bus.default' => ['default_middleware' => ['enabled' => true, 'allow_no_handlers' => false, 'allow_no_senders' => true], 'middleware' => []]]) ->normalizeKeys(false) ->useAttributeAsKey('name') @@ -1825,10 +1768,9 @@ function ($a) { ]; }) ->end() - ->fixXmlConfig('argument') ->children() ->scalarNode('id')->isRequired()->cannotBeEmpty()->end() - ->arrayNode('arguments') + ->arrayNode('arguments', 'argument') ->normalizeKeys(false) ->defaultValue([]) ->prototype('variable') @@ -1877,7 +1819,6 @@ private function addHttpClientSection(ArrayNodeDefinition $rootNode, callable $e ->arrayNode('http_client') ->info('HTTP Client configuration') ->{$enableIfStandalone('symfony/http-client', HttpClient::class)}() - ->fixXmlConfig('scoped_client') ->beforeNormalization() ->always(function ($config) { if (empty($config['scoped_clients'])) { @@ -1917,15 +1858,14 @@ private function addHttpClientSection(ArrayNodeDefinition $rootNode, callable $e ->info('The maximum number of connections to a single host.') ->end() ->arrayNode('default_options') - ->fixXmlConfig('header') ->children() - ->arrayNode('headers') + ->arrayNode('headers', 'header') ->info('Associative array: header => value(s).') ->useAttributeAsKey('name') ->normalizeKeys(false) ->variablePrototype()->end() ->end() - ->arrayNode('vars') + ->arrayNode('vars', 'var') ->info('Associative array: the default vars used to expand the templated URI.') ->normalizeKeys(false) ->variablePrototype()->end() @@ -2020,11 +1960,10 @@ private function addHttpClientSection(ArrayNodeDefinition $rootNode, callable $e ->scalarNode('mock_response_factory') ->info('The id of the service that should generate mock responses. It should be either an invokable or an iterable.') ->end() - ->arrayNode('scoped_clients') + ->arrayNode('scoped_clients', 'scoped_client') ->useAttributeAsKey('name') ->normalizeKeys(false) ->arrayPrototype() - ->fixXmlConfig('header') ->beforeNormalization() ->always() ->then(function ($config) { @@ -2079,7 +2018,7 @@ private function addHttpClientSection(ArrayNodeDefinition $rootNode, callable $e ->normalizeKeys(false) ->scalarPrototype()->end() ->end() - ->arrayNode('headers') + ->arrayNode('headers', 'header') ->info('Associative array: header => value(s).') ->useAttributeAsKey('name') ->normalizeKeys(false) @@ -2185,7 +2124,6 @@ private function createHttpClientRetrySection(): ArrayNodeDefinition return $root ->arrayNode('retry_failed') - ->fixXmlConfig('http_code') ->canBeEnabled() ->addDefaultsIfNotSet() ->beforeNormalization() @@ -2199,7 +2137,7 @@ private function createHttpClientRetrySection(): ArrayNodeDefinition ->end() ->children() ->scalarNode('retry_strategy')->defaultNull()->info('service id to override the retry strategy.')->end() - ->arrayNode('http_codes') + ->arrayNode('http_codes', 'http_code') ->performNoDeepMerging() ->beforeNormalization() ->ifArray() @@ -2224,10 +2162,9 @@ private function createHttpClientRetrySection(): ArrayNodeDefinition ->end() ->useAttributeAsKey('code') ->arrayPrototype() - ->fixXmlConfig('method') ->children() ->integerNode('code')->end() - ->arrayNode('methods') + ->arrayNode('methods', 'method') ->beforeNormalization() ->ifArray() ->then(fn ($v) => array_map('strtoupper', $v)) @@ -2259,22 +2196,18 @@ private function addMailerSection(ArrayNodeDefinition $rootNode, callable $enabl ->ifTrue(fn ($v) => isset($v['dsn']) && \count($v['transports'])) ->thenInvalid('"dsn" and "transports" cannot be used together.') ->end() - ->fixXmlConfig('transport') - ->fixXmlConfig('header') ->children() ->scalarNode('message_bus')->defaultNull()->info('The message bus to use. Defaults to the default bus if the Messenger component is installed.')->end() ->scalarNode('dsn')->defaultNull()->end() - ->arrayNode('transports') + ->arrayNode('transports', 'transport') ->useAttributeAsKey('name') ->prototype('scalar')->end() ->end() ->arrayNode('envelope') ->info('Mailer Envelope configuration') - ->fixXmlConfig('recipient') - ->fixXmlConfig('allowed_recipient') ->children() ->scalarNode('sender')->end() - ->arrayNode('recipients') + ->arrayNode('recipients', 'recipient') ->performNoDeepMerging() ->beforeNormalization() ->ifArray() @@ -2282,7 +2215,7 @@ private function addMailerSection(ArrayNodeDefinition $rootNode, callable $enabl ->end() ->prototype('scalar')->end() ->end() - ->arrayNode('allowed_recipients') + ->arrayNode('allowed_recipients', 'allowed_recipient') ->info('A list of regular expressions that allow recipients when "recipients" option is defined.') ->example(['.*@example\.com']) ->performNoDeepMerging() @@ -2294,7 +2227,7 @@ private function addMailerSection(ArrayNodeDefinition $rootNode, callable $enabl ->end() ->end() ->end() - ->arrayNode('headers') + ->arrayNode('headers', 'header') ->normalizeKeys(false) ->useAttributeAsKey('name') ->prototype('array') @@ -2310,7 +2243,6 @@ private function addMailerSection(ArrayNodeDefinition $rootNode, callable $enabl ->end() ->arrayNode('dkim_signer') ->addDefaultsIfNotSet() - ->fixXmlConfig('option') ->canBeEnabled() ->info('DKIM signer configuration') ->children() @@ -2325,7 +2257,7 @@ private function addMailerSection(ArrayNodeDefinition $rootNode, callable $enabl ->info('The private key passphrase') ->defaultValue('') ->end() - ->arrayNode('options') + ->arrayNode('options', 'option') ->performNoDeepMerging() ->normalizeKeys(false) ->useAttributeAsKey('name') @@ -2405,25 +2337,15 @@ private function addNotifierSection(ArrayNodeDefinition $rootNode, callable $ena ->{$enableIfStandalone('symfony/notifier', Notifier::class)}() ->children() ->scalarNode('message_bus')->defaultNull()->info('The message bus to use. Defaults to the default bus if the Messenger component is installed.')->end() - ->end() - ->fixXmlConfig('chatter_transport') - ->children() - ->arrayNode('chatter_transports') + ->arrayNode('chatter_transports', 'chatter_transport') ->useAttributeAsKey('name') ->prototype('scalar')->end() ->end() - ->end() - ->fixXmlConfig('texter_transport') - ->children() - ->arrayNode('texter_transports') + ->arrayNode('texter_transports', 'texter_transport') ->useAttributeAsKey('name') ->prototype('scalar')->end() ->end() - ->end() - ->children() ->booleanNode('notification_on_failed_messages')->defaultFalse()->end() - ->end() - ->children() ->arrayNode('channel_policy') ->useAttributeAsKey('name') ->prototype('array') @@ -2431,10 +2353,7 @@ private function addNotifierSection(ArrayNodeDefinition $rootNode, callable $ena ->prototype('scalar')->end() ->end() ->end() - ->end() - ->fixXmlConfig('admin_recipient') - ->children() - ->arrayNode('admin_recipients') + ->arrayNode('admin_recipients', 'admin_recipient') ->prototype('array') ->children() ->scalarNode('email')->cannotBeEmpty()->end() @@ -2496,7 +2415,6 @@ private function addRateLimiterSection(ArrayNodeDefinition $rootNode, callable $ ->arrayNode('rate_limiter') ->info('Rate limiter configuration') ->{$enableIfStandalone('symfony/rate-limiter', TokenBucketLimiter::class)}() - ->fixXmlConfig('limiter') ->beforeNormalization() ->ifTrue(fn ($v) => \is_array($v) && !isset($v['limiters']) && !isset($v['limiter'])) ->then(function (array $v) { @@ -2511,7 +2429,7 @@ private function addRateLimiterSection(ArrayNodeDefinition $rootNode, callable $ }) ->end() ->children() - ->arrayNode('limiters') + ->arrayNode('limiters', 'limiter') ->useAttributeAsKey('name') ->arrayPrototype() ->children() @@ -2532,7 +2450,7 @@ private function addRateLimiterSection(ArrayNodeDefinition $rootNode, callable $ ->isRequired() ->values(['fixed_window', 'token_bucket', 'sliding_window', 'compound', 'no_limit']) ->end() - ->arrayNode('limiters') + ->arrayNode('limiters', 'limiter') ->info('The limiter names to use when using the "compound" policy.') ->beforeNormalization()->castToArray()->end() ->scalarPrototype()->end() @@ -2554,7 +2472,7 @@ private function addRateLimiterSection(ArrayNodeDefinition $rootNode, callable $ ->end() ->end() ->validate() - ->ifTrue(static fn ($v) => !\in_array($v['policy'], ['no_limit', 'compound']) && !isset($v['limit'])) + ->ifTrue(static fn ($v) => !\in_array($v['policy'], ['no_limit', 'compound'], true) && !isset($v['limit'])) ->thenInvalid('A limit must be provided when using a policy different than "compound" or "no_limit".') ->end() ->end() @@ -2605,23 +2523,10 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable ->arrayNode('html_sanitizer') ->info('HtmlSanitizer configuration') ->{$enableIfStandalone('symfony/html-sanitizer', HtmlSanitizerInterface::class)}() - ->fixXmlConfig('sanitizer') ->children() - ->arrayNode('sanitizers') + ->arrayNode('sanitizers', 'sanitizer') ->useAttributeAsKey('name') ->arrayPrototype() - ->fixXmlConfig('allow_element') - ->fixXmlConfig('block_element') - ->fixXmlConfig('drop_element') - ->fixXmlConfig('allow_attribute') - ->fixXmlConfig('drop_attribute') - ->fixXmlConfig('force_attribute') - ->fixXmlConfig('allowed_link_scheme') - ->fixXmlConfig('allowed_link_host') - ->fixXmlConfig('allowed_media_scheme') - ->fixXmlConfig('allowed_media_host') - ->fixXmlConfig('with_attribute_sanitizer') - ->fixXmlConfig('without_attribute_sanitizer') ->children() ->booleanNode('allow_safe_elements') ->info('Allows "safe" elements and attributes.') @@ -2631,7 +2536,7 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable ->info('Allows all static elements and attributes from the W3C Sanitizer API standard.') ->defaultFalse() ->end() - ->arrayNode('allow_elements') + ->arrayNode('allow_elements', 'allow_element') ->info('Configures the elements that the sanitizer should retain from the input. The element name is the key, the value is either a list of allowed attributes for this element or "*" to allow the default set of attributes (https://wicg.github.io/sanitizer-api/#default-configuration).') ->example(['i' => '*', 'a' => ['title'], 'span' => 'class']) ->normalizeKeys(false) @@ -2646,17 +2551,17 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable ->end() ->end() ->end() - ->arrayNode('block_elements') + ->arrayNode('block_elements', 'block_element') ->info('Configures elements as blocked. Blocked elements are elements the sanitizer should remove from the input, but retain their children.') ->beforeNormalization()->castToArray()->end() ->scalarPrototype()->end() ->end() - ->arrayNode('drop_elements') + ->arrayNode('drop_elements', 'drop_element') ->info('Configures elements as dropped. Dropped elements are elements the sanitizer should remove from the input, including their children.') ->beforeNormalization()->castToArray()->end() ->scalarPrototype()->end() ->end() - ->arrayNode('allow_attributes') + ->arrayNode('allow_attributes', 'allow_attribute') ->info('Configures attributes as allowed. Allowed attributes are attributes the sanitizer should retain from the input.') ->normalizeKeys(false) ->useAttributeAsKey('name') @@ -2666,7 +2571,7 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable ->end() ->end() ->end() - ->arrayNode('drop_attributes') + ->arrayNode('drop_attributes', 'drop_attribute') ->info('Configures attributes as dropped. Dropped attributes are attributes the sanitizer should remove from the input.') ->normalizeKeys(false) ->useAttributeAsKey('name') @@ -2676,7 +2581,7 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable ->end() ->end() ->end() - ->arrayNode('force_attributes') + ->arrayNode('force_attributes', 'force_attribute') ->info('Forcefully set the values of certain attributes on certain elements.') ->normalizeKeys(false) ->useAttributeAsKey('name') @@ -2690,45 +2595,39 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable ->info('Transforms URLs using the HTTP scheme to use the HTTPS scheme instead.') ->defaultFalse() ->end() - ->arrayNode('allowed_link_schemes') + ->arrayNode('allowed_link_schemes', 'allowed_link_scheme') ->info('Allows only a given list of schemes to be used in links href attributes.') - ->scalarPrototype()->end() + ->stringPrototype()->end() ->end() - ->variableNode('allowed_link_hosts') + ->arrayNode('allowed_link_hosts', 'allowed_link_host') ->info('Allows only a given list of hosts to be used in links href attributes.') - ->defaultValue(null) - ->validate() - ->ifTrue(fn ($v) => !\is_array($v) && null !== $v) - ->thenInvalid('The "allowed_link_hosts" parameter must be an array or null') - ->end() + ->defaultNull() + ->stringPrototype()->end() ->end() ->booleanNode('allow_relative_links') ->info('Allows relative URLs to be used in links href attributes.') ->defaultFalse() ->end() - ->arrayNode('allowed_media_schemes') + ->arrayNode('allowed_media_schemes', 'allowed_media_scheme') ->info('Allows only a given list of schemes to be used in media source attributes (img, audio, video, ...).') - ->scalarPrototype()->end() + ->stringPrototype()->end() ->end() - ->variableNode('allowed_media_hosts') + ->arrayNode('allowed_media_hosts', 'allowed_media_host') ->info('Allows only a given list of hosts to be used in media source attributes (img, audio, video, ...).') - ->defaultValue(null) - ->validate() - ->ifTrue(fn ($v) => !\is_array($v) && null !== $v) - ->thenInvalid('The "allowed_media_hosts" parameter must be an array or null') - ->end() + ->defaultNull() + ->stringPrototype()->end() ->end() ->booleanNode('allow_relative_medias') ->info('Allows relative URLs to be used in media source attributes (img, audio, video, ...).') ->defaultFalse() ->end() - ->arrayNode('with_attribute_sanitizers') + ->arrayNode('with_attribute_sanitizers', 'with_attribute_sanitizer') ->info('Registers custom attribute sanitizers.') - ->scalarPrototype()->end() + ->stringPrototype()->end() ->end() - ->arrayNode('without_attribute_sanitizers') + ->arrayNode('without_attribute_sanitizers', 'without_attribute_sanitizer') ->info('Unregisters custom attribute sanitizers.') - ->scalarPrototype()->end() + ->stringPrototype()->end() ->end() ->integerNode('max_input_length') ->info('The maximum length allowed for the sanitized input.') diff --git a/DependencyInjection/FrameworkExtension.php b/DependencyInjection/FrameworkExtension.php index 66af2771b..2f8a7ee21 100644 --- a/DependencyInjection/FrameworkExtension.php +++ b/DependencyInjection/FrameworkExtension.php @@ -33,18 +33,16 @@ use Symfony\Bundle\FrameworkBundle\Routing\RouteLoaderInterface; use Symfony\Bundle\FullStack; use Symfony\Bundle\MercureBundle\MercureBundle; +use Symfony\Component\Asset\Package; use Symfony\Component\Asset\PackageInterface; use Symfony\Component\AssetMapper\AssetMapper; use Symfony\Component\AssetMapper\Compiler\AssetCompilerInterface; -use Symfony\Component\AssetMapper\Compressor\CompressorInterface; use Symfony\Component\BrowserKit\AbstractBrowser; use Symfony\Component\Cache\Adapter\AdapterInterface; use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Cache\Adapter\ChainAdapter; use Symfony\Component\Cache\Adapter\TagAwareAdapter; use Symfony\Component\Cache\DependencyInjection\CachePoolPass; -use Symfony\Component\Cache\Marshaller\MarshallerInterface; -use Symfony\Component\Cache\ResettableInterface; use Symfony\Component\Clock\ClockInterface; use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\FileLocator; @@ -55,13 +53,10 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\DataCollector\CommandDataCollector; -use Symfony\Component\Console\Debug\CliRequest; use Symfony\Component\Console\Messenger\RunCommandMessageHandler; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; -use Symfony\Component\DependencyInjection\Attribute\Target; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; @@ -83,7 +78,6 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Glob; -use Symfony\Component\Form\Extension\HtmlSanitizer\Type\TextTypeHtmlSanitizerExtension; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormTypeExtensionInterface; use Symfony\Component\Form\FormTypeGuesserInterface; @@ -91,7 +85,6 @@ use Symfony\Component\HtmlSanitizer\HtmlSanitizer; use Symfony\Component\HtmlSanitizer\HtmlSanitizerConfig; use Symfony\Component\HtmlSanitizer\HtmlSanitizerInterface; -use Symfony\Component\HttpClient\Messenger\PingWebhookMessageHandler; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\HttpClient\Retry\GenericRetryStrategy; use Symfony\Component\HttpClient\RetryableHttpClient; @@ -107,7 +100,6 @@ use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\HttpKernel\Log\DebugLoggerConfigurator; -use Symfony\Component\HttpKernel\Profiler\ProfilerStateChecker; use Symfony\Component\JsonStreamer\Attribute\JsonStreamable; use Symfony\Component\JsonStreamer\JsonStreamWriter; use Symfony\Component\JsonStreamer\StreamReaderInterface; @@ -119,20 +111,14 @@ use Symfony\Component\Lock\Store\StoreFactory; use Symfony\Component\Mailer\Bridge as MailerBridge; use Symfony\Component\Mailer\Command\MailerTestCommand; -use Symfony\Component\Mailer\EventListener\DkimSignedMessageListener; -use Symfony\Component\Mailer\EventListener\MessengerTransportListener; -use Symfony\Component\Mailer\EventListener\SmimeEncryptedMessageListener; -use Symfony\Component\Mailer\EventListener\SmimeSignedMessageListener; use Symfony\Component\Mailer\Mailer; use Symfony\Component\Mercure\HubRegistry; use Symfony\Component\Messenger\Attribute\AsMessage; use Symfony\Component\Messenger\Attribute\AsMessageHandler; use Symfony\Component\Messenger\Bridge as MessengerBridge; -use Symfony\Component\Messenger\EventListener\ResetMemoryUsageListener; use Symfony\Component\Messenger\Handler\BatchHandlerInterface; use Symfony\Component\Messenger\MessageBus; use Symfony\Component\Messenger\MessageBusInterface; -use Symfony\Component\Messenger\Middleware\DeduplicateMiddleware; use Symfony\Component\Messenger\Middleware\RouterContextMiddleware; use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface; use Symfony\Component\Messenger\Transport\TransportFactoryInterface as MessengerTransportFactoryInterface; @@ -164,7 +150,6 @@ use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; use Symfony\Component\RateLimiter\CompoundRateLimiterFactory; use Symfony\Component\RateLimiter\LimiterInterface; -use Symfony\Component\RateLimiter\RateLimiterFactory; use Symfony\Component\RateLimiter\RateLimiterFactoryInterface; use Symfony\Component\RateLimiter\Storage\CacheStorage; use Symfony\Component\RemoteEvent\Attribute\AsRemoteEventConsumer; @@ -174,23 +159,22 @@ use Symfony\Component\Scheduler\Attribute\AsPeriodicTask; use Symfony\Component\Scheduler\Attribute\AsSchedule; use Symfony\Component\Scheduler\Messenger\SchedulerTransportFactory; -use Symfony\Component\Scheduler\Messenger\Serializer\Normalizer\SchedulerTriggerNormalizer; use Symfony\Component\Security\Core\AuthenticationEvents; use Symfony\Component\Security\Core\Exception\AuthenticationException; +use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; use Symfony\Component\Semaphore\PersistingStoreInterface as SemaphoreStoreInterface; use Symfony\Component\Semaphore\Semaphore; use Symfony\Component\Semaphore\SemaphoreFactory; use Symfony\Component\Semaphore\Store\StoreFactory as SemaphoreStoreFactory; +use Symfony\Component\Serializer\Attribute as SerializerMapping; +use Symfony\Component\Serializer\Attribute\ExtendsSerializationFor; use Symfony\Component\Serializer\Encoder\DecoderInterface; use Symfony\Component\Serializer\Encoder\EncoderInterface; -use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader; use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader; use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader; -use Symfony\Component\Serializer\NameConverter\SnakeCaseToCamelCaseNameConverter; use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; -use Symfony\Component\Serializer\Normalizer\NumberNormalizer; use Symfony\Component\Serializer\Serializer; use Symfony\Component\Stopwatch\Stopwatch; use Symfony\Component\String\LazyString; @@ -198,7 +182,6 @@ use Symfony\Component\Translation\Bridge as TranslationBridge; use Symfony\Component\Translation\Command\TranslationLintCommand as BaseTranslationLintCommand; use Symfony\Component\Translation\Command\XliffLintCommand as BaseXliffLintCommand; -use Symfony\Component\Translation\Extractor\PhpAstExtractor; use Symfony\Component\Translation\LocaleSwitcher; use Symfony\Component\Translation\PseudoLocalizationTranslator; use Symfony\Component\Translation\TranslatableMessage; @@ -209,6 +192,7 @@ use Symfony\Component\TypeInfo\TypeResolver\TypeResolverInterface; use Symfony\Component\Uid\Factory\UuidFactory; use Symfony\Component\Uid\UuidV4; +use Symfony\Component\Validator\Attribute\ExtendsValidationFor; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraints\ExpressionLanguageProvider; use Symfony\Component\Validator\ConstraintValidatorInterface; @@ -303,10 +287,6 @@ public function load(array $configs, ContainerBuilder $container): void // Load Cache configuration first as it is used by other components $loader->load('cache.php'); - if (!interface_exists(NamespacedPoolInterface::class)) { - $container->removeAlias(NamespacedPoolInterface::class); - } - $configuration = $this->getConfiguration($configs, $container); $config = $this->processConfiguration($configuration, $configs); @@ -389,7 +369,7 @@ public function load(array $configs, ContainerBuilder $container): void } if ($this->readConfigEnabled('assets', $container, $config['assets'])) { - if (!class_exists(\Symfony\Component\Asset\Package::class)) { + if (!class_exists(Package::class)) { throw new LogicException('Asset support cannot be enabled as the Asset component is not installed. Try running "composer require symfony/asset".'); } @@ -465,7 +445,7 @@ public function load(array $configs, ContainerBuilder $container): void } if ($typeInfoEnabled = $this->readConfigEnabled('type_info', $container, $config['type_info'])) { - $this->registerTypeInfoConfiguration($container, $loader); + $this->registerTypeInfoConfiguration($config['type_info'], $container, $loader); } if ($propertyInfoEnabled) { @@ -552,7 +532,7 @@ public function load(array $configs, ContainerBuilder $container): void $container->removeDefinition('form.type_extension.form.validator'); $container->removeDefinition('form.type_guesser.validator'); } - if (!$this->readConfigEnabled('html_sanitizer', $container, $config['html_sanitizer']) || !class_exists(TextTypeHtmlSanitizerExtension::class)) { + if (!$this->readConfigEnabled('html_sanitizer', $container, $config['html_sanitizer'])) { $container->removeDefinition('form.type_extension.form.html_sanitizer'); } } else { @@ -587,26 +567,6 @@ public function load(array $configs, ContainerBuilder $container): void $container->removeDefinition('console.command.messenger_failed_messages_show'); $container->removeDefinition('console.command.messenger_failed_messages_remove'); $container->removeDefinition('cache.messenger.restart_workers_signal'); - - if ($container->hasDefinition('messenger.transport.amqp.factory') && !class_exists(MessengerBridge\Amqp\Transport\AmqpTransportFactory::class)) { - if (class_exists(\Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransportFactory::class)) { - $container->getDefinition('messenger.transport.amqp.factory') - ->setClass(\Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransportFactory::class) - ->addTag('messenger.transport_factory'); - } else { - $container->removeDefinition('messenger.transport.amqp.factory'); - } - } - - if ($container->hasDefinition('messenger.transport.redis.factory') && !class_exists(MessengerBridge\Redis\Transport\RedisTransportFactory::class)) { - if (class_exists(\Symfony\Component\Messenger\Transport\RedisExt\RedisTransportFactory::class)) { - $container->getDefinition('messenger.transport.redis.factory') - ->setClass(\Symfony\Component\Messenger\Transport\RedisExt\RedisTransportFactory::class) - ->addTag('messenger.transport_factory'); - } else { - $container->removeDefinition('messenger.transport.redis.factory'); - } - } } // notifier depends on messenger, mailer being registered @@ -704,12 +664,6 @@ public function load(array $configs, ContainerBuilder $container): void ->addTag('kernel.locale_aware'); $container->registerForAutoconfiguration(ResetInterface::class) ->addTag('kernel.reset', ['method' => 'reset']); - - if (!interface_exists(MarshallerInterface::class)) { - $container->registerForAutoconfiguration(ResettableInterface::class) - ->addTag('kernel.reset', ['method' => 'reset']); - } - $container->registerForAutoconfiguration(PropertyListExtractorInterface::class) ->addTag('property_info.list_extractor'); $container->registerForAutoconfiguration(PropertyTypeExtractorInterface::class) @@ -759,7 +713,7 @@ public function load(array $configs, ContainerBuilder $container): void $definition->addTag('controller.service_arguments'); }); $container->registerAttributeForAutoconfiguration(Route::class, static function (ChildDefinition $definition, Route $attribute, \ReflectionClass|\ReflectionMethod $reflection): void { - $definition->addTag('controller.service_arguments'); + $definition->addTag('controller.service_arguments')->addTag('routing.controller'); }); $container->registerAttributeForAutoconfiguration(AsRemoteEventConsumer::class, static function (ChildDefinition $definition, AsRemoteEventConsumer $attribute): void { $definition->addTag('remote_event.consumer', ['consumer' => $attribute->name]); @@ -969,11 +923,6 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $ $loader->load('collectors.php'); $loader->load('cache_debug.php'); - if (!class_exists(ProfilerStateChecker::class)) { - $container->removeDefinition('profiler.state_checker'); - $container->removeDefinition('profiler.is_disabled_state_checker'); - } - if ($this->isInitializedConfigEnabled('form')) { $loader->load('form_debug.php'); } @@ -1008,11 +957,7 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $ $loader->load('notifier_debug.php'); } - if (false === $config['collect_serializer_data']) { - trigger_deprecation('symfony/framework-bundle', '7.3', 'Setting the "framework.profiler.collect_serializer_data" config option to "false" is deprecated.'); - } - - if ($this->isInitializedConfigEnabled('serializer') && $config['collect_serializer_data']) { + if ($this->isInitializedConfigEnabled('serializer')) { $loader->load('serializer_debug.php'); } @@ -1034,13 +979,9 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $ $container->getDefinition('profiler_listener') ->addArgument($config['collect_parameter']); - if (!$container->getParameter('kernel.debug') || !class_exists(CliRequest::class) || !$container->has('debug.stopwatch')) { + if (!$container->getParameter('kernel.debug') || !$container->has('debug.stopwatch')) { $container->removeDefinition('console_profiler_listener'); } - - if (!class_exists(CommandDataCollector::class)) { - $container->removeDefinition('.data_collector.command'); - } } private function registerWorkflowConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void @@ -1184,8 +1125,7 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $ // Store to container $container->setDefinition($workflowId, $workflowDefinition); $container->setDefinition($definitionDefinitionId, $definitionDefinition); - $container->registerAliasForArgument($workflowId, WorkflowInterface::class, $name.'.'.$type); - $container->registerAliasForArgument($workflowId, WorkflowInterface::class, $name); + $container->registerAliasForArgument($workflowId, WorkflowInterface::class, $name.'.'.$type, $name); // Add workflow to Registry if ($workflow['supports']) { @@ -1313,7 +1253,7 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co } $container->setParameter('router.resource', $config['resource']); - $container->setParameter('router.cache_dir', $config['cache_dir']); + $container->setParameter('router.cache_dir', '%kernel.build_dir%'); $router = $container->findDefinition('router.default'); $argument = $router->getArgument(2); $argument['strict_requirements'] = $config['strict_requirements']; @@ -1339,7 +1279,7 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c $container->setAlias('session.storage.factory', $config['storage_factory_id']); $options = ['cache_limiter' => '0']; - foreach (['name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'cookie_samesite', 'use_cookies', 'gc_maxlifetime', 'gc_probability', 'gc_divisor', 'sid_length', 'sid_bits_per_character'] as $key) { + foreach (['name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'cookie_samesite', 'use_cookies', 'gc_maxlifetime', 'gc_probability', 'gc_divisor'] as $key) { if (isset($config[$key])) { $options[$key] = $config[$key]; } @@ -1420,7 +1360,7 @@ private function registerAssetsConfiguration(array $config, ContainerBuilder $co $packageDefinition = $this->createPackageDefinition($package['base_path'], $package['base_urls'], $version) ->addTag('assets.package', ['package' => $name]); $container->setDefinition('assets._package_'.$name, $packageDefinition); - $container->registerAliasForArgument('assets._package_'.$name, PackageInterface::class, $name.'.package'); + $container->registerAliasForArgument('assets._package_'.$name, PackageInterface::class, $name.'.package', $name); } } @@ -1500,24 +1440,19 @@ private function registerAssetMapperConfiguration(array $config, ContainerBuilde ->replaceArgument(4, $config['importmap_script_attributes']) ; - if (interface_exists(CompressorInterface::class)) { - $compressors = []; - foreach ($config['precompress']['formats'] as $format) { - $compressors[$format] = new Reference("asset_mapper.compressor.$format"); - } + $compressors = []; + foreach ($config['precompress']['formats'] as $format) { + $compressors[$format] = new Reference("asset_mapper.compressor.$format"); + } - $container->getDefinition('asset_mapper.compressor')->replaceArgument(0, $compressors ?: null); + $container->getDefinition('asset_mapper.compressor')->replaceArgument(0, $compressors ?: null); - if ($config['precompress']['enabled']) { - $container - ->getDefinition('asset_mapper.local_public_assets_filesystem') - ->addArgument(new Reference('asset_mapper.compressor')) - ->addArgument($config['precompress']['extensions']) - ; - } - } else { - $container->removeDefinition('asset_mapper.compressor'); - $container->removeDefinition('asset_mapper.assets.command.compress'); + if ($config['precompress']['enabled']) { + $container + ->getDefinition('asset_mapper.local_public_assets_filesystem') + ->addArgument(new Reference('asset_mapper.compressor')) + ->addArgument($config['precompress']['extensions']) + ; } } @@ -1584,7 +1519,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder } // don't use ContainerBuilder::willBeAvailable() as these are not needed in production - if (interface_exists(Parser::class) && class_exists(PhpAstExtractor::class)) { + if (interface_exists(Parser::class)) { $container->removeDefinition('translation.extractor.php'); } else { $container->removeDefinition('translation.extractor.php_ast'); @@ -1783,22 +1718,37 @@ private function registerValidationConfiguration(array $config, ContainerBuilder $files = ['xml' => [], 'yml' => []]; $this->registerValidatorMapping($container, $config, $files); - if (!empty($files['xml'])) { + if ($files['xml']) { $validatorBuilder->addMethodCall('addXmlMappings', [$files['xml']]); } - if (!empty($files['yml'])) { + if ($files['yml']) { $validatorBuilder->addMethodCall('addYamlMappings', [$files['yml']]); } $definition = $container->findDefinition('validator.email'); $definition->replaceArgument(0, $config['email_validation_mode']); - if (\array_key_exists('enable_attributes', $config) && $config['enable_attributes']) { + // When attributes are disabled, it means from runtime-discovery only; autoconfiguration should still happen. + // And when runtime-discovery of attributes is enabled, we can skip compile-time autoconfiguration in debug mode. + if (!($config['enable_attributes'] ?? false) || !$container->getParameter('kernel.debug')) { + // The $reflector argument hints at where the attribute could be used + $container->registerAttributeForAutoconfiguration(Constraint::class, function (ChildDefinition $definition, Constraint $attribute, \ReflectionClass|\ReflectionMethod|\ReflectionProperty $reflector) { + $definition->addTag('validator.attribute_metadata') + ->addTag('container.excluded', ['source' => 'because it\'s a validator constraint extension']); + }); + } + + $container->registerAttributeForAutoconfiguration(ExtendsValidationFor::class, function (ChildDefinition $definition, ExtendsValidationFor $attribute) { + $definition->addTag('validator.attribute_metadata', ['for' => $attribute->class]) + ->addTag('container.excluded', ['source' => 'because it\'s a validator constraint extension']); + }); + + if ($config['enable_attributes'] ?? false) { $validatorBuilder->addMethodCall('enableAttributeMapping'); } - if (\array_key_exists('static_method', $config) && $config['static_method']) { + if ($config['static_method'] ?? false) { foreach ($config['static_method'] as $methodName) { $validatorBuilder->addMethodCall('addMethodMapping', [$methodName]); } @@ -1837,9 +1787,8 @@ private function registerValidatorMapping(ContainerBuilder $container, array $co $files['yaml' === $extension ? 'yml' : $extension][] = $path; }; - if (ContainerBuilder::willBeAvailable('symfony/form', Form::class, ['symfony/framework-bundle', 'symfony/validator'])) { - $reflClass = new \ReflectionClass(Form::class); - $fileRecorder('xml', \dirname($reflClass->getFileName()).'/Resources/config/validation.xml'); + if (!ContainerBuilder::willBeAvailable('symfony/form', Form::class, ['symfony/framework-bundle', 'symfony/validator'])) { + $container->removeDefinition('validator.form.attribute_metadata'); } foreach ($container->getParameter('kernel.bundles_metadata') as $bundle) { @@ -1967,7 +1916,7 @@ private function registerSecurityCsrfConfiguration(array $config, ContainerBuild return; } - if (!class_exists(\Symfony\Component\Security\Csrf\CsrfToken::class)) { + if (!class_exists(CsrfToken::class)) { throw new LogicException('CSRF support cannot be enabled as the Security CSRF component is not installed. Try running "composer require symfony/security-csrf".'); } if (!$config['stateless_token_ids'] && !$this->isInitializedConfigEnabled('session')) { @@ -2023,16 +1972,6 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder $container->removeDefinition('serializer.normalizer.mime_message'); } - // BC layer Serializer < 7.3 - if (!class_exists(NumberNormalizer::class)) { - $container->removeDefinition('serializer.normalizer.number'); - } - - // BC layer Serializer < 7.2 - if (!class_exists(SnakeCaseToCamelCaseNameConverter::class)) { - $container->removeDefinition('serializer.name_converter.snake_case_to_camel_case'); - } - if ($container->getParameter('kernel.debug')) { $container->removeDefinition('serializer.mapping.cache_class_metadata_factory'); } @@ -2042,14 +1981,37 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder } $serializerLoaders = []; - if (isset($config['enable_attributes']) && $config['enable_attributes']) { - $attributeLoader = new Definition(AttributeLoader::class); - $serializerLoaders[] = $attributeLoader; + // When attributes are disabled, it means from runtime-discovery only; autoconfiguration should still happen. + // And when runtime-discovery of attributes is enabled, we can skip compile-time autoconfiguration in debug mode. + if (!($config['enable_attributes'] ?? false) || !$container->getParameter('kernel.debug')) { + // The $reflector argument hints at where the attribute could be used + $configurator = function (ChildDefinition $definition, object $attribute, \ReflectionClass|\ReflectionMethod|\ReflectionProperty $reflector) { + $definition->addTag('serializer.attribute_metadata'); + }; + $container->registerAttributeForAutoconfiguration(SerializerMapping\Context::class, $configurator); + $container->registerAttributeForAutoconfiguration(SerializerMapping\Groups::class, $configurator); + + $configurator = function (ChildDefinition $definition, object $attribute, \ReflectionMethod|\ReflectionProperty $reflector) { + $definition->addTag('serializer.attribute_metadata'); + }; + $container->registerAttributeForAutoconfiguration(SerializerMapping\Ignore::class, $configurator); + $container->registerAttributeForAutoconfiguration(SerializerMapping\MaxDepth::class, $configurator); + $container->registerAttributeForAutoconfiguration(SerializerMapping\SerializedName::class, $configurator); + $container->registerAttributeForAutoconfiguration(SerializerMapping\SerializedPath::class, $configurator); + + $container->registerAttributeForAutoconfiguration(SerializerMapping\DiscriminatorMap::class, function (ChildDefinition $definition) { + $definition->addTag('serializer.attribute_metadata'); + }); } + $serializerLoaders[] = new Reference('serializer.mapping.attribute_loader'); + + $container->getDefinition('serializer.mapping.attribute_loader') + ->replaceArgument(0, $config['enable_attributes'] ?? false); + $fileRecorder = function ($extension, $path) use (&$serializerLoaders) { - $definition = new Definition(\in_array($extension, ['yaml', 'yml']) ? YamlFileLoader::class : XmlFileLoader::class, [$path]); + $definition = new Definition(\in_array($extension, ['yaml', 'yml'], true) ? YamlFileLoader::class : XmlFileLoader::class, [$path]); $serializerLoaders[] = $definition; }; @@ -2082,7 +2044,7 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder $chainLoader->replaceArgument(0, $serializerLoaders); $container->getDefinition('serializer.mapping.cache_warmer')->replaceArgument(0, $serializerLoaders); - if (isset($config['name_converter']) && $config['name_converter']) { + if ($config['name_converter'] ?? false) { $container->setParameter('.serializer.name_converter', $config['name_converter']); $container->getDefinition('serializer.name_converter.metadata_aware')->setArgument(1, new Reference($config['name_converter'])); } @@ -2104,6 +2066,11 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder $container->getDefinition('serializer.normalizer.property')->setArgument(5, $defaultContext); $container->setParameter('.serializer.named_serializers', $config['named_serializers'] ?? []); + + $container->registerAttributeForAutoconfiguration(ExtendsSerializationFor::class, function (ChildDefinition $definition, ExtendsSerializationFor $attribute) { + $definition->addTag('serializer.attribute_metadata', ['for' => $attribute->class]) + ->addTag('container.excluded', ['source' => 'because it\'s a serializer metadata extension']); + }); } private function registerJsonStreamerConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void @@ -2122,11 +2089,6 @@ private function registerJsonStreamerConfiguration(array $config, ContainerBuild $container->setParameter('.json_streamer.stream_writers_dir', '%kernel.cache_dir%/json_streamer/stream_writer'); $container->setParameter('.json_streamer.stream_readers_dir', '%kernel.cache_dir%/json_streamer/stream_reader'); - $container->setParameter('.json_streamer.lazy_ghosts_dir', '%kernel.cache_dir%/json_streamer/lazy_ghost'); - - if (\PHP_VERSION_ID >= 80400) { - $container->removeDefinition('.json_streamer.cache_warmer.lazy_ghost'); - } } private function registerPropertyInfoConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void @@ -2162,7 +2124,7 @@ private function registerPropertyInfoConfiguration(array $config, ContainerBuild } } - private function registerTypeInfoConfiguration(ContainerBuilder $container, PhpFileLoader $loader): void + private function registerTypeInfoConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader): void { if (!class_exists(Type::class)) { throw new LogicException('TypeInfo support cannot be enabled as the TypeInfo component is not installed. Try running "composer require symfony/type-info".'); @@ -2171,7 +2133,8 @@ private function registerTypeInfoConfiguration(ContainerBuilder $container, PhpF $loader->load('type_info.php'); if (ContainerBuilder::willBeAvailable('phpstan/phpdoc-parser', PhpDocParser::class, ['symfony/framework-bundle', 'symfony/type-info'])) { - $container->register('type_info.resolver.string', StringTypeResolver::class); + $container->register('type_info.resolver.string', StringTypeResolver::class) + ->setArguments([null, null, $config['aliases']]); $container->register('type_info.resolver.reflection_parameter.phpdoc_aware', PhpDocAwareReflectionTypeResolver::class) ->setArguments([new Reference('type_info.resolver.reflection_parameter'), new Reference('type_info.resolver.string'), new Reference('type_info.type_context_factory')]); @@ -2188,6 +2151,8 @@ private function registerTypeInfoConfiguration(ContainerBuilder $container, PhpF \ReflectionProperty::class => new Reference('type_info.resolver.reflection_property.phpdoc_aware'), \ReflectionFunctionAbstract::class => new Reference('type_info.resolver.reflection_return.phpdoc_aware'), ] + $resolversLocator->getValues()); + + $container->getDefinition('type_info.type_context_factory')->replaceArgument(1, $config['aliases']); } } @@ -2241,7 +2206,7 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont $container->setAlias('lock.factory', new Alias('lock.'.$resourceName.'.factory', false)); $container->setAlias(LockFactory::class, new Alias('lock.factory', false)); } else { - $container->registerAliasForArgument('lock.'.$resourceName.'.factory', LockFactory::class, $resourceName.'.lock.factory'); + $container->registerAliasForArgument('lock.'.$resourceName.'.factory', LockFactory::class, $resourceName.'.lock.factory', $resourceName); } } } @@ -2276,7 +2241,7 @@ private function registerSemaphoreConfiguration(array $config, ContainerBuilder $container->setAlias('semaphore.factory', new Alias('semaphore.'.$resourceName.'.factory', false)); $container->setAlias(SemaphoreFactory::class, new Alias('semaphore.factory', false)); } else { - $container->registerAliasForArgument('semaphore.'.$resourceName.'.factory', SemaphoreFactory::class, $resourceName.'.semaphore.factory'); + $container->registerAliasForArgument('semaphore.'.$resourceName.'.factory', SemaphoreFactory::class, $resourceName.'.semaphore.factory', $resourceName); } } } @@ -2292,11 +2257,6 @@ private function registerSchedulerConfiguration(ContainerBuilder $container, Php if (!$this->hasConsole()) { $container->removeDefinition('console.command.scheduler_debug'); } - - // BC layer Scheduler < 7.3 - if (!ContainerBuilder::willBeAvailable('symfony/serializer', DenormalizerInterface::class, ['symfony/framework-bundle', 'symfony/scheduler']) || !class_exists(SchedulerTriggerNormalizer::class)) { - $container->removeDefinition('serializer.normalizer.scheduler_trigger'); - } } private function registerMessengerConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader, bool $validationEnabled, bool $lockEnabled): void @@ -2315,10 +2275,6 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder $container->removeDefinition('serializer.normalizer.flatten_exception'); } - if (!class_exists(ResetMemoryUsageListener::class)) { - $container->removeDefinition('messenger.listener.reset_memory_usage'); - } - if (ContainerBuilder::willBeAvailable('symfony/amqp-messenger', MessengerBridge\Amqp\Transport\AmqpTransportFactory::class, ['symfony/framework-bundle', 'symfony/messenger'])) { $container->getDefinition('messenger.transport.amqp.factory')->addTag('messenger.transport_factory'); } @@ -2348,6 +2304,7 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder $defaultMiddleware = [ 'before' => [ + ['id' => 'add_default_stamps_middleware'], ['id' => 'add_bus_name_stamp_middleware'], ['id' => 'reject_redelivered_message_middleware'], ['id' => 'dispatch_after_current_bus'], @@ -2359,7 +2316,7 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder ], ]; - if ($lockEnabled && class_exists(DeduplicateMiddleware::class) && class_exists(LockFactory::class)) { + if ($lockEnabled && class_exists(LockFactory::class)) { $defaultMiddleware['before'][] = ['id' => 'deduplicate_middleware']; } else { $container->removeDefinition('messenger.middleware.deduplicate_middleware'); @@ -2649,10 +2606,7 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con $container->registerAliasForArgument($tagAwareId, TagAwareCacheInterface::class, $pool['name'] ?? $name); $container->registerAliasForArgument($name, CacheInterface::class, $pool['name'] ?? $name); $container->registerAliasForArgument($name, CacheItemPoolInterface::class, $pool['name'] ?? $name); - - if (interface_exists(NamespacedPoolInterface::class)) { - $container->registerAliasForArgument($name, NamespacedPoolInterface::class, $pool['name'] ?? $name); - } + $container->registerAliasForArgument($name, NamespacedPoolInterface::class, $pool['name'] ?? $name); } $definition->setPublic($pool['public']); @@ -2690,10 +2644,6 @@ private function registerHttpClientConfiguration(array $config, ContainerBuilder unset($options['vars']); $container->getDefinition('http_client.transport')->setArguments([$options, $config['max_host_connections'] ?? 6]); - if (!class_exists(PingWebhookMessageHandler::class)) { - $container->removeDefinition('http_client.messenger.ping_webhook_handler'); - } - if (!$hasPsr18 = ContainerBuilder::willBeAvailable('psr/http-client', ClientInterface::class, ['symfony/framework-bundle', 'symfony/http-client'])) { $container->removeDefinition('psr18.http_client'); $container->removeAlias(ClientInterface::class); @@ -2796,10 +2746,6 @@ private function registerHttpClientConfiguration(array $config, ContainerBuilder private function registerThrottlingHttpClient(string $rateLimiter, string $name, ContainerBuilder $container): void { - if (!class_exists(ThrottlingHttpClient::class)) { - throw new LogicException('Rate limiter support cannot be enabled as version 7.1+ of the HttpClient component is required.'); - } - if (!$this->isInitializedConfigEnabled('rate_limiter')) { throw new LogicException('Rate limiter cannot be used within HttpClient as the RateLimiter component is not enabled.'); } @@ -2879,6 +2825,7 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co MailerBridge\Mailomat\Transport\MailomatTransportFactory::class => 'mailer.transport_factory.mailomat', MailerBridge\MailPace\Transport\MailPaceTransportFactory::class => 'mailer.transport_factory.mailpace', MailerBridge\Mailchimp\Transport\MandrillTransportFactory::class => 'mailer.transport_factory.mailchimp', + MailerBridge\MicrosoftGraph\Transport\MicrosoftGraphTransportFactory::class => 'mailer.transport_factory.microsoftgraph', MailerBridge\Postal\Transport\PostalTransportFactory::class => 'mailer.transport_factory.postal', MailerBridge\Postmark\Transport\PostmarkTransportFactory::class => 'mailer.transport_factory.postmark', MailerBridge\Mailtrap\Transport\MailtrapTransportFactory::class => 'mailer.transport_factory.mailtrap', @@ -2931,7 +2878,7 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co $headers = new Definition(Headers::class); foreach ($config['headers'] as $name => $data) { $value = $data['value']; - if (\in_array(strtolower($name), ['from', 'to', 'cc', 'bcc', 'reply-to'])) { + if (\in_array(strtolower($name), ['from', 'to', 'cc', 'bcc', 'reply-to'], true)) { $value = (array) $value; } $headers->addMethodCall('addHeader', [$name, $value]); @@ -2942,14 +2889,7 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co $container->removeDefinition('mailer.message_listener'); } - if (!class_exists(MessengerTransportListener::class)) { - $container->removeDefinition('mailer.messenger_transport_listener'); - } - if ($config['dkim_signer']['enabled']) { - if (!class_exists(DkimSignedMessageListener::class)) { - throw new LogicException('DKIM signed messages support cannot be enabled as this version of the Mailer component does not support it.'); - } $dkimSigner = $container->getDefinition('mailer.dkim_signer'); $dkimSigner->setArgument(0, $config['dkim_signer']['key']); $dkimSigner->setArgument(1, $config['dkim_signer']['domain']); @@ -2962,9 +2902,6 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co } if ($config['smime_signer']['enabled']) { - if (!class_exists(SmimeSignedMessageListener::class)) { - throw new LogicException('SMIME signed messages support cannot be enabled as this version of the Mailer component does not support it.'); - } $smimeSigner = $container->getDefinition('mailer.smime_signer'); $smimeSigner->setArgument(0, $config['smime_signer']['certificate']); $smimeSigner->setArgument(1, $config['smime_signer']['key']); @@ -2977,9 +2914,6 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co } if ($config['smime_encrypter']['enabled']) { - if (!class_exists(SmimeEncryptedMessageListener::class)) { - throw new LogicException('S/MIME encrypted messages support cannot be enabled as this version of the Mailer component does not support it.'); - } $container->setAlias('mailer.smime_encrypter.repository', $config['smime_encrypter']['repository']); $container->setParameter('mailer.smime_encrypter.cipher', $config['smime_encrypter']['cipher']); } else { @@ -3114,7 +3048,6 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $ NotifierBridge\Sevenio\SevenIoTransportFactory::class => 'notifier.transport_factory.sevenio', NotifierBridge\Sinch\SinchTransportFactory::class => 'notifier.transport_factory.sinch', NotifierBridge\Slack\SlackTransportFactory::class => 'notifier.transport_factory.slack', - NotifierBridge\Sms77\Sms77TransportFactory::class => 'notifier.transport_factory.sms77', NotifierBridge\Smsapi\SmsapiTransportFactory::class => 'notifier.transport_factory.smsapi', NotifierBridge\SmsBiuras\SmsBiurasTransportFactory::class => 'notifier.transport_factory.sms-biuras', NotifierBridge\Smsbox\SmsboxTransportFactory::class => 'notifier.transport_factory.smsbox', @@ -3298,21 +3231,7 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde $limiterConfig['id'] = $name; $limiter->replaceArgument(0, $limiterConfig); - $factoryAlias = $container->registerAliasForArgument($limiterId, RateLimiterFactory::class, $name.'.limiter'); - - if (interface_exists(RateLimiterFactoryInterface::class)) { - $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter'); - $factoryAlias->setDeprecated('symfony/framework-bundle', '7.3', \sprintf('The "%%alias_id%%" autowiring alias is deprecated and will be removed in 8.0, use "%s $%s" instead.', RateLimiterFactoryInterface::class, (new Target($name.'.limiter'))->getParsedName())); - $internalAliasId = \sprintf('.%s $%s.limiter', RateLimiterFactory::class, $name); - - if ($container->hasAlias($internalAliasId)) { - $container->getAlias($internalAliasId)->setDeprecated('symfony/framework-bundle', '7.3', \sprintf('The "%%alias_id%%" autowiring alias is deprecated and will be removed in 8.0, use "%s $%s" instead.', RateLimiterFactoryInterface::class, (new Target($name.'.limiter'))->getParsedName())); - } - } - } - - if ($compoundLimiters && !class_exists(CompoundRateLimiterFactory::class)) { - throw new LogicException('Configuring compound rate limiters is only available in symfony/rate-limiter 7.3+.'); + $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter', $name); } foreach ($compoundLimiters as $name => $limiterConfig) { @@ -3332,7 +3251,7 @@ private function registerRateLimiterConfiguration(array $config, ContainerBuilde ))) ; - $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter'); + $container->registerAliasForArgument($limiterId, RateLimiterFactoryInterface::class, $name.'.limiter', $name); } } diff --git a/FrameworkBundle.php b/FrameworkBundle.php index 300fe22fb..d8a6d8a4a 100644 --- a/FrameworkBundle.php +++ b/FrameworkBundle.php @@ -61,9 +61,11 @@ use Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoConstructorPass; use Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass; use Symfony\Component\Routing\DependencyInjection\AddExpressionLanguageProvidersPass; +use Symfony\Component\Routing\DependencyInjection\RoutingControllerPass; use Symfony\Component\Routing\DependencyInjection\RoutingResolverPass; use Symfony\Component\Runtime\SymfonyRuntime; use Symfony\Component\Scheduler\DependencyInjection\AddScheduleMessengerPass; +use Symfony\Component\Serializer\DependencyInjection\AttributeMetadataPass as SerializerAttributeMetadataPass; use Symfony\Component\Serializer\DependencyInjection\SerializerPass; use Symfony\Component\Translation\DependencyInjection\DataCollectorTranslatorPass; use Symfony\Component\Translation\DependencyInjection\LoggingTranslatorPass; @@ -74,6 +76,7 @@ use Symfony\Component\Validator\DependencyInjection\AddAutoMappingConfigurationPass; use Symfony\Component\Validator\DependencyInjection\AddConstraintValidatorsPass; use Symfony\Component\Validator\DependencyInjection\AddValidatorInitializersPass; +use Symfony\Component\Validator\DependencyInjection\AttributeMetadataPass; use Symfony\Component\VarExporter\Internal\Hydrator; use Symfony\Component\VarExporter\Internal\Registry; use Symfony\Component\Workflow\DependencyInjection\WorkflowDebugPass; @@ -103,8 +106,7 @@ public function boot(): void $_ENV['DOCTRINE_DEPRECATIONS'] = $_SERVER['DOCTRINE_DEPRECATIONS'] ??= 'trigger'; if (class_exists(SymfonyRuntime::class)) { - $handler = set_error_handler('var_dump'); - restore_error_handler(); + $handler = get_error_handler(); } else { $handler = [ErrorHandler::register(null, false)]; } @@ -147,6 +149,7 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass(new RegisterControllerArgumentLocatorsPass()); $container->addCompilerPass(new RemoveEmptyControllerArgumentLocatorsPass(), PassConfig::TYPE_BEFORE_REMOVING); $container->addCompilerPass(new RoutingResolverPass()); + $this->addCompilerPassIfExists($container, RoutingControllerPass::class); $this->addCompilerPassIfExists($container, DataCollectorTranslatorPass::class); $container->addCompilerPass(new ProfilerPass()); // must be registered before removing private services as some might be listeners/subscribers @@ -154,6 +157,7 @@ public function build(ContainerBuilder $container): void $container->addCompilerPass($registerListenersPass, PassConfig::TYPE_BEFORE_REMOVING); $this->addCompilerPassIfExists($container, AddConstraintValidatorsPass::class); $this->addCompilerPassIfExists($container, AddValidatorInitializersPass::class); + $this->addCompilerPassIfExists($container, AttributeMetadataPass::class); $this->addCompilerPassIfExists($container, AddConsoleCommandPass::class, PassConfig::TYPE_BEFORE_REMOVING); // must be registered before the AddConsoleCommandPass $container->addCompilerPass(new TranslationLintCommandPass(), PassConfig::TYPE_BEFORE_REMOVING, 10); @@ -167,6 +171,7 @@ public function build(ContainerBuilder $container): void $this->addCompilerPassIfExists($container, TranslationDumperPass::class); $container->addCompilerPass(new FragmentRendererPass()); $this->addCompilerPassIfExists($container, SerializerPass::class); + $this->addCompilerPassIfExists($container, SerializerAttributeMetadataPass::class); $this->addCompilerPassIfExists($container, PropertyInfoPass::class); $this->addCompilerPassIfExists($container, PropertyInfoConstructorPass::class); $container->addCompilerPass(new ControllerArgumentValueResolverPass()); diff --git a/KernelBrowser.php b/KernelBrowser.php index add2508ff..dec0c698c 100644 --- a/KernelBrowser.php +++ b/KernelBrowser.php @@ -18,6 +18,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpKernel\HttpKernelBrowser; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\Profiler\Profile as HttpProfile; @@ -63,6 +64,35 @@ public function getProfile(): HttpProfile|false|null return $this->getContainer()->get('profiler')->loadProfileFromResponse($this->response); } + public function getSession(): ?SessionInterface + { + $container = $this->getContainer(); + + if (!$container->has('session.factory')) { + return null; + } + + $session = $container->get('session.factory')->createSession(); + + $cookieJar = $this->getCookieJar(); + $cookie = $cookieJar->get($session->getName()); + + if ($cookie instanceof Cookie) { + $session->setId($cookie->getValue()); + } + + $session->start(); + + if (!$cookie instanceof Cookie) { + $domains = array_unique(array_map(fn (Cookie $cookie) => $cookie->getName() === $session->getName() ? $cookie->getDomain() : '', $cookieJar->all())) ?: ['']; + foreach ($domains as $domain) { + $cookieJar->set(new Cookie($session->getName(), $session->getId(), domain: $domain)); + } + } + + return $session; + } + /** * Enables the profiler for the very next request. * @@ -116,20 +146,13 @@ public function loginUser(object $user, string $firewallContext = 'main', array $container = $this->getContainer(); $container->get('security.untracked_token_storage')->setToken($token); - if (!$container->has('session.factory')) { + if (!$session = $this->getSession()) { return $this; } - $session = $container->get('session.factory')->createSession(); $session->set('_security_'.$firewallContext, serialize($token)); $session->save(); - $domains = array_unique(array_map(fn (Cookie $cookie) => $cookie->getName() === $session->getName() ? $cookie->getDomain() : '', $this->getCookieJar()->all())) ?: ['']; - foreach ($domains as $domain) { - $cookie = new Cookie($session->getName(), $session->getId(), null, null, $domain); - $this->getCookieJar()->set($cookie); - } - return $this; } @@ -205,25 +228,25 @@ protected function getScript(object $request): string $profilerCode = ''; if ($this->profiler) { $profilerCode = <<<'EOF' -$container = $kernel->getContainer(); -$container = $container->has('test.service_container') ? $container->get('test.service_container') : $container; -$container->get('profiler')->enable(); -EOF; + $container = $kernel->getContainer(); + $container = $container->has('test.service_container') ? $container->get('test.service_container') : $container; + $container->get('profiler')->enable(); + EOF; } $code = <<boot(); -$profilerCode + \$kernel = unserialize($kernel); + \$kernel->boot(); + $profilerCode -\$request = unserialize($request); -EOF; + \$request = unserialize($request); + EOF; return $code.$this->getHandleScript(); } diff --git a/Resources/config/console.php b/Resources/config/console.php index 7ef10bb52..fda2f75d7 100644 --- a/Resources/config/console.php +++ b/Resources/config/console.php @@ -45,6 +45,7 @@ use Symfony\Component\Console\Messenger\RunCommandMessageHandler; use Symfony\Component\Dotenv\Command\DebugCommand as DotenvDebugCommand; use Symfony\Component\ErrorHandler\Command\ErrorDumpCommand; +use Symfony\Component\Form\Command\DebugCommand; use Symfony\Component\Messenger\Command\ConsumeMessagesCommand; use Symfony\Component\Messenger\Command\DebugCommand as MessengerDebugCommand; use Symfony\Component\Messenger\Command\FailedMessagesRemoveCommand; @@ -327,7 +328,7 @@ ]) ->tag('console.command') - ->set('console.command.form_debug', \Symfony\Component\Form\Command\DebugCommand::class) + ->set('console.command.form_debug', DebugCommand::class) ->args([ service('form.registry'), [], // All form types namespaces are stored here by FormPass diff --git a/Resources/config/form.php b/Resources/config/form.php index 3c936a284..fe85f6c51 100644 --- a/Resources/config/form.php +++ b/Resources/config/form.php @@ -14,6 +14,7 @@ use Symfony\Component\Form\ChoiceList\Factory\CachingFactoryDecorator; use Symfony\Component\Form\ChoiceList\Factory\DefaultChoiceListFactory; use Symfony\Component\Form\ChoiceList\Factory\PropertyAccessDecorator; +use Symfony\Component\Form\EnumFormTypeGuesser; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ColorType; use Symfony\Component\Form\Extension\Core\Type\FileType; @@ -76,6 +77,9 @@ ->args([service('validator.mapping.class_metadata_factory')]) ->tag('form.type_guesser') + ->set('form.type_guesser.enum_type', EnumFormTypeGuesser::class) + ->tag('form.type_guesser') + ->alias('form.property_accessor', 'property_accessor') ->set('form.choice_list_factory.default', DefaultChoiceListFactory::class) diff --git a/Resources/config/json_streamer.php b/Resources/config/json_streamer.php index 79fb25833..b6daf512c 100644 --- a/Resources/config/json_streamer.php +++ b/Resources/config/json_streamer.php @@ -11,7 +11,6 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; -use Symfony\Component\JsonStreamer\CacheWarmer\LazyGhostCacheWarmer; use Symfony\Component\JsonStreamer\CacheWarmer\StreamerCacheWarmer; use Symfony\Component\JsonStreamer\JsonStreamReader; use Symfony\Component\JsonStreamer\JsonStreamWriter; @@ -38,7 +37,6 @@ tagged_locator('json_streamer.value_transformer'), service('json_streamer.read.property_metadata_loader'), param('.json_streamer.stream_readers_dir'), - param('.json_streamer.lazy_ghosts_dir'), ]) ->alias(JsonStreamWriter::class, 'json_streamer.stream_writer') ->alias(JsonStreamReader::class, 'json_streamer.stream_reader') @@ -108,12 +106,5 @@ service('logger')->ignoreOnInvalid(), ]) ->tag('kernel.cache_warmer') - - ->set('.json_streamer.cache_warmer.lazy_ghost', LazyGhostCacheWarmer::class) - ->args([ - abstract_arg('streamable class names'), - param('.json_streamer.lazy_ghosts_dir'), - ]) - ->tag('kernel.cache_warmer') ; }; diff --git a/Resources/config/mailer_transports.php b/Resources/config/mailer_transports.php index 2c79b4d55..e88e95166 100644 --- a/Resources/config/mailer_transports.php +++ b/Resources/config/mailer_transports.php @@ -24,6 +24,7 @@ use Symfony\Component\Mailer\Bridge\Mailomat\Transport\MailomatTransportFactory; use Symfony\Component\Mailer\Bridge\MailPace\Transport\MailPaceTransportFactory; use Symfony\Component\Mailer\Bridge\Mailtrap\Transport\MailtrapTransportFactory; +use Symfony\Component\Mailer\Bridge\MicrosoftGraph\Transport\MicrosoftGraphTransportFactory; use Symfony\Component\Mailer\Bridge\Postal\Transport\PostalTransportFactory; use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkTransportFactory; use Symfony\Component\Mailer\Bridge\Resend\Transport\ResendTransportFactory; @@ -60,6 +61,7 @@ 'mailjet' => MailjetTransportFactory::class, 'mailomat' => MailomatTransportFactory::class, 'mailpace' => MailPaceTransportFactory::class, + 'microsoftgraph' => MicrosoftGraphTransportFactory::class, 'native' => NativeTransportFactory::class, 'null' => NullTransportFactory::class, 'postal' => PostalTransportFactory::class, diff --git a/Resources/config/messenger.php b/Resources/config/messenger.php index e02cd1ca3..611114272 100644 --- a/Resources/config/messenger.php +++ b/Resources/config/messenger.php @@ -26,6 +26,7 @@ use Symfony\Component\Messenger\EventListener\StopWorkerOnRestartSignalListener; use Symfony\Component\Messenger\Handler\RedispatchMessageHandler; use Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware; +use Symfony\Component\Messenger\Middleware\AddDefaultStampsMiddleware; use Symfony\Component\Messenger\Middleware\DeduplicateMiddleware; use Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware; use Symfony\Component\Messenger\Middleware\FailedMessageProcessingMiddleware; @@ -93,6 +94,8 @@ service('lock.factory'), ]) + ->set('messenger.middleware.add_default_stamps_middleware', AddDefaultStampsMiddleware::class) + ->set('messenger.middleware.add_bus_name_stamp_middleware', AddBusNameStampMiddleware::class) ->abstract() diff --git a/Resources/config/notifier.php b/Resources/config/notifier.php index 28900ad10..af5c7436e 100644 --- a/Resources/config/notifier.php +++ b/Resources/config/notifier.php @@ -140,12 +140,8 @@ ->set('notifier.notification_logger_listener', NotificationLoggerListener::class) ->tag('kernel.event_subscriber') - ; - - if (class_exists(DesktopMessage::class)) { - $container->services() - ->set('texter.messenger.desktop_handler', MessageHandler::class) - ->args([service('texter.transports')]) - ->tag('messenger.message_handler', ['handles' => DesktopMessage::class]); - } + + ->set('texter.messenger.desktop_handler', MessageHandler::class) + ->args([service('texter.transports')]) + ->tag('messenger.message_handler', ['handles' => DesktopMessage::class]); }; diff --git a/Resources/config/notifier_transports.php b/Resources/config/notifier_transports.php index d1adcfc37..b7516214b 100644 --- a/Resources/config/notifier_transports.php +++ b/Resources/config/notifier_transports.php @@ -102,7 +102,6 @@ 'sms-biuras' => Bridge\SmsBiuras\SmsBiurasTransportFactory::class, 'sms-factor' => Bridge\SmsFactor\SmsFactorTransportFactory::class, 'sms-sluzba' => Bridge\SmsSluzba\SmsSluzbaTransportFactory::class, - 'sms77' => Bridge\Sms77\Sms77TransportFactory::class, 'smsapi' => Bridge\Smsapi\SmsapiTransportFactory::class, 'smsbox' => Bridge\Smsbox\SmsboxTransportFactory::class, 'smsc' => Bridge\Smsc\SmscTransportFactory::class, diff --git a/Resources/config/profiling.php b/Resources/config/profiling.php index a81c53a63..ba734bee2 100644 --- a/Resources/config/profiling.php +++ b/Resources/config/profiling.php @@ -39,6 +39,7 @@ param('profiler_listener.only_main_requests'), ]) ->tag('kernel.event_subscriber') + ->tag('kernel.reset', ['method' => '?reset']) ->set('console_profiler_listener', ConsoleProfilerListener::class) ->args([ diff --git a/Resources/config/routing.php b/Resources/config/routing.php index 8cdbbf33a..ad7ace2ca 100644 --- a/Resources/config/routing.php +++ b/Resources/config/routing.php @@ -26,6 +26,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Loader\AttributeDirectoryLoader; use Symfony\Component\Routing\Loader\AttributeFileLoader; +use Symfony\Component\Routing\Loader\AttributeServicesLoader; use Symfony\Component\Routing\Loader\ContainerLoader; use Symfony\Component\Routing\Loader\DirectoryLoader; use Symfony\Component\Routing\Loader\GlobFileLoader; @@ -98,6 +99,12 @@ ]) ->tag('routing.loader', ['priority' => -10]) + ->set('routing.loader.attribute.services', AttributeServicesLoader::class) + ->args([ + abstract_arg('classes tagged with "routing.controller"'), + ]) + ->tag('routing.loader', ['priority' => -10]) + ->set('routing.loader.attribute.directory', AttributeDirectoryLoader::class) ->args([ service('file_locator'), diff --git a/Resources/config/routing/errors.php b/Resources/config/routing/errors.php index 36a46dee4..11040e29a 100644 --- a/Resources/config/routing/errors.php +++ b/Resources/config/routing/errors.php @@ -10,19 +10,8 @@ */ use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; -use Symfony\Component\Routing\Loader\XmlFileLoader; return function (RoutingConfigurator $routes): void { - foreach (debug_backtrace() as $trace) { - if (isset($trace['object']) && $trace['object'] instanceof XmlFileLoader && 'doImport' === $trace['function']) { - if (__DIR__ === dirname(realpath($trace['args'][3]))) { - trigger_deprecation('symfony/routing', '7.3', 'The "errors.xml" routing configuration file is deprecated, import "errors.php" instead.'); - - break; - } - } - } - $routes->add('_preview_error', '/{code}.{_format}') ->controller('error_controller::preview') ->defaults(['_format' => 'html']) diff --git a/Resources/config/routing/errors.xml b/Resources/config/routing/errors.xml deleted file mode 100644 index f890aef1e..000000000 --- a/Resources/config/routing/errors.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/Resources/config/routing/webhook.php b/Resources/config/routing/webhook.php index 177606b26..ce2436799 100644 --- a/Resources/config/routing/webhook.php +++ b/Resources/config/routing/webhook.php @@ -10,19 +10,8 @@ */ use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; -use Symfony\Component\Routing\Loader\XmlFileLoader; return function (RoutingConfigurator $routes): void { - foreach (debug_backtrace() as $trace) { - if (isset($trace['object']) && $trace['object'] instanceof XmlFileLoader && 'doImport' === $trace['function']) { - if (__DIR__ === dirname(realpath($trace['args'][3]))) { - trigger_deprecation('symfony/routing', '7.3', 'The "webhook.xml" routing configuration file is deprecated, import "webhook.php" instead.'); - - break; - } - } - } - $routes->add('_webhook_controller', '/{type}') ->controller('webhook.controller::handle') ->requirements(['type' => '.+']) diff --git a/Resources/config/routing/webhook.xml b/Resources/config/routing/webhook.xml deleted file mode 100644 index 8cb64ebb7..000000000 --- a/Resources/config/routing/webhook.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/Resources/config/schema/symfony-1.0.xsd b/Resources/config/schema/symfony-1.0.xsd index a25383ad7..b7da70db3 100644 --- a/Resources/config/schema/symfony-1.0.xsd +++ b/Resources/config/schema/symfony-1.0.xsd @@ -23,7 +23,6 @@ - @@ -135,7 +134,6 @@ - @@ -157,8 +155,6 @@ - - @@ -315,7 +311,6 @@ - @@ -341,7 +336,6 @@ - @@ -351,13 +345,6 @@ - - - - - - - @@ -384,7 +371,18 @@ - + + + + + + + + + + + + @@ -464,6 +462,7 @@ + @@ -575,21 +574,6 @@ - - - - - - - - - - - - - - - diff --git a/Resources/config/serializer.php b/Resources/config/serializer.php index e0a256bbe..6d9d354b4 100644 --- a/Resources/config/serializer.php +++ b/Resources/config/serializer.php @@ -28,6 +28,7 @@ use Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface; +use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader; use Symfony\Component\Serializer\Mapping\Loader\LoaderChain; use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter; use Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter; @@ -151,6 +152,9 @@ ->set('serializer.mapping.chain_loader', LoaderChain::class) ->args([[]]) + ->set('serializer.mapping.attribute_loader', AttributeLoader::class) + ->args([true, []]) + // Class Metadata Factory ->set('serializer.mapping.class_metadata_factory', ClassMetadataFactory::class) ->args([service('serializer.mapping.chain_loader')]) diff --git a/Resources/config/type_info.php b/Resources/config/type_info.php index 71e3646a1..0cf5dcbf5 100644 --- a/Resources/config/type_info.php +++ b/Resources/config/type_info.php @@ -23,7 +23,10 @@ $container->services() // type context ->set('type_info.type_context_factory', TypeContextFactory::class) - ->args([service('type_info.resolver.string')->nullOnInvalid()]) + ->args([ + service('type_info.resolver.string')->nullOnInvalid(), + [], + ]) // type resolvers ->set('type_info.resolver', TypeResolver::class) diff --git a/Resources/config/validator.php b/Resources/config/validator.php index 535b42edc..8c95e17fc 100644 --- a/Resources/config/validator.php +++ b/Resources/config/validator.php @@ -14,6 +14,7 @@ use Symfony\Bundle\FrameworkBundle\CacheWarmer\ValidatorCacheWarmer; use Symfony\Component\Cache\Adapter\PhpArrayAdapter; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; +use Symfony\Component\Form\Form; use Symfony\Component\Validator\Constraints\EmailValidator; use Symfony\Component\Validator\Constraints\ExpressionLanguageProvider; use Symfony\Component\Validator\Constraints\ExpressionValidator; @@ -73,7 +74,6 @@ ]) ->load('Symfony\Component\Validator\Constraints\\', $validatorsDir.'/*Validator.php') - ->exclude($validatorsDir.'/ExpressionLanguageSyntaxValidator.php') ->abstract() ->tag('container.excluded') ->tag('validator.constraint_validator') @@ -127,5 +127,9 @@ service('property_info'), ]) ->tag('validator.auto_mapper') + + ->set('validator.form.attribute_metadata', Form::class) + ->tag('container.excluded') + ->tag('validator.attribute_metadata') ; }; diff --git a/Resources/config/web.php b/Resources/config/web.php index a4e975dac..17a585d58 100644 --- a/Resources/config/web.php +++ b/Resources/config/web.php @@ -12,6 +12,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Bundle\FrameworkBundle\Controller\ControllerHelper; use Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver; use Symfony\Bundle\FrameworkBundle\Controller\TemplateController; use Symfony\Component\HttpKernel\Controller\ArgumentResolver; @@ -31,6 +32,7 @@ use Symfony\Component\HttpKernel\EventListener\CacheAttributeListener; use Symfony\Component\HttpKernel\EventListener\DisallowRobotsIndexingListener; use Symfony\Component\HttpKernel\EventListener\ErrorListener; +use Symfony\Component\HttpKernel\EventListener\IsSignatureValidAttributeListener; use Symfony\Component\HttpKernel\EventListener\LocaleListener; use Symfony\Component\HttpKernel\EventListener\ResponseListener; use Symfony\Component\HttpKernel\EventListener\ValidateRequestListener; @@ -145,6 +147,18 @@ ->set('controller.cache_attribute_listener', CacheAttributeListener::class) ->tag('kernel.event_subscriber') + ->tag('kernel.reset', ['method' => '?reset']) + + ->set('controller.is_signature_valid_attribute_listener', IsSignatureValidAttributeListener::class) + ->args([ + service('uri_signer'), + ]) + ->tag('kernel.event_subscriber') + + ->set('controller.helper', ControllerHelper::class) + ->tag('container.service_subscriber') + + ->alias(ControllerHelper::class, 'controller.helper') ; }; diff --git a/Resources/config/web_link.php b/Resources/config/web_link.php index 64345cc99..df55d1947 100644 --- a/Resources/config/web_link.php +++ b/Resources/config/web_link.php @@ -12,6 +12,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Component\WebLink\EventListener\AddLinkHeaderListener; +use Symfony\Component\WebLink\HttpHeaderParser; use Symfony\Component\WebLink\HttpHeaderSerializer; return static function (ContainerConfigurator $container) { @@ -20,6 +21,9 @@ ->set('web_link.http_header_serializer', HttpHeaderSerializer::class) ->alias(HttpHeaderSerializer::class, 'web_link.http_header_serializer') + ->set('web_link.http_header_parser', HttpHeaderParser::class) + ->alias(HttpHeaderParser::class, 'web_link.http_header_parser') + ->set('web_link.add_link_header_listener', AddLinkHeaderListener::class) ->args([ service('web_link.http_header_serializer'), diff --git a/Routing/Router.php b/Routing/Router.php index 9efa07fae..cc98fea98 100644 --- a/Routing/Router.php +++ b/Routing/Router.php @@ -30,12 +30,13 @@ * This Router creates the Loader only when the cache is empty. * * @author Fabien Potencier - * - * @final since Symfony 7.1 */ -class Router extends BaseRouter implements WarmableInterface, ServiceSubscriberInterface +final class Router extends BaseRouter implements WarmableInterface, ServiceSubscriberInterface { private array $collectedParameters = []; + /** + * @var \Closure(string):mixed + */ private \Closure $paramFetcher; /** diff --git a/Secrets/SodiumVault.php b/Secrets/SodiumVault.php index 2a8e5dcc8..5abdfdc70 100644 --- a/Secrets/SodiumVault.php +++ b/Secrets/SodiumVault.php @@ -228,7 +228,7 @@ private function export(string $filename, string $data): void private function createSecretsDir(): void { - if ($this->secretsDir && !is_dir($this->secretsDir) && !@mkdir($this->secretsDir, 0777, true) && !is_dir($this->secretsDir)) { + if ($this->secretsDir && !is_dir($this->secretsDir) && !@mkdir($this->secretsDir, 0o777, true) && !is_dir($this->secretsDir)) { throw new \RuntimeException(\sprintf('Unable to create the secrets directory (%s).', $this->secretsDir)); } diff --git a/Test/BrowserKitAssertionsTrait.php b/Test/BrowserKitAssertionsTrait.php index 1b7437b77..2c9169b83 100644 --- a/Test/BrowserKitAssertionsTrait.php +++ b/Test/BrowserKitAssertionsTrait.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\Constraint\LogicalNot; use PHPUnit\Framework\ExpectationFailedException; use Symfony\Component\BrowserKit\AbstractBrowser; +use Symfony\Component\BrowserKit\History; use Symfony\Component\BrowserKit\Test\Constraint as BrowserKitConstraint; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -28,30 +29,33 @@ */ trait BrowserKitAssertionsTrait { - public static function assertResponseIsSuccessful(string $message = '', bool $verbose = true): void + private static bool $defaultVerboseMode = true; + + public static function setBrowserKitAssertionsAsVerbose(bool $verbose): void + { + self::$defaultVerboseMode = $verbose; + } + + public static function assertResponseIsSuccessful(string $message = '', ?bool $verbose = null): void { - self::assertThatForResponse(new ResponseConstraint\ResponseIsSuccessful($verbose), $message); + self::assertThatForResponse(new ResponseConstraint\ResponseIsSuccessful($verbose ?? self::$defaultVerboseMode), $message); } - public static function assertResponseStatusCodeSame(int $expectedCode, string $message = '', bool $verbose = true): void + public static function assertResponseStatusCodeSame(int $expectedCode, string $message = '', ?bool $verbose = null): void { - self::assertThatForResponse(new ResponseConstraint\ResponseStatusCodeSame($expectedCode, $verbose), $message); + self::assertThatForResponse(new ResponseConstraint\ResponseStatusCodeSame($expectedCode, $verbose ?? self::$defaultVerboseMode), $message); } - public static function assertResponseFormatSame(?string $expectedFormat, string $message = ''): void + public static function assertResponseFormatSame(?string $expectedFormat, string $message = '', ?bool $verbose = null): void { - self::assertThatForResponse(new ResponseConstraint\ResponseFormatSame(self::getRequest(), $expectedFormat), $message); + self::assertThatForResponse(new ResponseConstraint\ResponseFormatSame(self::getRequest(), $expectedFormat, $verbose ?? self::$defaultVerboseMode), $message); } - public static function assertResponseRedirects(?string $expectedLocation = null, ?int $expectedCode = null, string $message = '', bool $verbose = true): void + public static function assertResponseRedirects(?string $expectedLocation = null, ?int $expectedCode = null, string $message = '', ?bool $verbose = null): void { - $constraint = new ResponseConstraint\ResponseIsRedirected($verbose); + $constraint = new ResponseConstraint\ResponseIsRedirected($verbose ?? self::$defaultVerboseMode); if ($expectedLocation) { - if (class_exists(ResponseConstraint\ResponseHeaderLocationSame::class)) { - $locationConstraint = new ResponseConstraint\ResponseHeaderLocationSame(self::getRequest(), $expectedLocation); - } else { - $locationConstraint = new ResponseConstraint\ResponseHeaderSame('Location', $expectedLocation); - } + $locationConstraint = new ResponseConstraint\ResponseHeaderLocationSame(self::getRequest(), $expectedLocation); $constraint = LogicalAnd::fromConstraints($constraint, $locationConstraint); } @@ -100,9 +104,9 @@ public static function assertResponseCookieValueSame(string $name, string $expec ), $message); } - public static function assertResponseIsUnprocessable(string $message = '', bool $verbose = true): void + public static function assertResponseIsUnprocessable(string $message = '', ?bool $verbose = null): void { - self::assertThatForResponse(new ResponseConstraint\ResponseIsUnprocessable($verbose), $message); + self::assertThatForResponse(new ResponseConstraint\ResponseIsUnprocessable($verbose ?? self::$defaultVerboseMode), $message); } public static function assertBrowserHasCookie(string $name, string $path = '/', ?string $domain = null, string $message = ''): void @@ -115,6 +119,38 @@ public static function assertBrowserNotHasCookie(string $name, string $path = '/ self::assertThatForClient(new LogicalNot(new BrowserKitConstraint\BrowserHasCookie($name, $path, $domain)), $message); } + public static function assertBrowserHistoryIsOnFirstPage(string $message = ''): void + { + if (!method_exists(History::class, 'isFirstPage')) { + throw new \LogicException('The `assertBrowserHistoryIsOnFirstPage` method requires symfony/browser-kit >= 7.4.'); + } + self::assertThatForClient(new BrowserKitConstraint\BrowserHistoryIsOnFirstPage(), $message); + } + + public static function assertBrowserHistoryIsNotOnFirstPage(string $message = ''): void + { + if (!method_exists(History::class, 'isFirstPage')) { + throw new \LogicException('The `assertBrowserHistoryIsNotOnFirstPage` method requires symfony/browser-kit >= 7.4.'); + } + self::assertThatForClient(new LogicalNot(new BrowserKitConstraint\BrowserHistoryIsOnFirstPage()), $message); + } + + public static function assertBrowserHistoryIsOnLastPage(string $message = ''): void + { + if (!method_exists(History::class, 'isLastPage')) { + throw new \LogicException('The `assertBrowserHistoryIsOnLastPage` method requires symfony/browser-kit >= 7.4.'); + } + self::assertThatForClient(new BrowserKitConstraint\BrowserHistoryIsOnLastPage(), $message); + } + + public static function assertBrowserHistoryIsNotOnLastPage(string $message = ''): void + { + if (!method_exists(History::class, 'isLastPage')) { + throw new \LogicException('The `assertBrowserHistoryIsNotOnLastPage` method requires symfony/browser-kit >= 7.4.'); + } + self::assertThatForClient(new LogicalNot(new BrowserKitConstraint\BrowserHistoryIsOnLastPage()), $message); + } + public static function assertBrowserCookieValueSame(string $name, string $expectedValue, bool $raw = false, string $path = '/', ?string $domain = null, string $message = ''): void { self::assertThatForClient(LogicalAnd::fromConstraints( diff --git a/Test/MailerAssertionsTrait.php b/Test/MailerAssertionsTrait.php index 2308c3e2f..07f4c99f5 100644 --- a/Test/MailerAssertionsTrait.php +++ b/Test/MailerAssertionsTrait.php @@ -90,6 +90,11 @@ public static function assertEmailAddressContains(RawMessage $email, string $hea self::assertThat($email, new MimeConstraint\EmailAddressContains($headerName, $expectedValue), $message); } + public static function assertEmailAddressNotContains(RawMessage $email, string $headerName, string $expectedValue, string $message = ''): void + { + self::assertThat($email, new LogicalNot(new MimeConstraint\EmailAddressContains($headerName, $expectedValue)), $message); + } + public static function assertEmailSubjectContains(RawMessage $email, string $expectedValue, string $message = ''): void { self::assertThat($email, new MimeConstraint\EmailSubjectContains($expectedValue), $message); diff --git a/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php b/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php index 994151807..3bb7356d3 100644 --- a/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php +++ b/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php @@ -365,12 +365,7 @@ public function getCacheDir(): string public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(static function (ContainerBuilder $container) { - $container->loadFromExtension('framework', [ - 'annotations' => false, - 'handle_all_throwables' => true, - 'http_method_override' => false, - 'php_errors' => ['log' => true], - ]); + $container->loadFromExtension('framework', []); }); } @@ -412,9 +407,8 @@ public function getConfigTreeBuilder(): TreeBuilder $rootNode = $treeBuilder->getRootNode(); $firewallNodeBuilder = $rootNode - ->fixXmlConfig('firewall') ->children() - ->arrayNode('firewalls') + ->arrayNode('firewalls', 'firewall') ->isRequired() ->requiresAtLeastOneElement() ->useAttributeAsKey('name') diff --git a/Tests/CacheWarmer/SerializerCacheWarmerTest.php b/Tests/CacheWarmer/SerializerCacheWarmerTest.php index f17aad0e3..5c19d2a3f 100644 --- a/Tests/CacheWarmer/SerializerCacheWarmerTest.php +++ b/Tests/CacheWarmer/SerializerCacheWarmerTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Bundle\FrameworkBundle\CacheWarmer\SerializerCacheWarmer; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; use Symfony\Component\Cache\Adapter\NullAdapter; @@ -38,9 +39,7 @@ private function getArrayPool(string $file): PhpArrayAdapter return $this->arrayPool = new PhpArrayAdapter($file, new NullAdapter()); } - /** - * @dataProvider loaderProvider - */ + #[DataProvider('loaderProvider')] public function testWarmUp(array $loaders) { $file = sys_get_temp_dir().'/cache-serializer.php'; @@ -57,9 +56,7 @@ public function testWarmUp(array $loaders) $this->assertTrue($arrayPool->getItem('Symfony_Bundle_FrameworkBundle_Tests_Fixtures_Serialization_Author')->isHit()); } - /** - * @dataProvider loaderProvider - */ + #[DataProvider('loaderProvider')] public function testWarmUpAbsoluteFilePath(array $loaders) { $file = sys_get_temp_dir().'/0/cache-serializer.php'; @@ -79,9 +76,7 @@ public function testWarmUpAbsoluteFilePath(array $loaders) $this->assertTrue($arrayPool->getItem('Symfony_Bundle_FrameworkBundle_Tests_Fixtures_Serialization_Author')->isHit()); } - /** - * @dataProvider loaderProvider - */ + #[DataProvider('loaderProvider')] public function testWarmUpWithoutBuildDir(array $loaders) { $file = sys_get_temp_dir().'/cache-serializer.php'; diff --git a/Tests/Command/AboutCommand/AboutCommandTest.php b/Tests/Command/AboutCommand/AboutCommandTest.php index bcf3c7fe0..044d816e0 100644 --- a/Tests/Command/AboutCommand/AboutCommandTest.php +++ b/Tests/Command/AboutCommand/AboutCommandTest.php @@ -34,7 +34,7 @@ public function testAboutWithReadableFiles() $this->fs->mkdir($kernel->getProjectDir()); $this->fs->dumpFile($kernel->getCacheDir().'/readable_file', 'The file content.'); - $this->fs->chmod($kernel->getCacheDir().'/readable_file', 0777); + $this->fs->chmod($kernel->getCacheDir().'/readable_file', 0o777); $tester = $this->createCommandTester($kernel); $ret = $tester->execute([]); @@ -43,7 +43,7 @@ public function testAboutWithReadableFiles() $this->assertStringContainsString('Cache directory', $tester->getDisplay()); $this->assertStringContainsString('Log directory', $tester->getDisplay()); - $this->fs->chmod($kernel->getCacheDir().'/readable_file', 0777); + $this->fs->chmod($kernel->getCacheDir().'/readable_file', 0o777); try { $this->fs->remove($kernel->getProjectDir()); @@ -62,7 +62,7 @@ public function testAboutWithUnreadableFiles() } $this->fs->dumpFile($kernel->getCacheDir().'/unreadable_file', 'The file content.'); - $this->fs->chmod($kernel->getCacheDir().'/unreadable_file', 0222); + $this->fs->chmod($kernel->getCacheDir().'/unreadable_file', 0o222); $tester = $this->createCommandTester($kernel); $ret = $tester->execute([]); @@ -71,7 +71,7 @@ public function testAboutWithUnreadableFiles() $this->assertStringContainsString('Cache directory', $tester->getDisplay()); $this->assertStringContainsString('Log directory', $tester->getDisplay()); - $this->fs->chmod($kernel->getCacheDir().'/unreadable_file', 0777); + $this->fs->chmod($kernel->getCacheDir().'/unreadable_file', 0o777); try { $this->fs->remove($kernel->getProjectDir()); @@ -82,7 +82,7 @@ public function testAboutWithUnreadableFiles() private function createCommandTester(TestAppKernel $kernel): CommandTester { $application = new Application($kernel); - $application->add(new AboutCommand()); + $application->addCommand(new AboutCommand()); return new CommandTester($application->find('about')); } diff --git a/Tests/Command/AboutCommand/Fixture/TestAppKernel.php b/Tests/Command/AboutCommand/Fixture/TestAppKernel.php index 8c161bc28..089860376 100644 --- a/Tests/Command/AboutCommand/Fixture/TestAppKernel.php +++ b/Tests/Command/AboutCommand/Fixture/TestAppKernel.php @@ -33,12 +33,7 @@ public function getProjectDir(): string public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(static function (ContainerBuilder $container) { - $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - ]); + $container->loadFromExtension('framework', []); }); } diff --git a/Tests/Command/CacheClearCommand/Fixture/config.yml b/Tests/Command/CacheClearCommand/Fixture/config.yml index 13f578bea..68f8d0406 100644 --- a/Tests/Command/CacheClearCommand/Fixture/config.yml +++ b/Tests/Command/CacheClearCommand/Fixture/config.yml @@ -1,7 +1,2 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true secret: test diff --git a/Tests/Command/CachePoolClearCommandTest.php b/Tests/Command/CachePoolClearCommandTest.php index 3a927f217..dcf788134 100644 --- a/Tests/Command/CachePoolClearCommandTest.php +++ b/Tests/Command/CachePoolClearCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use Psr\Cache\CacheItemPoolInterface; use Symfony\Bundle\FrameworkBundle\Command\CachePoolClearCommand; @@ -30,13 +31,11 @@ protected function setUp(): void $this->cachePool = $this->createMock(CacheItemPoolInterface::class); } - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions) { $application = new Application($this->getKernel()); - $application->add(new CachePoolClearCommand(new Psr6CacheClearer(['foo' => $this->cachePool]), ['foo'])); + $application->addCommand(new CachePoolClearCommand(new Psr6CacheClearer(['foo' => $this->cachePool]), ['foo'])); $tester = new CommandCompletionTester($application->get('cache:pool:clear')); $suggestions = $tester->complete($input); diff --git a/Tests/Command/CachePoolDeleteCommandTest.php b/Tests/Command/CachePoolDeleteCommandTest.php index 3db39e121..afd3ecdd7 100644 --- a/Tests/Command/CachePoolDeleteCommandTest.php +++ b/Tests/Command/CachePoolDeleteCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\MockObject\MockObject; use Psr\Cache\CacheItemPoolInterface; use Symfony\Bundle\FrameworkBundle\Command\CachePoolDeleteCommand; @@ -84,13 +85,11 @@ public function testCommandDeleteFailed() $tester->execute(['pool' => 'foo', 'key' => 'bar']); } - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions) { $application = new Application($this->getKernel()); - $application->add(new CachePoolDeleteCommand(new Psr6CacheClearer(['foo' => $this->cachePool]), ['foo'])); + $application->addCommand(new CachePoolDeleteCommand(new Psr6CacheClearer(['foo' => $this->cachePool]), ['foo'])); $tester = new CommandCompletionTester($application->get('cache:pool:delete')); $suggestions = $tester->complete($input); @@ -125,7 +124,7 @@ private function getKernel(): MockObject&KernelInterface private function getCommandTester(KernelInterface $kernel): CommandTester { $application = new Application($kernel); - $application->add(new CachePoolDeleteCommand(new Psr6CacheClearer(['foo' => $this->cachePool]))); + $application->addCommand(new CachePoolDeleteCommand(new Psr6CacheClearer(['foo' => $this->cachePool]))); return new CommandTester($application->find('cache:pool:delete')); } diff --git a/Tests/Command/CachePruneCommandTest.php b/Tests/Command/CachePruneCommandTest.php index a2d0ad7fe..18a3622f2 100644 --- a/Tests/Command/CachePruneCommandTest.php +++ b/Tests/Command/CachePruneCommandTest.php @@ -77,7 +77,7 @@ private function getPruneableInterfaceMock(): MockObject&PruneableInterface private function getCommandTester(KernelInterface $kernel, RewindableGenerator $generator): CommandTester { $application = new Application($kernel); - $application->add(new CachePoolPruneCommand($generator)); + $application->addCommand(new CachePoolPruneCommand($generator)); return new CommandTester($application->find('cache:pool:prune')); } diff --git a/Tests/Command/EventDispatcherDebugCommandTest.php b/Tests/Command/EventDispatcherDebugCommandTest.php index 359196e11..7dc1e0dc6 100644 --- a/Tests/Command/EventDispatcherDebugCommandTest.php +++ b/Tests/Command/EventDispatcherDebugCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand; use Symfony\Component\Console\Tester\CommandCompletionTester; @@ -20,9 +21,7 @@ class EventDispatcherDebugCommandTest extends TestCase { - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions) { $tester = $this->createCommandCompletionTester(); diff --git a/Tests/Command/RouterMatchCommandTest.php b/Tests/Command/RouterMatchCommandTest.php index b6b6771f9..97b1859be 100644 --- a/Tests/Command/RouterMatchCommandTest.php +++ b/Tests/Command/RouterMatchCommandTest.php @@ -46,8 +46,8 @@ public function testWithNotMatchPath() private function createCommandTester(): CommandTester { $application = new Application($this->getKernel()); - $application->add(new RouterMatchCommand($this->getRouter())); - $application->add(new RouterDebugCommand($this->getRouter())); + $application->addCommand(new RouterMatchCommand($this->getRouter())); + $application->addCommand(new RouterDebugCommand($this->getRouter())); return new CommandTester($application->find('router:match')); } diff --git a/Tests/Command/SecretsDecryptToLocalCommandTest.php b/Tests/Command/SecretsDecryptToLocalCommandTest.php index 8a1c05d69..fb5a66194 100644 --- a/Tests/Command/SecretsDecryptToLocalCommandTest.php +++ b/Tests/Command/SecretsDecryptToLocalCommandTest.php @@ -11,15 +11,14 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\SecretsDecryptToLocalCommand; use Symfony\Bundle\FrameworkBundle\Secrets\SodiumVault; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Filesystem\Filesystem; -/** - * @requires extension sodium - */ +#[RequiresPhpExtension('sodium')] class SecretsDecryptToLocalCommandTest extends TestCase { private string $mainDir; diff --git a/Tests/Command/SecretsEncryptFromLocalCommandTest.php b/Tests/Command/SecretsEncryptFromLocalCommandTest.php index 68926c175..6e458913a 100644 --- a/Tests/Command/SecretsEncryptFromLocalCommandTest.php +++ b/Tests/Command/SecretsEncryptFromLocalCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\SecretsEncryptFromLocalCommand; use Symfony\Bundle\FrameworkBundle\Secrets\AbstractVault; @@ -18,9 +19,7 @@ use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Filesystem\Filesystem; -/** - * @requires extension sodium - */ +#[RequiresPhpExtension('sodium')] class SecretsEncryptFromLocalCommandTest extends TestCase { private string $vaultDir; diff --git a/Tests/Command/SecretsGenerateKeysCommandTest.php b/Tests/Command/SecretsGenerateKeysCommandTest.php index 9574782bf..2940fcfc3 100644 --- a/Tests/Command/SecretsGenerateKeysCommandTest.php +++ b/Tests/Command/SecretsGenerateKeysCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\SecretsGenerateKeysCommand; use Symfony\Bundle\FrameworkBundle\Secrets\AbstractVault; @@ -18,9 +19,7 @@ use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Filesystem\Filesystem; -/** - * @requires extension sodium - */ +#[RequiresPhpExtension('sodium')] class SecretsGenerateKeysCommandTest extends TestCase { private string $secretsDir; diff --git a/Tests/Command/SecretsListCommandTest.php b/Tests/Command/SecretsListCommandTest.php index 12d3ab2e8..de09d8941 100644 --- a/Tests/Command/SecretsListCommandTest.php +++ b/Tests/Command/SecretsListCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\BackupGlobals; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\SecretsListCommand; use Symfony\Bundle\FrameworkBundle\Secrets\AbstractVault; @@ -19,9 +20,7 @@ class SecretsListCommandTest extends TestCase { - /** - * @backupGlobals enabled - */ + #[BackupGlobals(true)] public function testExecute() { $vault = $this->createMock(AbstractVault::class); diff --git a/Tests/Command/SecretsRemoveCommandTest.php b/Tests/Command/SecretsRemoveCommandTest.php index 2c12b6128..d09fa3c01 100644 --- a/Tests/Command/SecretsRemoveCommandTest.php +++ b/Tests/Command/SecretsRemoveCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\SecretsRemoveCommand; use Symfony\Bundle\FrameworkBundle\Secrets\AbstractVault; @@ -18,9 +19,7 @@ class SecretsRemoveCommandTest extends TestCase { - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(bool $withLocalVault, array $input, array $expectedSuggestions) { $vault = $this->createMock(AbstractVault::class); diff --git a/Tests/Command/SecretsRevealCommandTest.php b/Tests/Command/SecretsRevealCommandTest.php index d77d303d5..37065d1c0 100644 --- a/Tests/Command/SecretsRevealCommandTest.php +++ b/Tests/Command/SecretsRevealCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\BackupGlobals; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\SecretsRevealCommand; use Symfony\Bundle\FrameworkBundle\Secrets\AbstractVault; @@ -59,9 +60,7 @@ public function testFailedDecrypt() $this->assertStringContainsString('The secret "secretKey" could not be decrypted.', trim($tester->getDisplay(true))); } - /** - * @backupGlobals enabled - */ + #[BackupGlobals(true)] public function testLocalVaultOverride() { $vault = $this->createMock(AbstractVault::class); @@ -78,9 +77,7 @@ public function testLocalVaultOverride() $this->assertEquals('newSecretValue', trim($tester->getDisplay(true))); } - /** - * @backupGlobals enabled - */ + #[BackupGlobals(true)] public function testOnlyLocalVaultContainsName() { $vault = $this->createMock(AbstractVault::class); diff --git a/Tests/Command/SecretsSetCommandTest.php b/Tests/Command/SecretsSetCommandTest.php index 678fb417c..57db9c529 100644 --- a/Tests/Command/SecretsSetCommandTest.php +++ b/Tests/Command/SecretsSetCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\SecretsSetCommand; use Symfony\Bundle\FrameworkBundle\Secrets\AbstractVault; @@ -18,9 +19,7 @@ class SecretsSetCommandTest extends TestCase { - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions) { $vault = $this->createMock(AbstractVault::class); diff --git a/Tests/Command/TranslationDebugCommandTest.php b/Tests/Command/TranslationDebugCommandTest.php index c6c91a857..e0e49fd2e 100644 --- a/Tests/Command/TranslationDebugCommandTest.php +++ b/Tests/Command/TranslationDebugCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; @@ -223,7 +224,7 @@ function ($path, $catalogue) use ($loadedMessages) { $command = new TranslationDebugCommand($translator, $loader, $extractor, $this->translationDir.'/translations', $this->translationDir.'/templates', $transPaths, $codePaths, $enabledLocales); $application = new Application($kernel); - $application->add($command); + $application->addCommand($command); return $application->find('debug:translation'); } @@ -240,9 +241,7 @@ private function getBundle($path) return $bundle; } - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions) { $extractedMessagesWithDomains = [ diff --git a/Tests/Command/TranslationExtractCommandCompletionTest.php b/Tests/Command/TranslationExtractCommandCompletionTest.php index 6d2f22d96..49874fe7c 100644 --- a/Tests/Command/TranslationExtractCommandCompletionTest.php +++ b/Tests/Command/TranslationExtractCommandCompletionTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\TranslationExtractCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; @@ -30,9 +31,7 @@ class TranslationExtractCommandCompletionTest extends TestCase private Filesystem $fs; private string $translationDir; - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions) { $tester = $this->createCommandCompletionTester(['messages' => ['foo' => 'foo']]); @@ -132,7 +131,7 @@ function ($path, $catalogue) use ($loadedMessages) { $command = new TranslationExtractCommand($writer, $loader, $extractor, 'en', $this->translationDir.'/translations', $this->translationDir.'/templates', $transPaths, $codePaths, ['en', 'fr']); $application = new Application($kernel); - $application->add($command); + $application->addCommand($command); return new CommandCompletionTester($application->find('translation:extract')); } diff --git a/Tests/Command/TranslationExtractCommandTest.php b/Tests/Command/TranslationExtractCommandTest.php index c5e78de12..276af4476 100644 --- a/Tests/Command/TranslationExtractCommandTest.php +++ b/Tests/Command/TranslationExtractCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\TranslationExtractCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; @@ -154,12 +155,12 @@ public function testFilterDuplicateTransPaths() if (preg_match('/\.[a-z]+$/', $transPath)) { if (!realpath(\dirname($transPath))) { - mkdir(\dirname($transPath), 0777, true); + mkdir(\dirname($transPath), 0o777, true); } touch($transPath); } else { - mkdir($transPath, 0777, true); + mkdir($transPath, 0o777, true); } } @@ -177,9 +178,7 @@ public function testFilterDuplicateTransPaths() $this->assertEquals($expectedPaths, $filteredTransPaths); } - /** - * @dataProvider removeNoFillProvider - */ + #[DataProvider('removeNoFillProvider')] public function testRemoveNoFillTranslationsMethod($noFillCounter, $messages) { // Preparing mock @@ -304,7 +303,7 @@ function (MessageCatalogue $catalogue) use ($writerMessages) { $command = new TranslationExtractCommand($writer, $loader, $extractor, 'en', $this->translationDir.'/translations', $this->translationDir.'/templates', $transPaths, $codePaths); $application = new Application($kernel); - $application->add($command); + $application->addCommand($command); return new CommandTester($application->find('translation:extract')); } diff --git a/Tests/Command/WorkflowDumpCommandTest.php b/Tests/Command/WorkflowDumpCommandTest.php index 284e97623..18bffb95c 100644 --- a/Tests/Command/WorkflowDumpCommandTest.php +++ b/Tests/Command/WorkflowDumpCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Command; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Command\WorkflowDumpCommand; use Symfony\Component\Console\Application; @@ -19,13 +20,11 @@ class WorkflowDumpCommandTest extends TestCase { - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions) { $application = new Application(); - $application->add(new WorkflowDumpCommand(new ServiceLocator([]))); + $application->addCommand(new WorkflowDumpCommand(new ServiceLocator([]))); $tester = new CommandCompletionTester($application->find('workflow:dump')); $suggestions = $tester->complete($input, 2); diff --git a/Tests/Command/XliffLintCommandTest.php b/Tests/Command/XliffLintCommandTest.php index d5495ada9..36712a3d4 100644 --- a/Tests/Command/XliffLintCommandTest.php +++ b/Tests/Command/XliffLintCommandTest.php @@ -35,10 +35,10 @@ public function testGetHelp() { $command = new XliffLintCommand(); $expected = <<php %command.full_name% @AcmeDemoBundle -EOF; + php %command.full_name% @AcmeDemoBundle + EOF; $this->assertStringContainsString($expected, $command->getHelp()); } @@ -59,7 +59,7 @@ private function createCommandTester($application = null): CommandTester { if (!$application) { $application = new BaseApplication(); - $application->add(new XliffLintCommand()); + $application->addCommand(new XliffLintCommand()); } $command = $application->find('lint:xliff'); diff --git a/Tests/Command/YamlLintCommandTest.php b/Tests/Command/YamlLintCommandTest.php index ec2093119..f395b27eb 100644 --- a/Tests/Command/YamlLintCommandTest.php +++ b/Tests/Command/YamlLintCommandTest.php @@ -73,10 +73,10 @@ public function testGetHelp() { $command = new YamlLintCommand(); $expected = <<php %command.full_name% @AcmeDemoBundle -EOF; + php %command.full_name% @AcmeDemoBundle + EOF; $this->assertStringContainsString($expected, $command->getHelp()); } @@ -107,7 +107,7 @@ private function createCommandTester($application = null): CommandTester { if (!$application) { $application = new BaseApplication(); - $application->add(new YamlLintCommand()); + $application->addCommand(new YamlLintCommand()); } $command = $application->find('lint:yaml'); diff --git a/Tests/Console/ApplicationTest.php b/Tests/Console/ApplicationTest.php index 0b92a813c..7f712107c 100644 --- a/Tests/Console/ApplicationTest.php +++ b/Tests/Console/ApplicationTest.php @@ -119,7 +119,7 @@ public function testBundleCommandCanOverriddeAPreExistingCommandWithTheSameName( $application = new Application($kernel); $newCommand = new Command('example'); - $application->add($newCommand); + $application->addCommand($newCommand); $this->assertSame($newCommand, $application->get('example')); } diff --git a/Tests/Console/Descriptor/AbstractDescriptorTestCase.php b/Tests/Console/Descriptor/AbstractDescriptorTestCase.php index eb18fbcc7..a6cbd3085 100644 --- a/Tests/Console/Descriptor/AbstractDescriptorTestCase.php +++ b/Tests/Console/Descriptor/AbstractDescriptorTestCase.php @@ -11,6 +11,9 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\IgnoreDeprecations; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\FooUnitEnum; use Symfony\Component\Console\Input\ArrayInput; @@ -39,8 +42,8 @@ protected function tearDown(): void putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS'); } - /** @dataProvider getDescribeRouteCollectionTestData */ - public function testDescribeRouteCollection(RouteCollection $routes, $expectedDescription) + #[DataProvider('getDescribeRouteCollectionTestData')] + public function testDescribeRouteCollection(RouteCollection $routes, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $routes); } @@ -50,8 +53,8 @@ public static function getDescribeRouteCollectionTestData(): array return static::getDescriptionTestData(ObjectsProvider::getRouteCollections()); } - /** @dataProvider getDescribeRouteCollectionWithHttpMethodFilterTestData */ - public function testDescribeRouteCollectionWithHttpMethodFilter(string $httpMethod, RouteCollection $routes, $expectedDescription) + #[DataProvider('getDescribeRouteCollectionWithHttpMethodFilterTestData')] + public function testDescribeRouteCollectionWithHttpMethodFilter(string $httpMethod, RouteCollection $routes, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $routes, ['method' => $httpMethod]); } @@ -65,8 +68,8 @@ public static function getDescribeRouteCollectionWithHttpMethodFilterTestData(): } } - /** @dataProvider getDescribeRouteTestData */ - public function testDescribeRoute(Route $route, $expectedDescription) + #[DataProvider('getDescribeRouteTestData')] + public function testDescribeRoute(Route $route, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $route); } @@ -76,8 +79,8 @@ public static function getDescribeRouteTestData(): array return static::getDescriptionTestData(ObjectsProvider::getRoutes()); } - /** @dataProvider getDescribeContainerParametersTestData */ - public function testDescribeContainerParameters(ParameterBag $parameters, $expectedDescription) + #[DataProvider('getDescribeContainerParametersTestData')] + public function testDescribeContainerParameters(ParameterBag $parameters, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $parameters); } @@ -87,8 +90,8 @@ public static function getDescribeContainerParametersTestData(): array return static::getDescriptionTestData(ObjectsProvider::getContainerParameters()); } - /** @dataProvider getDescribeContainerBuilderTestData */ - public function testDescribeContainerBuilder(ContainerBuilder $builder, $expectedDescription, array $options) + #[DataProvider('getDescribeContainerBuilderTestData')] + public function testDescribeContainerBuilder(ContainerBuilder $builder, $expectedDescription, array $options, $file) { $this->assertDescription($expectedDescription, $builder, $options); } @@ -98,10 +101,8 @@ public static function getDescribeContainerBuilderTestData(): array return static::getContainerBuilderDescriptionTestData(ObjectsProvider::getContainerBuilders()); } - /** - * @dataProvider getDescribeContainerExistingClassDefinitionTestData - */ - public function testDescribeContainerExistingClassDefinition(Definition $definition, $expectedDescription) + #[DataProvider('getDescribeContainerExistingClassDefinitionTestData')] + public function testDescribeContainerExistingClassDefinition(Definition $definition, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $definition); } @@ -111,8 +112,8 @@ public static function getDescribeContainerExistingClassDefinitionTestData(): ar return static::getDescriptionTestData(ObjectsProvider::getContainerDefinitionsWithExistingClasses()); } - /** @dataProvider getDescribeContainerDefinitionTestData */ - public function testDescribeContainerDefinition(Definition $definition, $expectedDescription) + #[DataProvider('getDescribeContainerDefinitionTestData')] + public function testDescribeContainerDefinition(Definition $definition, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $definition); } @@ -122,8 +123,8 @@ public static function getDescribeContainerDefinitionTestData(): array return static::getDescriptionTestData(ObjectsProvider::getContainerDefinitions()); } - /** @dataProvider getDescribeContainerDefinitionWithArgumentsShownTestData */ - public function testDescribeContainerDefinitionWithArgumentsShown(Definition $definition, $expectedDescription) + #[DataProvider('getDescribeContainerDefinitionWithArgumentsShownTestData')] + public function testDescribeContainerDefinitionWithArgumentsShown(Definition $definition, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $definition, []); } @@ -142,8 +143,8 @@ public static function getDescribeContainerDefinitionWithArgumentsShownTestData( return static::getDescriptionTestData($definitionsWithArgs); } - /** @dataProvider getDescribeContainerAliasTestData */ - public function testDescribeContainerAlias(Alias $alias, $expectedDescription) + #[DataProvider('getDescribeContainerAliasTestData')] + public function testDescribeContainerAlias(Alias $alias, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $alias); } @@ -153,8 +154,8 @@ public static function getDescribeContainerAliasTestData(): array return static::getDescriptionTestData(ObjectsProvider::getContainerAliases()); } - /** @dataProvider getDescribeContainerDefinitionWhichIsAnAliasTestData */ - public function testDescribeContainerDefinitionWhichIsAnAlias(Alias $alias, $expectedDescription, ContainerBuilder $builder, $options = []) + #[DataProvider('getDescribeContainerDefinitionWhichIsAnAliasTestData')] + public function testDescribeContainerDefinitionWhichIsAnAlias(Alias $alias, $expectedDescription, ContainerBuilder $builder, $options = [], $file = null) { $this->assertDescription($expectedDescription, $builder, $options); } @@ -185,13 +186,12 @@ public static function getDescribeContainerDefinitionWhichIsAnAliasTestData(): a } /** - * The legacy group must be kept as deprecations will always be raised. - * - * @group legacy - * - * @dataProvider getDescribeContainerParameterTestData + * The #[IgnoreDeprecation] attribute must be kept as deprecations will always be raised. */ - public function testDescribeContainerParameter($parameter, $expectedDescription, array $options) + #[IgnoreDeprecations] + #[Group('legacy')] + #[DataProvider('getDescribeContainerParameterTestData')] + public function testDescribeContainerParameter($parameter, $expectedDescription, array $options, $file) { $this->assertDescription($expectedDescription, $parameter, $options); } @@ -213,8 +213,8 @@ public static function getDescribeContainerParameterTestData(): array return $data; } - /** @dataProvider getDescribeEventDispatcherTestData */ - public function testDescribeEventDispatcher(EventDispatcher $eventDispatcher, $expectedDescription, array $options) + #[DataProvider('getDescribeEventDispatcherTestData')] + public function testDescribeEventDispatcher(EventDispatcher $eventDispatcher, $expectedDescription, array $options, $file) { $this->assertDescription($expectedDescription, $eventDispatcher, $options); } @@ -224,8 +224,8 @@ public static function getDescribeEventDispatcherTestData(): array return static::getEventDispatcherDescriptionTestData(ObjectsProvider::getEventDispatchers()); } - /** @dataProvider getDescribeCallableTestData */ - public function testDescribeCallable($callable, $expectedDescription) + #[DataProvider('getDescribeCallableTestData')] + public function testDescribeCallable($callable, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $callable); } @@ -235,12 +235,10 @@ public static function getDescribeCallableTestData(): array return static::getDescriptionTestData(ObjectsProvider::getCallables()); } - /** - * @group legacy - * - * @dataProvider getDescribeDeprecatedCallableTestData - */ - public function testDescribeDeprecatedCallable($callable, $expectedDescription) + #[IgnoreDeprecations] + #[Group('legacy')] + #[DataProvider('getDescribeDeprecatedCallableTestData')] + public function testDescribeDeprecatedCallable($callable, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $callable); } @@ -250,7 +248,7 @@ public static function getDescribeDeprecatedCallableTestData(): array return static::getDescriptionTestData(ObjectsProvider::getDeprecatedCallables()); } - /** @dataProvider getClassDescriptionTestData */ + #[DataProvider('getClassDescriptionTestData')] public function testGetClassDescription($object, $expectedDescription) { $this->assertEquals($expectedDescription, $this->getDescriptor()->getClassDescription($object)); @@ -266,10 +264,8 @@ public static function getClassDescriptionTestData(): array ]; } - /** - * @dataProvider getDeprecationsTestData - */ - public function testGetDeprecations(ContainerBuilder $builder, $expectedDescription) + #[DataProvider('getDeprecationsTestData')] + public function testGetDeprecations(ContainerBuilder $builder, $expectedDescription, $file) { $this->assertDescription($expectedDescription, $builder, ['deprecations' => true]); } @@ -357,7 +353,7 @@ private static function getEventDispatcherDescriptionTestData(array $objects): a return $data; } - /** @dataProvider getDescribeContainerBuilderWithPriorityTagsTestData */ + #[DataProvider('getDescribeContainerBuilderWithPriorityTagsTestData')] public function testDescribeContainerBuilderWithPriorityTags(ContainerBuilder $builder, $expectedDescription, array $options) { $this->assertDescription($expectedDescription, $builder, $options); diff --git a/Tests/Console/Descriptor/ObjectsProvider.php b/Tests/Console/Descriptor/ObjectsProvider.php index 8eb1c4386..07c66e9c8 100644 --- a/Tests/Console/Descriptor/ObjectsProvider.php +++ b/Tests/Console/Descriptor/ObjectsProvider.php @@ -34,7 +34,32 @@ public static function getRouteCollections() $collection1->add($name, $route); } - return ['route_collection_1' => $collection1]; + $routesWithGenericHost = new RouteCollection(); + $routesWithGenericHost->add('some_route', new RouteStub( + '/some-route', + ['_controller' => 'Controller'], + [], + [], + null, + ['https'], + )); + + $routesWithGenericScheme = new RouteCollection(); + $routesWithGenericScheme->add('some_route_with_host', new RouteStub( + '/some-route', + ['_controller' => 'strpos'], + [], + [], + 'symfony.com', + [], + )); + + return [ + 'empty_route_collection' => new RouteCollection(), + 'route_collection_1' => $collection1, + 'route_with_generic_host' => $routesWithGenericHost, + 'route_with_generic_scheme' => $routesWithGenericScheme, + ]; } public static function getRouteCollectionsByHttpMethod(): array diff --git a/Tests/Console/Descriptor/TextDescriptorTest.php b/Tests/Console/Descriptor/TextDescriptorTest.php index 34e16f5e4..101ac68a0 100644 --- a/Tests/Console/Descriptor/TextDescriptorTest.php +++ b/Tests/Console/Descriptor/TextDescriptorTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Bundle\FrameworkBundle\Console\Descriptor\TextDescriptor; use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter; use Symfony\Component\Routing\Route; @@ -45,11 +46,11 @@ public static function getDescribeRouteWithControllerLinkTestData() return $getDescribeData; } - /** @dataProvider getDescribeRouteWithControllerLinkTestData */ - public function testDescribeRouteWithControllerLink(Route $route, $expectedDescription) + #[DataProvider('getDescribeRouteWithControllerLinkTestData')] + public function testDescribeRouteWithControllerLink(Route $route, $expectedDescription, $file) { static::$fileLinkFormatter = new FileLinkFormatter('myeditor://open?file=%f&line=%l'); - parent::testDescribeRoute($route, str_replace('[:file:]', __FILE__, $expectedDescription)); + parent::testDescribeRoute($route, str_replace('[:file:]', __FILE__, $expectedDescription), $file); } } diff --git a/Tests/Controller/AbstractControllerTest.php b/Tests/Controller/AbstractControllerTest.php index 2024cb8f7..0050f46af 100644 --- a/Tests/Controller/AbstractControllerTest.php +++ b/Tests/Controller/AbstractControllerTest.php @@ -11,6 +11,8 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RunInSeparateProcess; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; use Symfony\Component\DependencyInjection\Container; @@ -101,7 +103,7 @@ public function testMissingParameterBag() $controller->setContainer($container); $this->expectException(ServiceNotFoundException::class); - $this->expectExceptionMessage('TestAbstractController::getParameter()" method is missing a parameter bag'); + $this->expectExceptionMessage('::getParameter()" method is missing a parameter bag'); $controller->getParameter('foo'); } @@ -359,12 +361,10 @@ public function testdenyAccessUnlessGranted() ->expects($this->once()) ->method('isGranted') ->willReturnCallback(function ($attribute, $subject, ?AccessDecision $accessDecision = null) { - if (class_exists(AccessDecision::class)) { - $this->assertInstanceOf(AccessDecision::class, $accessDecision); - $accessDecision->votes[] = $vote = new Vote(); - $vote->result = VoterInterface::ACCESS_DENIED; - $vote->reasons[] = 'Why should I.'; - } + $this->assertInstanceOf(AccessDecision::class, $accessDecision); + $accessDecision->votes[] = $vote = new Vote(); + $vote->result = VoterInterface::ACCESS_DENIED; + $vote->reasons[] = 'Why should I.'; return false; }); @@ -376,22 +376,18 @@ public function testdenyAccessUnlessGranted() $controller->setContainer($container); $this->expectException(AccessDeniedException::class); - $this->expectExceptionMessage('Access Denied.'.(class_exists(AccessDecision::class) ? ' Why should I.' : '')); + $this->expectExceptionMessage('Access Denied. Why should I.'); try { $controller->denyAccessUnlessGranted('foo'); } catch (AccessDeniedException $e) { - if (class_exists(AccessDecision::class)) { - $this->assertFalse($e->getAccessDecision()->isGranted); - } + $this->assertFalse($e->getAccessDecision()->isGranted); throw $e; } } - /** - * @dataProvider provideDenyAccessUnlessGrantedSetsAttributesAsArray - */ + #[DataProvider('provideDenyAccessUnlessGrantedSetsAttributesAsArray')] public function testdenyAccessUnlessGrantedSetsAttributesAsArray($attribute, $exceptionAttributes) { $authorizationChecker = $this->createMock(AuthorizationCheckerInterface::class); @@ -526,9 +522,7 @@ public function testRedirectToRoute() $this->assertSame(302, $response->getStatusCode()); } - /** - * @runInSeparateProcess - */ + #[RunInSeparateProcess] public function testAddFlash() { $flashBag = new FlashBag(); diff --git a/Tests/Controller/ControllerHelperTest.php b/Tests/Controller/ControllerHelperTest.php new file mode 100644 index 000000000..cb35c4757 --- /dev/null +++ b/Tests/Controller/ControllerHelperTest.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; + +use Psr\Container\ContainerInterface; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Bundle\FrameworkBundle\Controller\ControllerHelper; + +class ControllerHelperTest extends AbstractControllerTest +{ + protected function createController() + { + return new class extends ControllerHelper { + public function __construct() + { + } + + public function setContainer(ContainerInterface $container) + { + parent::__construct($container); + } + }; + } + + public function testSync() + { + $r = new \ReflectionClass(ControllerHelper::class); + $m = $r->getMethod('getSubscribedServices'); + $helperSrc = file($r->getFileName()); + $helperSrc = implode('', \array_slice($helperSrc, $m->getStartLine() - 1, $r->getEndLine() - $m->getStartLine())); + + $r = new \ReflectionClass(AbstractController::class); + $m = $r->getMethod('getSubscribedServices'); + $abstractSrc = file($r->getFileName()); + $code = [ + implode('', \array_slice($abstractSrc, $m->getStartLine() - 1, $m->getEndLine() - $m->getStartLine() + 1)), + ]; + + foreach ($r->getMethods(\ReflectionMethod::IS_PROTECTED) as $m) { + if ($m->getDocComment()) { + $code[] = ' '.$m->getDocComment(); + } + $code[] = substr_replace(implode('', \array_slice($abstractSrc, $m->getStartLine() - 1, $m->getEndLine() - $m->getStartLine() + 1)), 'public', 4, 9); + } + foreach ($r->getMethods(\ReflectionMethod::IS_PRIVATE) as $m) { + if ($m->getDocComment()) { + $code[] = ' '.$m->getDocComment(); + } + $code[] = implode('', \array_slice($abstractSrc, $m->getStartLine() - 1, $m->getEndLine() - $m->getStartLine() + 1)); + } + $code = implode("\n", $code); + + $this->assertSame($code, $helperSrc, 'Methods from AbstractController are not properly synced in ControllerHelper'); + } +} diff --git a/Tests/Controller/RedirectControllerTest.php b/Tests/Controller/RedirectControllerTest.php index 161424e0e..55f3b33c3 100644 --- a/Tests/Controller/RedirectControllerTest.php +++ b/Tests/Controller/RedirectControllerTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Controller; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Bundle\FrameworkBundle\Controller\RedirectController; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; use Symfony\Component\HttpFoundation\ParameterBag; @@ -60,9 +61,7 @@ public function testEmptyRoute() } } - /** - * @dataProvider provider - */ + #[DataProvider('provider')] public function testRoute($permanent, $keepRequestMethod, $keepQueryParams, $ignoreAttributes, $expectedCode, $expectedAttributes) { $request = new Request(); @@ -255,9 +254,7 @@ public static function urlRedirectProvider(): array ]; } - /** - * @dataProvider urlRedirectProvider - */ + #[DataProvider('urlRedirectProvider')] public function testUrlRedirect($scheme, $httpPort, $httpsPort, $requestScheme, $requestPort, $expectedPort) { $host = 'www.example.com'; @@ -287,9 +284,7 @@ public static function pathQueryParamsProvider(): array ]; } - /** - * @dataProvider pathQueryParamsProvider - */ + #[DataProvider('pathQueryParamsProvider')] public function testPathQueryParams($expectedUrl, $path, $queryString) { $scheme = 'http'; diff --git a/Tests/DependencyInjection/Compiler/ProfilerPassTest.php b/Tests/DependencyInjection/Compiler/ProfilerPassTest.php index 5a2215009..12dfc085d 100644 --- a/Tests/DependencyInjection/Compiler/ProfilerPassTest.php +++ b/Tests/DependencyInjection/Compiler/ProfilerPassTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\DataCollector\AbstractDataCollector; use Symfony\Bundle\FrameworkBundle\DataCollector\TemplateAwareDataCollectorInterface; @@ -98,9 +99,7 @@ public static function getTemplate(): string }]; } - /** - * @dataProvider provideValidCollectorWithTemplateUsingAutoconfigure - */ + #[DataProvider('provideValidCollectorWithTemplateUsingAutoconfigure')] public function testValidCollectorWithTemplateUsingAutoconfigure(TemplateAwareDataCollectorInterface $dataCollector) { $container = new ContainerBuilder(); diff --git a/Tests/DependencyInjection/Compiler/TestServiceContainerRefPassesTest.php b/Tests/DependencyInjection/Compiler/TestServiceContainerRefPassesTest.php index fc69d5bd1..3a6824e4f 100644 --- a/Tests/DependencyInjection/Compiler/TestServiceContainerRefPassesTest.php +++ b/Tests/DependencyInjection/Compiler/TestServiceContainerRefPassesTest.php @@ -33,44 +33,44 @@ public function testProcess() $container->addCompilerPass(new TestServiceContainerWeakRefPass(), PassConfig::TYPE_BEFORE_REMOVING, -32); $container->addCompilerPass(new TestServiceContainerRealRefPass(), PassConfig::TYPE_AFTER_REMOVING); - $container->register('Test\public_service') + $container->register('test.public_service', 'stdClass') ->setPublic(true) - ->addArgument(new Reference('Test\private_used_shared_service')) - ->addArgument(new Reference('Test\private_used_non_shared_service')) - ->addArgument(new Reference('Test\soon_private_service')) + ->addArgument(new Reference('test.private_used_shared_service')) + ->addArgument(new Reference('test.private_used_non_shared_service')) + ->addArgument(new Reference('test.soon_private_service')) ; - $container->register('Test\soon_private_service') + $container->register('test.soon_private_service', 'stdClass') ->setPublic(true) ->addTag('container.private', ['package' => 'foo/bar', 'version' => '1.42']) ; - $container->register('Test\soon_private_service_decorated') + $container->register('test.soon_private_service_decorated', 'stdClass') ->setPublic(true) ->addTag('container.private', ['package' => 'foo/bar', 'version' => '1.42']) ; - $container->register('Test\soon_private_service_decorator') - ->setDecoratedService('Test\soon_private_service_decorated') - ->setArguments(['Test\soon_private_service_decorator.inner']); + $container->register('test.soon_private_service_decorator', 'stdClass') + ->setDecoratedService('test.soon_private_service_decorated') + ->setArguments(['test.soon_private_service_decorator.inner']); - $container->register('Test\private_used_shared_service'); - $container->register('Test\private_unused_shared_service'); - $container->register('Test\private_used_non_shared_service')->setShared(false); - $container->register('Test\private_unused_non_shared_service')->setShared(false); + $container->register('test.private_used_shared_service', 'stdClass'); + $container->register('test.private_unused_shared_service', 'stdClass'); + $container->register('test.private_used_non_shared_service', 'stdClass')->setShared(false); + $container->register('test.private_unused_non_shared_service', 'stdClass')->setShared(false); $container->compile(); $expected = [ - 'Test\private_used_shared_service' => new ServiceClosureArgument(new Reference('Test\private_used_shared_service')), - 'Test\private_used_non_shared_service' => new ServiceClosureArgument(new Reference('Test\private_used_non_shared_service')), - 'Test\soon_private_service' => new ServiceClosureArgument(new Reference('.container.private.Test\soon_private_service')), - 'Test\soon_private_service_decorator' => new ServiceClosureArgument(new Reference('.container.private.Test\soon_private_service_decorated')), - 'Test\soon_private_service_decorated' => new ServiceClosureArgument(new Reference('.container.private.Test\soon_private_service_decorated')), + 'test.private_used_shared_service' => new ServiceClosureArgument(new Reference('test.private_used_shared_service')), + 'test.private_used_non_shared_service' => new ServiceClosureArgument(new Reference('test.private_used_non_shared_service')), + 'test.soon_private_service' => new ServiceClosureArgument(new Reference('.container.private.test.soon_private_service')), + 'test.soon_private_service_decorator' => new ServiceClosureArgument(new Reference('.container.private.test.soon_private_service_decorated')), + 'test.soon_private_service_decorated' => new ServiceClosureArgument(new Reference('.container.private.test.soon_private_service_decorated')), ]; $privateServices = $container->getDefinition('test.private_services_locator')->getArgument(0); unset($privateServices[\Symfony\Component\DependencyInjection\ContainerInterface::class], $privateServices[ContainerInterface::class]); $this->assertEquals($expected, $privateServices); - $this->assertFalse($container->getDefinition('Test\private_used_non_shared_service')->isShared()); + $this->assertFalse($container->getDefinition('test.private_used_non_shared_service')->isShared()); } } diff --git a/Tests/DependencyInjection/Compiler/UnusedTagsPassUtils.php b/Tests/DependencyInjection/Compiler/UnusedTagsPassUtils.php index 5bbd93722..35f1e52a6 100644 --- a/Tests/DependencyInjection/Compiler/UnusedTagsPassUtils.php +++ b/Tests/DependencyInjection/Compiler/UnusedTagsPassUtils.php @@ -19,6 +19,7 @@ public static function getDefinedTags(): array { $tags = [ 'proxy' => true, + 'routing.controller' => true, ]; // get all tags used in XML configs diff --git a/Tests/DependencyInjection/ConfigurationTest.php b/Tests/DependencyInjection/ConfigurationTest.php index c8142e98a..83c5929c2 100644 --- a/Tests/DependencyInjection/ConfigurationTest.php +++ b/Tests/DependencyInjection/ConfigurationTest.php @@ -12,6 +12,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection; use Doctrine\DBAL\Connection; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\DependencyInjection\Configuration; use Symfony\Bundle\FullStack; @@ -25,7 +26,6 @@ use Symfony\Component\JsonStreamer\JsonStreamWriter; use Symfony\Component\Lock\Store\SemaphoreStore; use Symfony\Component\Mailer\Mailer; -use Symfony\Component\Messenger\MessageBusInterface; use Symfony\Component\Notifier\Notifier; use Symfony\Component\RateLimiter\Policy\TokenBucketLimiter; use Symfony\Component\RemoteEvent\RemoteEvent; @@ -41,9 +41,6 @@ public function testDefaultConfig() { $processor = new Processor(); $config = $processor->processConfiguration(new Configuration(true), [[ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'secret' => 's3cr3t', 'serializer' => ['default_context' => ['foo' => 'bar']], ]]); @@ -61,9 +58,7 @@ public function getTestValidSessionName() ]; } - /** - * @dataProvider getTestInvalidSessionName - */ + #[DataProvider('getTestInvalidSessionName')] public function testInvalidSessionName($sessionName) { $processor = new Processor(); @@ -73,9 +68,6 @@ public function testInvalidSessionName($sessionName) $processor->processConfiguration( new Configuration(true), [[ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'session' => ['name' => $sessionName, 'cookie_secure' => 'auto', 'cookie_samesite' => 'lax'], ]] ); @@ -98,9 +90,6 @@ public function testAssetsCanBeEnabled() $processor = new Processor(); $configuration = new Configuration(true); $config = $processor->processConfiguration($configuration, [[ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'assets' => null, ]]); @@ -124,9 +113,6 @@ public function testAssetMapperCanBeEnabled() $processor = new Processor(); $configuration = new Configuration(true); $config = $processor->processConfiguration($configuration, [[ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'asset_mapper' => null, ]]); @@ -146,16 +132,14 @@ public function testAssetMapperCanBeEnabled() 'precompress' => [ 'enabled' => false, 'formats' => [], - 'extensions' => interface_exists(CompressorInterface::class) ? CompressorInterface::DEFAULT_EXTENSIONS : [], + 'extensions' => CompressorInterface::DEFAULT_EXTENSIONS, ], ]; $this->assertEquals($defaultConfig, $config['asset_mapper']); } - /** - * @dataProvider provideImportmapPolyfillTests - */ + #[DataProvider('provideImportmapPolyfillTests')] public function testAssetMapperPolyfillValue(mixed $polyfillValue, bool $isValid, mixed $expected) { $processor = new Processor(); @@ -167,9 +151,6 @@ public function testAssetMapperPolyfillValue(mixed $polyfillValue, bool $isValid } $config = $processor->processConfiguration($configuration, [[ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'asset_mapper' => null === $polyfillValue ? [] : [ 'importmap_polyfill' => $polyfillValue, ], @@ -189,18 +170,13 @@ public static function provideImportmapPolyfillTests() yield [false, true, false]; } - /** - * @dataProvider provideValidAssetsPackageNameConfigurationTests - */ + #[DataProvider('provideValidAssetsPackageNameConfigurationTests')] public function testValidAssetsPackageNameConfiguration($packageName) { $processor = new Processor(); $configuration = new Configuration(true); $config = $processor->processConfiguration($configuration, [ [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'assets' => [ 'packages' => [ $packageName => [], @@ -221,9 +197,7 @@ public static function provideValidAssetsPackageNameConfigurationTests(): array ]; } - /** - * @dataProvider provideInvalidAssetConfigurationTests - */ + #[DataProvider('provideInvalidAssetConfigurationTests')] public function testInvalidAssetsConfiguration(array $assetConfig, $expectedMessage) { $processor = new Processor(); @@ -234,9 +208,6 @@ public function testInvalidAssetsConfiguration(array $assetConfig, $expectedMess $processor->processConfiguration($configuration, [ [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'assets' => $assetConfig, ], ]); @@ -275,21 +246,14 @@ public static function provideInvalidAssetConfigurationTests(): iterable yield [$createPackageConfig($config), 'You cannot use both "version" and "json_manifest_path" at the same time under "assets" packages.']; } - /** - * @dataProvider provideValidLockConfigurationTests - */ + #[DataProvider('provideValidLockConfigurationTests')] public function testValidLockConfiguration($lockConfig, $processedConfig) { $processor = new Processor(); $configuration = new Configuration(true); - $config = $processor->processConfiguration($configuration, [ - [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'lock' => $lockConfig, - ], - ]); + $config = $processor->processConfiguration($configuration, [[ + 'lock' => $lockConfig, + ]]); $this->assertArrayHasKey('lock', $config); @@ -347,20 +311,10 @@ public function testLockMergeConfigs() $configuration = new Configuration(true); $config = $processor->processConfiguration($configuration, [ [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'lock' => [ - 'payload' => 'flock', - ], + 'lock' => ['payload' => 'flock'], ], [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'lock' => [ - 'payload' => 'semaphore', - ], + 'lock' => ['payload' => 'semaphore'], ], ]); @@ -375,21 +329,14 @@ public function testLockMergeConfigs() ); } - /** - * @dataProvider provideValidSemaphoreConfigurationTests - */ + #[DataProvider('provideValidSemaphoreConfigurationTests')] public function testValidSemaphoreConfiguration($semaphoreConfig, $processedConfig) { $processor = new Processor(); $configuration = new Configuration(true); - $config = $processor->processConfiguration($configuration, [ - [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'semaphore' => $semaphoreConfig, - ], - ]); + $config = $processor->processConfiguration($configuration, [[ + 'semaphore' => $semaphoreConfig, + ]]); $this->assertArrayHasKey('semaphore', $config); @@ -439,9 +386,6 @@ public function testItShowANiceMessageIfTwoMessengerBusesAreConfiguredButNoDefau $processor->processConfiguration($configuration, [ 'framework' => [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => [ 'default_bus' => null, 'buses' => [ @@ -459,9 +403,6 @@ public function testBusMiddlewareDontMerge() $configuration = new Configuration(true); $config = $processor->processConfiguration($configuration, [ [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => [ 'default_bus' => 'existing_bus', 'buses' => [ @@ -476,9 +417,6 @@ public function testBusMiddlewareDontMerge() ], ], [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => [ 'buses' => [ 'common_bus' => [ @@ -525,20 +463,15 @@ public function testItErrorsWhenDefaultBusDoesNotExist() $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('The specified default bus "foo" is not configured. Available buses are "bar", "baz".'); - $processor->processConfiguration($configuration, [ - [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'messenger' => [ - 'default_bus' => 'foo', - 'buses' => [ - 'bar' => null, - 'baz' => null, - ], + $processor->processConfiguration($configuration, [[ + 'messenger' => [ + 'default_bus' => 'foo', + 'buses' => [ + 'bar' => null, + 'baz' => null, ], ], - ]); + ]]); } public function testLockCanBeDisabled() @@ -546,14 +479,9 @@ public function testLockCanBeDisabled() $processor = new Processor(); $configuration = new Configuration(true); - $config = $processor->processConfiguration($configuration, [ - [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'lock' => ['enabled' => false], - ], - ]); + $config = $processor->processConfiguration($configuration, [[ + 'lock' => ['enabled' => false], + ]]); $this->assertFalse($config['lock']['enabled']); } @@ -566,31 +494,21 @@ public function testEnabledLockNeedsResources() $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage('Invalid configuration for path "framework.lock": At least one resource must be defined.'); - $processor->processConfiguration($configuration, [ - [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'lock' => ['enabled' => true], - ], - ]); + $processor->processConfiguration($configuration, [[ + 'lock' => ['enabled' => true], + ]]); } public function testSerializerJsonDetailedErrorMessagesEnabledWhenDefaultContextIsConfigured() { $processor = new Processor(); - $config = $processor->processConfiguration(new Configuration(true), [ - [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'serializer' => [ - 'default_context' => [ - 'foo' => 'bar', - ], + $config = $processor->processConfiguration(new Configuration(true), [[ + 'serializer' => [ + 'default_context' => [ + 'foo' => 'bar', ], ], - ]); + ]]); $this->assertSame(['foo' => 'bar', JsonDecode::DETAILED_ERROR_MESSAGES => true], $config['serializer']['default_context'] ?? []); } @@ -598,19 +516,14 @@ public function testSerializerJsonDetailedErrorMessagesEnabledWhenDefaultContext public function testSerializerJsonDetailedErrorMessagesInDefaultContextCanBeDisabled() { $processor = new Processor(); - $config = $processor->processConfiguration(new Configuration(true), [ - [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'serializer' => [ - 'default_context' => [ - 'foo' => 'bar', - JsonDecode::DETAILED_ERROR_MESSAGES => false, - ], + $config = $processor->processConfiguration(new Configuration(true), [[ + 'serializer' => [ + 'default_context' => [ + 'foo' => 'bar', + JsonDecode::DETAILED_ERROR_MESSAGES => false, ], ], - ]); + ]]); $this->assertSame(['foo' => 'bar', JsonDecode::DETAILED_ERROR_MESSAGES => false], $config['serializer']['default_context'] ?? []); } @@ -620,9 +533,6 @@ public function testSerializerJsonDetailedErrorMessagesInDefaultContextCanBeDisa $processor = new Processor(); $config = $processor->processConfiguration(new Configuration(true), [ [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'serializer' => [ 'default_context' => [ 'foo' => 'bar', @@ -766,7 +676,7 @@ protected static function getBundleDefaultConfig() 'dsn' => 'file:%kernel.cache_dir%/profiler', 'collect' => true, 'collect_parameter' => null, - 'collect_serializer_data' => false, + 'collect_serializer_data' => true, ], 'translator' => [ 'enabled' => !class_exists(FullStack::class), @@ -803,9 +713,6 @@ protected static function getBundleDefaultConfig() ], 'email_validation_mode' => 'html5', ], - 'annotations' => [ - 'enabled' => false, - ], 'serializer' => [ 'default_context' => ['foo' => 'bar', JsonDecode::DETAILED_ERROR_MESSAGES => true], 'enabled' => true, @@ -823,10 +730,12 @@ protected static function getBundleDefaultConfig() ], 'type_info' => [ 'enabled' => !class_exists(FullStack::class) && class_exists(Type::class), + 'aliases' => [], ], 'property_info' => [ 'enabled' => !class_exists(FullStack::class), - ] + (!class_exists(FullStack::class) ? ['with_constructor_extractor' => false] : []), + 'with_constructor_extractor' => true, + ], 'router' => [ 'enabled' => false, 'default_uri' => null, @@ -834,7 +743,6 @@ protected static function getBundleDefaultConfig() 'https_port' => 443, 'strict_requirements' => true, 'utf8' => true, - 'cache_dir' => '%kernel.build_dir%', ], 'session' => [ 'enabled' => false, @@ -875,7 +783,7 @@ protected static function getBundleDefaultConfig() 'precompress' => [ 'enabled' => false, 'formats' => [], - 'extensions' => interface_exists(CompressorInterface::class) ? CompressorInterface::DEFAULT_EXTENSIONS : [], + 'extensions' => CompressorInterface::DEFAULT_EXTENSIONS, ], ], 'cache' => [ @@ -915,7 +823,7 @@ class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphor ], ], 'messenger' => [ - 'enabled' => !class_exists(FullStack::class) && interface_exists(MessageBusInterface::class), + 'enabled' => !class_exists(FullStack::class), 'routing' => [], 'transports' => [], 'failure_transport' => null, diff --git a/Tests/DependencyInjection/Fixtures/Workflow/Places.php b/Tests/DependencyInjection/Fixtures/Workflow/Places.php new file mode 100644 index 000000000..47a6b5a4c --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/Workflow/Places.php @@ -0,0 +1,10 @@ +loadFromExtension('framework', [ - 'annotations' => false, 'asset_mapper' => null, 'assets' => false, - 'handle_all_throwables' => true, - 'http_method_override' => false, - 'php_errors' => ['log' => true], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/assets.php b/Tests/DependencyInjection/Fixtures/php/assets.php index 2ad9a990c..f26621001 100644 --- a/Tests/DependencyInjection/Fixtures/php/assets.php +++ b/Tests/DependencyInjection/Fixtures/php/assets.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'assets' => [ 'version' => 'SomeVersionScheme', 'base_urls' => 'http://cdn.example.com', diff --git a/Tests/DependencyInjection/Fixtures/php/assets_disabled.php b/Tests/DependencyInjection/Fixtures/php/assets_disabled.php index 419a3759e..d10595fba 100644 --- a/Tests/DependencyInjection/Fixtures/php/assets_disabled.php +++ b/Tests/DependencyInjection/Fixtures/php/assets_disabled.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'assets' => [ 'enabled' => false, ], diff --git a/Tests/DependencyInjection/Fixtures/php/assets_version_strategy_as_service.php b/Tests/DependencyInjection/Fixtures/php/assets_version_strategy_as_service.php index 5d49e5b56..b57f78ba4 100644 --- a/Tests/DependencyInjection/Fixtures/php/assets_version_strategy_as_service.php +++ b/Tests/DependencyInjection/Fixtures/php/assets_version_strategy_as_service.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'assets' => [ 'version_strategy' => 'assets.custom_version_strategy', 'base_urls' => 'http://cdn.example.com', diff --git a/Tests/DependencyInjection/Fixtures/php/cache.php b/Tests/DependencyInjection/Fixtures/php/cache.php index 8b443c3c9..9ca04b6c6 100644 --- a/Tests/DependencyInjection/Fixtures/php/cache.php +++ b/Tests/DependencyInjection/Fixtures/php/cache.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'cache' => [ 'pools' => [ 'cache.foo' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware.php b/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware.php index 604b03c9f..44855c62a 100644 --- a/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware.php +++ b/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'cache' => [ 'app' => 'cache.adapter.redis_tag_aware', ], diff --git a/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware_pool.php b/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware_pool.php index 7e653ec96..bf3ee2de2 100644 --- a/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware_pool.php +++ b/Tests/DependencyInjection/Fixtures/php/cache_app_redis_tag_aware_pool.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'cache' => [ 'app' => 'cache.redis_tag_aware.foo', 'pools' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/csrf.php b/Tests/DependencyInjection/Fixtures/php/csrf.php index c7fc47062..271cbf216 100644 --- a/Tests/DependencyInjection/Fixtures/php/csrf.php +++ b/Tests/DependencyInjection/Fixtures/php/csrf.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'csrf_protection' => true, 'session' => [ 'storage_factory_id' => 'session.storage.factory.native', diff --git a/Tests/DependencyInjection/Fixtures/php/csrf_needs_session.php b/Tests/DependencyInjection/Fixtures/php/csrf_needs_session.php index b1fea63ab..34fdb4c1f 100644 --- a/Tests/DependencyInjection/Fixtures/php/csrf_needs_session.php +++ b/Tests/DependencyInjection/Fixtures/php/csrf_needs_session.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'csrf_protection' => [ 'enabled' => true, ], diff --git a/Tests/DependencyInjection/Fixtures/php/default_config.php b/Tests/DependencyInjection/Fixtures/php/default_config.php index fdcf05275..f1649c3dd 100644 --- a/Tests/DependencyInjection/Fixtures/php/default_config.php +++ b/Tests/DependencyInjection/Fixtures/php/default_config.php @@ -1,8 +1,4 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/esi_and_ssi_without_fragments.php b/Tests/DependencyInjection/Fixtures/php/esi_and_ssi_without_fragments.php index 925e54bf0..beada36b8 100644 --- a/Tests/DependencyInjection/Fixtures/php/esi_and_ssi_without_fragments.php +++ b/Tests/DependencyInjection/Fixtures/php/esi_and_ssi_without_fragments.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'fragments' => [ 'enabled' => false, ], diff --git a/Tests/DependencyInjection/Fixtures/php/esi_disabled.php b/Tests/DependencyInjection/Fixtures/php/esi_disabled.php index f40d47c99..a24cd8158 100644 --- a/Tests/DependencyInjection/Fixtures/php/esi_disabled.php +++ b/Tests/DependencyInjection/Fixtures/php/esi_disabled.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'esi' => [ 'enabled' => false, ], diff --git a/Tests/DependencyInjection/Fixtures/php/exceptions.php b/Tests/DependencyInjection/Fixtures/php/exceptions.php index ab04acb64..96b128f97 100644 --- a/Tests/DependencyInjection/Fixtures/php/exceptions.php +++ b/Tests/DependencyInjection/Fixtures/php/exceptions.php @@ -6,10 +6,6 @@ use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'exceptions' => [ BadRequestHttpException::class => [ 'log_level' => 'info', diff --git a/Tests/DependencyInjection/Fixtures/php/form_csrf_disabled.php b/Tests/DependencyInjection/Fixtures/php/form_csrf_disabled.php index 981498609..bd482c48d 100644 --- a/Tests/DependencyInjection/Fixtures/php/form_csrf_disabled.php +++ b/Tests/DependencyInjection/Fixtures/php/form_csrf_disabled.php @@ -1,12 +1,8 @@ loadFromExtension('framework', [ - 'annotations' => false, 'csrf_protection' => false, 'form' => [ 'csrf_protection' => true, ], - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/form_csrf_field_attr.php b/Tests/DependencyInjection/Fixtures/php/form_csrf_field_attr.php index 103ee4797..9015f8251 100644 --- a/Tests/DependencyInjection/Fixtures/php/form_csrf_field_attr.php +++ b/Tests/DependencyInjection/Fixtures/php/form_csrf_field_attr.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'csrf_protection' => [ 'enabled' => true, ], diff --git a/Tests/DependencyInjection/Fixtures/php/form_default_csrf.php b/Tests/DependencyInjection/Fixtures/php/form_default_csrf.php index 066807995..7bf017e52 100644 --- a/Tests/DependencyInjection/Fixtures/php/form_default_csrf.php +++ b/Tests/DependencyInjection/Fixtures/php/form_default_csrf.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'session' => [ 'storage_factory_id' => 'session.storage.factory.native', 'handler_id' => null, diff --git a/Tests/DependencyInjection/Fixtures/php/form_no_csrf.php b/Tests/DependencyInjection/Fixtures/php/form_no_csrf.php index 7c052c9ff..e0befdb32 100644 --- a/Tests/DependencyInjection/Fixtures/php/form_no_csrf.php +++ b/Tests/DependencyInjection/Fixtures/php/form_no_csrf.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'form' => [ 'csrf_protection' => [ 'enabled' => false, diff --git a/Tests/DependencyInjection/Fixtures/php/fragments_and_hinclude.php b/Tests/DependencyInjection/Fixtures/php/fragments_and_hinclude.php index 0fcffdbe4..dbcf5b786 100644 --- a/Tests/DependencyInjection/Fixtures/php/fragments_and_hinclude.php +++ b/Tests/DependencyInjection/Fixtures/php/fragments_and_hinclude.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'fragments' => [ 'enabled' => true, 'hinclude_default_template' => 'global_hinclude_template', diff --git a/Tests/DependencyInjection/Fixtures/php/full.php b/Tests/DependencyInjection/Fixtures/php/full.php index cb7762829..21d36ecf6 100644 --- a/Tests/DependencyInjection/Fixtures/php/full.php +++ b/Tests/DependencyInjection/Fixtures/php/full.php @@ -58,7 +58,6 @@ 'enabled' => true, 'email_validation_mode' => 'html5', ], - 'annotations' => false, 'serializer' => [ 'enabled' => true, 'enable_attributes' => true, @@ -74,10 +73,7 @@ ], ], ], - 'property_info' => [ - 'enabled' => true, - 'with_constructor_extractor' => true, - ], + 'property_info' => true, 'type_info' => true, 'ide' => 'file%%link%%format', 'request' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/html_sanitizer.php b/Tests/DependencyInjection/Fixtures/php/html_sanitizer.php index 1b64cd1b3..fb0116303 100644 --- a/Tests/DependencyInjection/Fixtures/php/html_sanitizer.php +++ b/Tests/DependencyInjection/Fixtures/php/html_sanitizer.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'html_sanitizer' => [ 'sanitizers' => [ 'custom' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_allowed_link_and_media_hosts.php b/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_allowed_link_and_media_hosts.php index f7781cf28..0a78ded06 100644 --- a/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_allowed_link_and_media_hosts.php +++ b/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_allowed_link_and_media_hosts.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'html_sanitizer' => [ 'sanitizers' => [ 'custom_default' => null, diff --git a/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_config.php b/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_config.php index ddf327a8c..1c1142639 100644 --- a/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_config.php +++ b/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_config.php @@ -1,8 +1,4 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'html_sanitizer' => null]); diff --git a/Tests/DependencyInjection/Fixtures/php/http_client_default_options.php b/Tests/DependencyInjection/Fixtures/php/http_client_default_options.php index b050685f4..5f71a9284 100644 --- a/Tests/DependencyInjection/Fixtures/php/http_client_default_options.php +++ b/Tests/DependencyInjection/Fixtures/php/http_client_default_options.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'http_client' => [ 'max_host_connections' => 4, 'default_options' => null, diff --git a/Tests/DependencyInjection/Fixtures/php/http_client_full_default_options.php b/Tests/DependencyInjection/Fixtures/php/http_client_full_default_options.php index e25640b79..255552b07 100644 --- a/Tests/DependencyInjection/Fixtures/php/http_client_full_default_options.php +++ b/Tests/DependencyInjection/Fixtures/php/http_client_full_default_options.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'http_client' => [ 'default_options' => [ 'headers' => ['X-powered' => 'PHP'], diff --git a/Tests/DependencyInjection/Fixtures/php/http_client_mock_response_factory.php b/Tests/DependencyInjection/Fixtures/php/http_client_mock_response_factory.php index 326f0d25d..5b64c3ae0 100644 --- a/Tests/DependencyInjection/Fixtures/php/http_client_mock_response_factory.php +++ b/Tests/DependencyInjection/Fixtures/php/http_client_mock_response_factory.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'http_client' => [ 'default_options' => null, 'mock_response_factory' => 'my_response_factory', diff --git a/Tests/DependencyInjection/Fixtures/php/http_client_override_default_options.php b/Tests/DependencyInjection/Fixtures/php/http_client_override_default_options.php index f028efa21..9c5208199 100644 --- a/Tests/DependencyInjection/Fixtures/php/http_client_override_default_options.php +++ b/Tests/DependencyInjection/Fixtures/php/http_client_override_default_options.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'http_client' => [ 'max_host_connections' => 4, 'default_options' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/http_client_rate_limiter.php b/Tests/DependencyInjection/Fixtures/php/http_client_rate_limiter.php index c8256d913..55fe2f9fc 100644 --- a/Tests/DependencyInjection/Fixtures/php/http_client_rate_limiter.php +++ b/Tests/DependencyInjection/Fixtures/php/http_client_rate_limiter.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'rate_limiter' => [ 'foo_limiter' => [ 'lock_factory' => null, diff --git a/Tests/DependencyInjection/Fixtures/php/http_client_retry.php b/Tests/DependencyInjection/Fixtures/php/http_client_retry.php index 28205f8e4..f2ab01d1e 100644 --- a/Tests/DependencyInjection/Fixtures/php/http_client_retry.php +++ b/Tests/DependencyInjection/Fixtures/php/http_client_retry.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'http_client' => [ 'default_options' => [ 'retry_failed' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/http_client_scoped_without_query_option.php b/Tests/DependencyInjection/Fixtures/php/http_client_scoped_without_query_option.php index ccc75d99d..0d3dc8847 100644 --- a/Tests/DependencyInjection/Fixtures/php/http_client_scoped_without_query_option.php +++ b/Tests/DependencyInjection/Fixtures/php/http_client_scoped_without_query_option.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'http_client' => [ 'scoped_clients' => [ 'foo' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/http_client_xml_key.php b/Tests/DependencyInjection/Fixtures/php/http_client_xml_key.php index bb8a91dc1..64778c615 100644 --- a/Tests/DependencyInjection/Fixtures/php/http_client_xml_key.php +++ b/Tests/DependencyInjection/Fixtures/php/http_client_xml_key.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'http_client' => [ 'default_options' => [ 'resolve' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/json_streamer.php b/Tests/DependencyInjection/Fixtures/php/json_streamer.php index 844b72004..b6b7427dd 100644 --- a/Tests/DependencyInjection/Fixtures/php/json_streamer.php +++ b/Tests/DependencyInjection/Fixtures/php/json_streamer.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'type_info' => [ 'enabled' => true, ], diff --git a/Tests/DependencyInjection/Fixtures/php/lock.php b/Tests/DependencyInjection/Fixtures/php/lock.php index 116e074df..ddcb443b6 100644 --- a/Tests/DependencyInjection/Fixtures/php/lock.php +++ b/Tests/DependencyInjection/Fixtures/php/lock.php @@ -1,9 +1,5 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'lock' => null, ]); diff --git a/Tests/DependencyInjection/Fixtures/php/lock_named.php b/Tests/DependencyInjection/Fixtures/php/lock_named.php index c03a7fa71..37bc4401f 100644 --- a/Tests/DependencyInjection/Fixtures/php/lock_named.php +++ b/Tests/DependencyInjection/Fixtures/php/lock_named.php @@ -3,10 +3,6 @@ $container->setParameter('env(REDIS_DSN)', 'redis://paas.com'); $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'lock' => [ 'foo' => 'semaphore', 'bar' => 'flock', diff --git a/Tests/DependencyInjection/Fixtures/php/lock_service.php b/Tests/DependencyInjection/Fixtures/php/lock_service.php index 4bdbd29b8..83316c872 100644 --- a/Tests/DependencyInjection/Fixtures/php/lock_service.php +++ b/Tests/DependencyInjection/Fixtures/php/lock_service.php @@ -3,9 +3,5 @@ $container->register('my_service', \Redis::class); $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'lock' => 'my_service', ]); diff --git a/Tests/DependencyInjection/Fixtures/php/mailer.php b/Tests/DependencyInjection/Fixtures/php/mailer.php index bab6b4cc5..5e3093b33 100644 --- a/Tests/DependencyInjection/Fixtures/php/mailer.php +++ b/Tests/DependencyInjection/Fixtures/php/mailer.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'mailer' => [ 'dsn' => 'smtp://example.com', 'envelope' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/mailer_with_disabled_message_bus.php b/Tests/DependencyInjection/Fixtures/php/mailer_with_disabled_message_bus.php index 887a588b0..4f2471ed9 100644 --- a/Tests/DependencyInjection/Fixtures/php/mailer_with_disabled_message_bus.php +++ b/Tests/DependencyInjection/Fixtures/php/mailer_with_disabled_message_bus.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'mailer' => [ 'dsn' => 'smtp://example.com', 'message_bus' => false, diff --git a/Tests/DependencyInjection/Fixtures/php/mailer_with_dsn.php b/Tests/DependencyInjection/Fixtures/php/mailer_with_dsn.php index 3357bf354..e163dbfb1 100644 --- a/Tests/DependencyInjection/Fixtures/php/mailer_with_dsn.php +++ b/Tests/DependencyInjection/Fixtures/php/mailer_with_dsn.php @@ -4,10 +4,6 @@ return static function (ContainerConfigurator $container) { $container->extension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'mailer' => [ 'dsn' => 'smtp://example.com', 'envelope' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/mailer_with_specific_message_bus.php b/Tests/DependencyInjection/Fixtures/php/mailer_with_specific_message_bus.php index e07cc0c6c..32b936af9 100644 --- a/Tests/DependencyInjection/Fixtures/php/mailer_with_specific_message_bus.php +++ b/Tests/DependencyInjection/Fixtures/php/mailer_with_specific_message_bus.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'mailer' => [ 'dsn' => 'smtp://example.com', 'message_bus' => 'app.another_bus', diff --git a/Tests/DependencyInjection/Fixtures/php/mailer_with_transports.php b/Tests/DependencyInjection/Fixtures/php/mailer_with_transports.php index e51fd056b..f9c95bba6 100644 --- a/Tests/DependencyInjection/Fixtures/php/mailer_with_transports.php +++ b/Tests/DependencyInjection/Fixtures/php/mailer_with_transports.php @@ -4,10 +4,6 @@ return static function (ContainerConfigurator $container) { $container->extension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'mailer' => [ 'transports' => [ 'transport1' => 'smtp://example1.com', diff --git a/Tests/DependencyInjection/Fixtures/php/messenger.php b/Tests/DependencyInjection/Fixtures/php/messenger.php index bbdf50697..0400b6bc7 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger.php @@ -4,10 +4,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\FooMessage; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'scheduler' => true, 'messenger' => [ 'routing' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php b/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php index 452594d45..999998ba5 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_bus_name_stamp.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'lock' => false, 'messenger' => [ 'default_bus' => 'messenger.bus.commands', diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_disabled.php b/Tests/DependencyInjection/Fixtures/php/messenger_disabled.php index 0ce448781..18edef40a 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_disabled.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_disabled.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => false, 'scheduler' => false, ]); diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_middleware_factory_erroneous_format.php b/Tests/DependencyInjection/Fixtures/php/messenger_middleware_factory_erroneous_format.php index 97676ae90..cb4ee5e51 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_middleware_factory_erroneous_format.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_middleware_factory_erroneous_format.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => [ 'buses' => [ 'command_bus' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_multiple_buses_with_deduplicate_middleware.php b/Tests/DependencyInjection/Fixtures/php/messenger_multiple_buses_with_deduplicate_middleware.php index f9b3767c0..91aa6a662 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_multiple_buses_with_deduplicate_middleware.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_multiple_buses_with_deduplicate_middleware.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'lock' => null, 'messenger' => [ 'default_bus' => 'messenger.bus.commands', diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_multiple_buses_without_deduplicate_middleware.php b/Tests/DependencyInjection/Fixtures/php/messenger_multiple_buses_without_deduplicate_middleware.php index fd4a00834..1beb1e593 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_multiple_buses_without_deduplicate_middleware.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_multiple_buses_without_deduplicate_middleware.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'lock' => false, 'messenger' => [ 'default_bus' => 'messenger.bus.commands', diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_multiple_failure_transports.php b/Tests/DependencyInjection/Fixtures/php/messenger_multiple_failure_transports.php index 1fa698076..691510c3a 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_multiple_failure_transports.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_multiple_failure_transports.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => [ 'transports' => [ 'transport_1' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_multiple_failure_transports_global.php b/Tests/DependencyInjection/Fixtures/php/messenger_multiple_failure_transports_global.php index 763db88a8..c4fcb93d2 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_multiple_failure_transports_global.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_multiple_failure_transports_global.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => [ 'failure_transport' => 'failure_transport_global', 'transports' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_routing.php b/Tests/DependencyInjection/Fixtures/php/messenger_routing.php index 8c0b90eda..c21281ffa 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_routing.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_routing.php @@ -4,10 +4,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\SecondMessage; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'serializer' => true, 'messenger' => [ 'serializer' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_routing_invalid_transport.php b/Tests/DependencyInjection/Fixtures/php/messenger_routing_invalid_transport.php index c61a673ca..e18c055f3 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_routing_invalid_transport.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_routing_invalid_transport.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'serializer' => true, 'messenger' => [ 'serializer' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_routing_invalid_wildcard.php b/Tests/DependencyInjection/Fixtures/php/messenger_routing_invalid_wildcard.php index 476734936..8d85a10e2 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_routing_invalid_wildcard.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_routing_invalid_wildcard.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'serializer' => true, 'messenger' => [ 'serializer' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_routing_single.php b/Tests/DependencyInjection/Fixtures/php/messenger_routing_single.php index d2d84cf65..b3490d41a 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_routing_single.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_routing_single.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => [ 'routing' => [ DummyMessage::class => ['amqp'], diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_transport.php b/Tests/DependencyInjection/Fixtures/php/messenger_transport.php index 900909696..7baab29dc 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_transport.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_transport.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'serializer' => true, 'messenger' => [ 'serializer' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/messenger_transports.php b/Tests/DependencyInjection/Fixtures/php/messenger_transports.php index a010da534..a1175a695 100644 --- a/Tests/DependencyInjection/Fixtures/php/messenger_transports.php +++ b/Tests/DependencyInjection/Fixtures/php/messenger_transports.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'serializer' => true, 'messenger' => [ 'failure_transport' => 'failed', diff --git a/Tests/DependencyInjection/Fixtures/php/notifier.php b/Tests/DependencyInjection/Fixtures/php/notifier.php index 058ec7175..f740f9f57 100644 --- a/Tests/DependencyInjection/Fixtures/php/notifier.php +++ b/Tests/DependencyInjection/Fixtures/php/notifier.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => [ 'enabled' => true, ], diff --git a/Tests/DependencyInjection/Fixtures/php/notifier_with_disabled_message_bus.php b/Tests/DependencyInjection/Fixtures/php/notifier_with_disabled_message_bus.php index 8c6b2f002..38684b03e 100644 --- a/Tests/DependencyInjection/Fixtures/php/notifier_with_disabled_message_bus.php +++ b/Tests/DependencyInjection/Fixtures/php/notifier_with_disabled_message_bus.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => [ 'enabled' => true, ], diff --git a/Tests/DependencyInjection/Fixtures/php/notifier_with_specific_message_bus.php b/Tests/DependencyInjection/Fixtures/php/notifier_with_specific_message_bus.php index 4c38323bd..830bfa401 100644 --- a/Tests/DependencyInjection/Fixtures/php/notifier_with_specific_message_bus.php +++ b/Tests/DependencyInjection/Fixtures/php/notifier_with_specific_message_bus.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'messenger' => [ 'enabled' => true, ], diff --git a/Tests/DependencyInjection/Fixtures/php/notifier_without_mailer.php b/Tests/DependencyInjection/Fixtures/php/notifier_without_mailer.php index 107803ef9..0c6fc010d 100644 --- a/Tests/DependencyInjection/Fixtures/php/notifier_without_mailer.php +++ b/Tests/DependencyInjection/Fixtures/php/notifier_without_mailer.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'mailer' => [ 'enabled' => false, ], diff --git a/Tests/DependencyInjection/Fixtures/php/notifier_without_messenger.php b/Tests/DependencyInjection/Fixtures/php/notifier_without_messenger.php index 0c43db7cd..6bafa7faf 100644 --- a/Tests/DependencyInjection/Fixtures/php/notifier_without_messenger.php +++ b/Tests/DependencyInjection/Fixtures/php/notifier_without_messenger.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'mailer' => [ 'dsn' => 'smtp://example.com', ], diff --git a/Tests/DependencyInjection/Fixtures/php/notifier_without_transports.php b/Tests/DependencyInjection/Fixtures/php/notifier_without_transports.php index 6392f0b33..fd5aef252 100644 --- a/Tests/DependencyInjection/Fixtures/php/notifier_without_transports.php +++ b/Tests/DependencyInjection/Fixtures/php/notifier_without_transports.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'notifier' => [ 'enabled' => true, ], diff --git a/Tests/DependencyInjection/Fixtures/php/php_errors_disabled.php b/Tests/DependencyInjection/Fixtures/php/php_errors_disabled.php index 0d12f010e..cff0582bf 100644 --- a/Tests/DependencyInjection/Fixtures/php/php_errors_disabled.php +++ b/Tests/DependencyInjection/Fixtures/php/php_errors_disabled.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'php_errors' => [ 'log' => false, 'throw' => false, diff --git a/Tests/DependencyInjection/Fixtures/php/php_errors_enabled.php b/Tests/DependencyInjection/Fixtures/php/php_errors_enabled.php index 0e41dd952..3cb095316 100644 --- a/Tests/DependencyInjection/Fixtures/php/php_errors_enabled.php +++ b/Tests/DependencyInjection/Fixtures/php/php_errors_enabled.php @@ -1,12 +1,7 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'php_errors' => [ - 'log' => true, 'throw' => true, ], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/php_errors_log_level.php b/Tests/DependencyInjection/Fixtures/php/php_errors_log_level.php index 142ed1d46..87fdd64d0 100644 --- a/Tests/DependencyInjection/Fixtures/php/php_errors_log_level.php +++ b/Tests/DependencyInjection/Fixtures/php/php_errors_log_level.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'php_errors' => [ 'log' => 8, ], diff --git a/Tests/DependencyInjection/Fixtures/php/php_errors_log_levels.php b/Tests/DependencyInjection/Fixtures/php/php_errors_log_levels.php index 5673c6430..620a5871e 100644 --- a/Tests/DependencyInjection/Fixtures/php/php_errors_log_levels.php +++ b/Tests/DependencyInjection/Fixtures/php/php_errors_log_levels.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'php_errors' => [ 'log' => [ \E_NOTICE => \Psr\Log\LogLevel::ERROR, diff --git a/Tests/DependencyInjection/Fixtures/php/profiler.php b/Tests/DependencyInjection/Fixtures/php/profiler.php index 99e2a52cf..56cc6a172 100644 --- a/Tests/DependencyInjection/Fixtures/php/profiler.php +++ b/Tests/DependencyInjection/Fixtures/php/profiler.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'profiler' => [ 'enabled' => true, 'collect_serializer_data' => true, diff --git a/Tests/DependencyInjection/Fixtures/php/property_accessor.php b/Tests/DependencyInjection/Fixtures/php/property_accessor.php index 05a051318..dc6954fe8 100644 --- a/Tests/DependencyInjection/Fixtures/php/property_accessor.php +++ b/Tests/DependencyInjection/Fixtures/php/property_accessor.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'property_access' => [ 'magic_call' => true, 'magic_get' => true, diff --git a/Tests/DependencyInjection/Fixtures/php/property_info.php b/Tests/DependencyInjection/Fixtures/php/property_info.php index e2437e2c2..bff8d4115 100644 --- a/Tests/DependencyInjection/Fixtures/php/property_info.php +++ b/Tests/DependencyInjection/Fixtures/php/property_info.php @@ -1,12 +1,7 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'property_info' => [ 'enabled' => true, - 'with_constructor_extractor' => false, ], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/property_info_with_constructor_extractor.php b/Tests/DependencyInjection/Fixtures/php/property_info_with_constructor_extractor.php deleted file mode 100644 index fa143d2e1..000000000 --- a/Tests/DependencyInjection/Fixtures/php/property_info_with_constructor_extractor.php +++ /dev/null @@ -1,12 +0,0 @@ -loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'property_info' => [ - 'enabled' => true, - 'with_constructor_extractor' => true, - ], -]); diff --git a/Tests/DependencyInjection/Fixtures/php/property_info_without_constructor_extractor.php b/Tests/DependencyInjection/Fixtures/php/property_info_without_constructor_extractor.php new file mode 100644 index 000000000..f13f02b7c --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/php/property_info_without_constructor_extractor.php @@ -0,0 +1,8 @@ +loadFromExtension('framework', [ + 'property_info' => [ + 'enabled' => true, + 'with_constructor_extractor' => false, + ], +]); diff --git a/Tests/DependencyInjection/Fixtures/php/request.php b/Tests/DependencyInjection/Fixtures/php/request.php index 38667cbf0..d69d7512a 100644 --- a/Tests/DependencyInjection/Fixtures/php/request.php +++ b/Tests/DependencyInjection/Fixtures/php/request.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'request' => [ 'formats' => [], ], diff --git a/Tests/DependencyInjection/Fixtures/php/semaphore.php b/Tests/DependencyInjection/Fixtures/php/semaphore.php index c2a1e3b6e..06168f1ea 100644 --- a/Tests/DependencyInjection/Fixtures/php/semaphore.php +++ b/Tests/DependencyInjection/Fixtures/php/semaphore.php @@ -1,9 +1,5 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'semaphore' => 'redis://localhost', ]); diff --git a/Tests/DependencyInjection/Fixtures/php/semaphore_named.php b/Tests/DependencyInjection/Fixtures/php/semaphore_named.php index c42b55983..17439aadb 100644 --- a/Tests/DependencyInjection/Fixtures/php/semaphore_named.php +++ b/Tests/DependencyInjection/Fixtures/php/semaphore_named.php @@ -3,10 +3,6 @@ $container->setParameter('env(REDIS_DSN)', 'redis://paas.com'); $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'semaphore' => [ 'foo' => 'redis://paas.com', 'qux' => '%env(REDIS_DSN)%', diff --git a/Tests/DependencyInjection/Fixtures/php/semaphore_service.php b/Tests/DependencyInjection/Fixtures/php/semaphore_service.php index 279f1c158..7edea19d1 100644 --- a/Tests/DependencyInjection/Fixtures/php/semaphore_service.php +++ b/Tests/DependencyInjection/Fixtures/php/semaphore_service.php @@ -3,9 +3,5 @@ $container->register('my_service', \Redis::class); $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'semaphore' => 'my_service', ]); diff --git a/Tests/DependencyInjection/Fixtures/php/serializer_disabled.php b/Tests/DependencyInjection/Fixtures/php/serializer_disabled.php index 130fc4ad7..937a07c22 100644 --- a/Tests/DependencyInjection/Fixtures/php/serializer_disabled.php +++ b/Tests/DependencyInjection/Fixtures/php/serializer_disabled.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'serializer' => [ 'enabled' => false, ], diff --git a/Tests/DependencyInjection/Fixtures/php/serializer_enabled.php b/Tests/DependencyInjection/Fixtures/php/serializer_enabled.php index 01fb36f3d..de3381c21 100644 --- a/Tests/DependencyInjection/Fixtures/php/serializer_enabled.php +++ b/Tests/DependencyInjection/Fixtures/php/serializer_enabled.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'serializer' => [ 'enabled' => true, ], diff --git a/Tests/DependencyInjection/Fixtures/php/serializer_mapping.php b/Tests/DependencyInjection/Fixtures/php/serializer_mapping.php index 1e3d1ab2b..bde5f420a 100644 --- a/Tests/DependencyInjection/Fixtures/php/serializer_mapping.php +++ b/Tests/DependencyInjection/Fixtures/php/serializer_mapping.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'annotations' => false, 'serializer' => [ 'enable_attributes' => true, 'mapping' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/serializer_mapping_without_annotations.php b/Tests/DependencyInjection/Fixtures/php/serializer_mapping_without_attributes.php similarity index 73% rename from Tests/DependencyInjection/Fixtures/php/serializer_mapping_without_annotations.php rename to Tests/DependencyInjection/Fixtures/php/serializer_mapping_without_attributes.php index 3e203028c..bde5f420a 100644 --- a/Tests/DependencyInjection/Fixtures/php/serializer_mapping_without_annotations.php +++ b/Tests/DependencyInjection/Fixtures/php/serializer_mapping_without_attributes.php @@ -1,12 +1,8 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'serializer' => [ - 'enable_attributes' => false, + 'enable_attributes' => true, 'mapping' => [ 'paths' => [ '%kernel.project_dir%/Fixtures/TestBundle/Resources/config/serializer_mapping/files', diff --git a/Tests/DependencyInjection/Fixtures/php/serializer_without_translator.php b/Tests/DependencyInjection/Fixtures/php/serializer_without_translator.php index acf013080..d9b650c30 100644 --- a/Tests/DependencyInjection/Fixtures/php/serializer_without_translator.php +++ b/Tests/DependencyInjection/Fixtures/php/serializer_without_translator.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'serializer' => [ 'enabled' => true, ], diff --git a/Tests/DependencyInjection/Fixtures/php/session.php b/Tests/DependencyInjection/Fixtures/php/session.php index f3c27f550..7fdc352a1 100644 --- a/Tests/DependencyInjection/Fixtures/php/session.php +++ b/Tests/DependencyInjection/Fixtures/php/session.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'session' => [ 'storage_factory_id' => 'session.storage.factory.native', 'handler_id' => null, diff --git a/Tests/DependencyInjection/Fixtures/php/session_cookie_secure_auto.php b/Tests/DependencyInjection/Fixtures/php/session_cookie_secure_auto.php index 066807995..7bf017e52 100644 --- a/Tests/DependencyInjection/Fixtures/php/session_cookie_secure_auto.php +++ b/Tests/DependencyInjection/Fixtures/php/session_cookie_secure_auto.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'session' => [ 'storage_factory_id' => 'session.storage.factory.native', 'handler_id' => null, diff --git a/Tests/DependencyInjection/Fixtures/php/ssi_disabled.php b/Tests/DependencyInjection/Fixtures/php/ssi_disabled.php index c7e06cf45..32e1bf0c5 100644 --- a/Tests/DependencyInjection/Fixtures/php/ssi_disabled.php +++ b/Tests/DependencyInjection/Fixtures/php/ssi_disabled.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'ssi' => [ 'enabled' => false, ], diff --git a/Tests/DependencyInjection/Fixtures/php/translator_cache_dir_disabled.php b/Tests/DependencyInjection/Fixtures/php/translator_cache_dir_disabled.php index 8d708c2bf..6f2568ffd 100644 --- a/Tests/DependencyInjection/Fixtures/php/translator_cache_dir_disabled.php +++ b/Tests/DependencyInjection/Fixtures/php/translator_cache_dir_disabled.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'translator' => [ 'cache_dir' => null, ], diff --git a/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php b/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php index b2c0cc544..592a61de6 100644 --- a/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php +++ b/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'translator' => [ 'fallbacks' => ['en', 'fr'], ], diff --git a/Tests/DependencyInjection/Fixtures/php/translator_globals.php b/Tests/DependencyInjection/Fixtures/php/translator_globals.php index 8ee438ff9..4d59f45a6 100644 --- a/Tests/DependencyInjection/Fixtures/php/translator_globals.php +++ b/Tests/DependencyInjection/Fixtures/php/translator_globals.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'translator' => [ 'globals' => [ '%%app_name%%' => 'My application', diff --git a/Tests/DependencyInjection/Fixtures/php/translator_without_globals.php b/Tests/DependencyInjection/Fixtures/php/translator_without_globals.php index fcc65c968..15485c982 100644 --- a/Tests/DependencyInjection/Fixtures/php/translator_without_globals.php +++ b/Tests/DependencyInjection/Fixtures/php/translator_without_globals.php @@ -1,9 +1,5 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'translator' => ['globals' => []], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/type_info.php b/Tests/DependencyInjection/Fixtures/php/type_info.php index 0e7dcbae0..11f2f8af4 100644 --- a/Tests/DependencyInjection/Fixtures/php/type_info.php +++ b/Tests/DependencyInjection/Fixtures/php/type_info.php @@ -1,11 +1,10 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'type_info' => [ 'enabled' => true, + 'aliases' => [ + 'CustomAlias' => 'int', + ], ], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/validation_attributes.php b/Tests/DependencyInjection/Fixtures/php/validation_attributes.php index 3e6ae7547..b33113cb8 100644 --- a/Tests/DependencyInjection/Fixtures/php/validation_attributes.php +++ b/Tests/DependencyInjection/Fixtures/php/validation_attributes.php @@ -1,15 +1,10 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'secret' => 's3cr3t', 'validation' => [ 'enabled' => true, 'enable_attributes' => true, - 'email_validation_mode' => 'html5', ], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/validation_auto_mapping.php b/Tests/DependencyInjection/Fixtures/php/validation_auto_mapping.php index 67bac4a32..e15762d6d 100644 --- a/Tests/DependencyInjection/Fixtures/php/validation_auto_mapping.php +++ b/Tests/DependencyInjection/Fixtures/php/validation_auto_mapping.php @@ -1,16 +1,8 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'property_info' => [ - 'enabled' => true, - 'with_constructor_extractor' => true, - ], + 'property_info' => ['enabled' => true], 'validation' => [ - 'email_validation_mode' => 'html5', 'auto_mapping' => [ 'App\\' => ['foo', 'bar'], 'Symfony\\' => ['a', 'b'], diff --git a/Tests/DependencyInjection/Fixtures/php/validation_email_validation_mode.php b/Tests/DependencyInjection/Fixtures/php/validation_email_validation_mode.php index 36a3f6738..ab95f0add 100644 --- a/Tests/DependencyInjection/Fixtures/php/validation_email_validation_mode.php +++ b/Tests/DependencyInjection/Fixtures/php/validation_email_validation_mode.php @@ -1,11 +1,7 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'validation' => [ - 'email_validation_mode' => 'html5', + 'email_validation_mode' => 'html5-allow-no-tld', ], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/validation_mapping.php b/Tests/DependencyInjection/Fixtures/php/validation_mapping.php index e76dbf820..f8b19e348 100644 --- a/Tests/DependencyInjection/Fixtures/php/validation_mapping.php +++ b/Tests/DependencyInjection/Fixtures/php/validation_mapping.php @@ -1,12 +1,7 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'validation' => [ - 'email_validation_mode' => 'html5', 'mapping' => [ 'paths' => [ '%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/files', diff --git a/Tests/DependencyInjection/Fixtures/php/validation_multiple_static_methods.php b/Tests/DependencyInjection/Fixtures/php/validation_multiple_static_methods.php index 7527c0ce3..ad2bd817a 100644 --- a/Tests/DependencyInjection/Fixtures/php/validation_multiple_static_methods.php +++ b/Tests/DependencyInjection/Fixtures/php/validation_multiple_static_methods.php @@ -1,14 +1,9 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'secret' => 's3cr3t', 'validation' => [ 'enabled' => true, - 'email_validation_mode' => 'html5', 'static_method' => ['loadFoo', 'loadBar'], ], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/validation_no_static_method.php b/Tests/DependencyInjection/Fixtures/php/validation_no_static_method.php index 375b42d6a..a9d98e17c 100644 --- a/Tests/DependencyInjection/Fixtures/php/validation_no_static_method.php +++ b/Tests/DependencyInjection/Fixtures/php/validation_no_static_method.php @@ -1,14 +1,9 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'secret' => 's3cr3t', 'validation' => [ 'enabled' => true, - 'email_validation_mode' => 'html5', 'static_method' => false, ], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/validation_translation_domain.php b/Tests/DependencyInjection/Fixtures/php/validation_translation_domain.php index 434ebf3c6..42ea07130 100644 --- a/Tests/DependencyInjection/Fixtures/php/validation_translation_domain.php +++ b/Tests/DependencyInjection/Fixtures/php/validation_translation_domain.php @@ -1,12 +1,7 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'validation' => [ - 'email_validation_mode' => 'html5', 'translation_domain' => 'messages', ], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/web_link.php b/Tests/DependencyInjection/Fixtures/php/web_link.php index 8952afab2..44d52e402 100644 --- a/Tests/DependencyInjection/Fixtures/php/web_link.php +++ b/Tests/DependencyInjection/Fixtures/php/web_link.php @@ -1,9 +1,5 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'web_link' => ['enabled' => true], ]); diff --git a/Tests/DependencyInjection/Fixtures/php/webhook.php b/Tests/DependencyInjection/Fixtures/php/webhook.php index d529a8fee..18686b3f6 100644 --- a/Tests/DependencyInjection/Fixtures/php/webhook.php +++ b/Tests/DependencyInjection/Fixtures/php/webhook.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'webhook' => ['enabled' => true], 'http_client' => ['enabled' => true], 'serializer' => ['enabled' => true], diff --git a/Tests/DependencyInjection/Fixtures/php/webhook_without_serializer.php b/Tests/DependencyInjection/Fixtures/php/webhook_without_serializer.php index 64a8f9fa9..318c4ff09 100644 --- a/Tests/DependencyInjection/Fixtures/php/webhook_without_serializer.php +++ b/Tests/DependencyInjection/Fixtures/php/webhook_without_serializer.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'webhook' => ['enabled' => true], 'http_client' => ['enabled' => true], 'serializer' => ['enabled' => false], diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_enum_places.php b/Tests/DependencyInjection/Fixtures/php/workflow_enum_places.php new file mode 100644 index 000000000..cc45f350a --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/php/workflow_enum_places.php @@ -0,0 +1,25 @@ +loadFromExtension('framework', [ + 'workflows' => [ + 'enum' => [ + 'supports' => [ + FrameworkExtensionTestCase::class, + ], + 'places' => Places::cases(), + 'transitions' => [ + 'one' => [ + 'from' => Places::A, + 'to' => Places::B, + ], + 'two' => [ + 'from' => Places::B, + 'to' => Places::C, + ], + ], + ] + ], +]); diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_glob_places.php b/Tests/DependencyInjection/Fixtures/php/workflow_glob_places.php new file mode 100644 index 000000000..092e4a183 --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/php/workflow_glob_places.php @@ -0,0 +1,25 @@ +loadFromExtension('framework', [ + 'workflows' => [ + 'enum' => [ + 'supports' => [ + FrameworkExtensionTestCase::class, + ], + 'places' => Places::class.'::*', + 'transitions' => [ + 'one' => [ + 'from' => Places::A, + 'to' => Places::B, + ], + 'two' => [ + 'from' => Places::B, + 'to' => Places::C, + ], + ], + ] + ], +]); diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_not_valid.php b/Tests/DependencyInjection/Fixtures/php/workflow_not_valid.php index 13f28571c..cfad547bd 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflow_not_valid.php +++ b/Tests/DependencyInjection/Fixtures/php/workflow_not_valid.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'my_workflow' => [ 'type' => 'state_machine', diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_with_complex_place_follow_by_simplistic_place_config.php b/Tests/DependencyInjection/Fixtures/php/workflow_with_complex_place_follow_by_simplistic_place_config.php index 99e319dc0..935d93ac1 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflow_with_complex_place_follow_by_simplistic_place_config.php +++ b/Tests/DependencyInjection/Fixtures/php/workflow_with_complex_place_follow_by_simplistic_place_config.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'article' => [ 'type' => 'workflow', diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_with_guard_expression.php b/Tests/DependencyInjection/Fixtures/php/workflow_with_guard_expression.php index a6679e082..1b4dbfefd 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflow_with_guard_expression.php +++ b/Tests/DependencyInjection/Fixtures/php/workflow_with_guard_expression.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'article' => [ 'type' => 'workflow', diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_with_multiple_transitions_with_same_name.php b/Tests/DependencyInjection/Fixtures/php/workflow_with_multiple_transitions_with_same_name.php index f4956eccb..aef7f5095 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflow_with_multiple_transitions_with_same_name.php +++ b/Tests/DependencyInjection/Fixtures/php/workflow_with_multiple_transitions_with_same_name.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'article' => [ 'type' => 'workflow', diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_with_no_events_to_dispatch.php b/Tests/DependencyInjection/Fixtures/php/workflow_with_no_events_to_dispatch.php index 623e59425..287095895 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflow_with_no_events_to_dispatch.php +++ b/Tests/DependencyInjection/Fixtures/php/workflow_with_no_events_to_dispatch.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'my_workflow' => [ 'type' => 'state_machine', diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_with_simplistic_place_follow_by_complex_place_config.php b/Tests/DependencyInjection/Fixtures/php/workflow_with_simplistic_place_follow_by_complex_place_config.php index d3579fee1..034ed9a3c 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflow_with_simplistic_place_follow_by_complex_place_config.php +++ b/Tests/DependencyInjection/Fixtures/php/workflow_with_simplistic_place_follow_by_complex_place_config.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'article' => [ 'type' => 'workflow', diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_with_specified_events_to_dispatch.php b/Tests/DependencyInjection/Fixtures/php/workflow_with_specified_events_to_dispatch.php index 70add8e74..9d825c9a6 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflow_with_specified_events_to_dispatch.php +++ b/Tests/DependencyInjection/Fixtures/php/workflow_with_specified_events_to_dispatch.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'my_workflow' => [ 'type' => 'state_machine', diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_with_support_and_support_strategy.php b/Tests/DependencyInjection/Fixtures/php/workflow_with_support_and_support_strategy.php index ac66a8789..c2acce156 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflow_with_support_and_support_strategy.php +++ b/Tests/DependencyInjection/Fixtures/php/workflow_with_support_and_support_strategy.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'my_workflow' => [ 'type' => 'workflow', diff --git a/Tests/DependencyInjection/Fixtures/php/workflow_without_support_and_support_strategy.php b/Tests/DependencyInjection/Fixtures/php/workflow_without_support_and_support_strategy.php index 434e75141..5eef5cc4d 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflow_without_support_and_support_strategy.php +++ b/Tests/DependencyInjection/Fixtures/php/workflow_without_support_and_support_strategy.php @@ -1,10 +1,6 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'my_workflow' => [ 'type' => 'workflow', diff --git a/Tests/DependencyInjection/Fixtures/php/workflows.php b/Tests/DependencyInjection/Fixtures/php/workflows.php index 2c29b8489..b0a6acb59 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflows.php +++ b/Tests/DependencyInjection/Fixtures/php/workflows.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'article' => [ 'type' => 'workflow', diff --git a/Tests/DependencyInjection/Fixtures/php/workflows_enabled.php b/Tests/DependencyInjection/Fixtures/php/workflows_enabled.php index 94b0fe1c0..eb1773194 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflows_enabled.php +++ b/Tests/DependencyInjection/Fixtures/php/workflows_enabled.php @@ -1,9 +1,5 @@ loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => null, ]); diff --git a/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled.php b/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled.php index 85f1df2da..53ce0ec07 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled.php +++ b/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'enabled' => true, 'foo' => [ diff --git a/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled_named_workflows.php b/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled_named_workflows.php index 6c2db5961..b954889b6 100644 --- a/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled_named_workflows.php +++ b/Tests/DependencyInjection/Fixtures/php/workflows_explicitly_enabled_named_workflows.php @@ -3,10 +3,6 @@ use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase; $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'enabled' => true, 'workflows' => [ diff --git a/Tests/DependencyInjection/Fixtures/xml/asset_mapper.xml b/Tests/DependencyInjection/Fixtures/xml/asset_mapper.xml index 8007170ce..e9887ffa0 100644 --- a/Tests/DependencyInjection/Fixtures/xml/asset_mapper.xml +++ b/Tests/DependencyInjection/Fixtures/xml/asset_mapper.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + - - + - diff --git a/Tests/DependencyInjection/Fixtures/xml/assets.xml b/Tests/DependencyInjection/Fixtures/xml/assets.xml index a5fa23955..dadee4529 100644 --- a/Tests/DependencyInjection/Fixtures/xml/assets.xml +++ b/Tests/DependencyInjection/Fixtures/xml/assets.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + http://cdn.example.com diff --git a/Tests/DependencyInjection/Fixtures/xml/assets_disabled.xml b/Tests/DependencyInjection/Fixtures/xml/assets_disabled.xml index abe10c7b3..3c1303144 100644 --- a/Tests/DependencyInjection/Fixtures/xml/assets_disabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/assets_disabled.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/assets_version_strategy_as_service.xml b/Tests/DependencyInjection/Fixtures/xml/assets_version_strategy_as_service.xml index 605286b00..7bc70332b 100644 --- a/Tests/DependencyInjection/Fixtures/xml/assets_version_strategy_as_service.xml +++ b/Tests/DependencyInjection/Fixtures/xml/assets_version_strategy_as_service.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + http://cdn.example.com diff --git a/Tests/DependencyInjection/Fixtures/xml/cache.xml b/Tests/DependencyInjection/Fixtures/xml/cache.xml index b4625a26d..7c75178c8 100644 --- a/Tests/DependencyInjection/Fixtures/xml/cache.xml +++ b/Tests/DependencyInjection/Fixtures/xml/cache.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/cache_app_redis_tag_aware.xml b/Tests/DependencyInjection/Fixtures/xml/cache_app_redis_tag_aware.xml index b63171c60..2929e87e2 100644 --- a/Tests/DependencyInjection/Fixtures/xml/cache_app_redis_tag_aware.xml +++ b/Tests/DependencyInjection/Fixtures/xml/cache_app_redis_tag_aware.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + cache.adapter.redis_tag_aware diff --git a/Tests/DependencyInjection/Fixtures/xml/cache_app_redis_tag_aware_pool.xml b/Tests/DependencyInjection/Fixtures/xml/cache_app_redis_tag_aware_pool.xml index 7c3dbdf5c..65c06a1da 100644 --- a/Tests/DependencyInjection/Fixtures/xml/cache_app_redis_tag_aware_pool.xml +++ b/Tests/DependencyInjection/Fixtures/xml/cache_app_redis_tag_aware_pool.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + cache.redis_tag_aware.foo diff --git a/Tests/DependencyInjection/Fixtures/xml/csrf.xml b/Tests/DependencyInjection/Fixtures/xml/csrf.xml index ef018e00b..6e8a569ea 100644 --- a/Tests/DependencyInjection/Fixtures/xml/csrf.xml +++ b/Tests/DependencyInjection/Fixtures/xml/csrf.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/csrf_disabled.xml b/Tests/DependencyInjection/Fixtures/xml/csrf_disabled.xml index 0c50759e8..63a26d384 100644 --- a/Tests/DependencyInjection/Fixtures/xml/csrf_disabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/csrf_disabled.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/csrf_needs_session.xml b/Tests/DependencyInjection/Fixtures/xml/csrf_needs_session.xml index 0b7a28793..a9e168638 100644 --- a/Tests/DependencyInjection/Fixtures/xml/csrf_needs_session.xml +++ b/Tests/DependencyInjection/Fixtures/xml/csrf_needs_session.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/default_config.xml b/Tests/DependencyInjection/Fixtures/xml/default_config.xml index 21fddeec9..560046e70 100644 --- a/Tests/DependencyInjection/Fixtures/xml/default_config.xml +++ b/Tests/DependencyInjection/Fixtures/xml/default_config.xml @@ -5,8 +5,6 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/esi_and_ssi_without_fragments.xml b/Tests/DependencyInjection/Fixtures/xml/esi_and_ssi_without_fragments.xml index 94c6ee410..5fe9be69b 100644 --- a/Tests/DependencyInjection/Fixtures/xml/esi_and_ssi_without_fragments.xml +++ b/Tests/DependencyInjection/Fixtures/xml/esi_and_ssi_without_fragments.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/esi_disabled.xml b/Tests/DependencyInjection/Fixtures/xml/esi_disabled.xml index 35ad69453..d4a46b62f 100644 --- a/Tests/DependencyInjection/Fixtures/xml/esi_disabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/esi_disabled.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/exceptions.xml b/Tests/DependencyInjection/Fixtures/xml/exceptions.xml index 277febba4..eca150a8f 100644 --- a/Tests/DependencyInjection/Fixtures/xml/exceptions.xml +++ b/Tests/DependencyInjection/Fixtures/xml/exceptions.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/form_csrf_field_attr.xml b/Tests/DependencyInjection/Fixtures/xml/form_csrf_field_attr.xml index 1889703be..777956790 100644 --- a/Tests/DependencyInjection/Fixtures/xml/form_csrf_field_attr.xml +++ b/Tests/DependencyInjection/Fixtures/xml/form_csrf_field_attr.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/form_default_csrf.xml b/Tests/DependencyInjection/Fixtures/xml/form_default_csrf.xml index cdbecc9b9..45b2135bf 100644 --- a/Tests/DependencyInjection/Fixtures/xml/form_default_csrf.xml +++ b/Tests/DependencyInjection/Fixtures/xml/form_default_csrf.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/form_no_csrf.xml b/Tests/DependencyInjection/Fixtures/xml/form_no_csrf.xml index de1418108..13720755c 100644 --- a/Tests/DependencyInjection/Fixtures/xml/form_no_csrf.xml +++ b/Tests/DependencyInjection/Fixtures/xml/form_no_csrf.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/fragments_and_hinclude.xml b/Tests/DependencyInjection/Fixtures/xml/fragments_and_hinclude.xml index ecf8ab2fa..fb007313b 100644 --- a/Tests/DependencyInjection/Fixtures/xml/fragments_and_hinclude.xml +++ b/Tests/DependencyInjection/Fixtures/xml/fragments_and_hinclude.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/full.xml b/Tests/DependencyInjection/Fixtures/xml/full.xml index 07faf22ab..9716b075e 100644 --- a/Tests/DependencyInjection/Fixtures/xml/full.xml +++ b/Tests/DependencyInjection/Fixtures/xml/full.xml @@ -32,7 +32,6 @@ %kernel.project_dir%/Fixtures/translations - @@ -44,7 +43,7 @@ - + diff --git a/Tests/DependencyInjection/Fixtures/xml/html_sanitizer.xml b/Tests/DependencyInjection/Fixtures/xml/html_sanitizer.xml index 7cb6758d9..dad449f72 100644 --- a/Tests/DependencyInjection/Fixtures/xml/html_sanitizer.xml +++ b/Tests/DependencyInjection/Fixtures/xml/html_sanitizer.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/html_sanitizer_default_config.xml b/Tests/DependencyInjection/Fixtures/xml/html_sanitizer_default_config.xml index 709692f99..14ce555bb 100644 --- a/Tests/DependencyInjection/Fixtures/xml/html_sanitizer_default_config.xml +++ b/Tests/DependencyInjection/Fixtures/xml/html_sanitizer_default_config.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/http_client_default_options.xml b/Tests/DependencyInjection/Fixtures/xml/http_client_default_options.xml index ddea12b15..c00eb3144 100644 --- a/Tests/DependencyInjection/Fixtures/xml/http_client_default_options.xml +++ b/Tests/DependencyInjection/Fixtures/xml/http_client_default_options.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + - - - + - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/http_client_override_default_options.xml b/Tests/DependencyInjection/Fixtures/xml/http_client_override_default_options.xml index 9a31ceb1f..ba92d51a3 100644 --- a/Tests/DependencyInjection/Fixtures/xml/http_client_override_default_options.xml +++ b/Tests/DependencyInjection/Fixtures/xml/http_client_override_default_options.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + bar diff --git a/Tests/DependencyInjection/Fixtures/xml/http_client_rate_limiter.xml b/Tests/DependencyInjection/Fixtures/xml/http_client_rate_limiter.xml index 8c9dbcdad..58437cf47 100644 --- a/Tests/DependencyInjection/Fixtures/xml/http_client_rate_limiter.xml +++ b/Tests/DependencyInjection/Fixtures/xml/http_client_rate_limiter.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/http_client_retry.xml b/Tests/DependencyInjection/Fixtures/xml/http_client_retry.xml index 296d1b29c..eb7798914 100644 --- a/Tests/DependencyInjection/Fixtures/xml/http_client_retry.xml +++ b/Tests/DependencyInjection/Fixtures/xml/http_client_retry.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + - - - + - - - + 127.0.0.1 diff --git a/Tests/DependencyInjection/Fixtures/xml/json_streamer.xml b/Tests/DependencyInjection/Fixtures/xml/json_streamer.xml index 5c79cb840..7da62288f 100644 --- a/Tests/DependencyInjection/Fixtures/xml/json_streamer.xml +++ b/Tests/DependencyInjection/Fixtures/xml/json_streamer.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/lock.xml b/Tests/DependencyInjection/Fixtures/xml/lock.xml index 2796cb3f9..2b4bb4bd8 100644 --- a/Tests/DependencyInjection/Fixtures/xml/lock.xml +++ b/Tests/DependencyInjection/Fixtures/xml/lock.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/lock_named.xml b/Tests/DependencyInjection/Fixtures/xml/lock_named.xml index b8d4b4a3f..ca9dccab6 100644 --- a/Tests/DependencyInjection/Fixtures/xml/lock_named.xml +++ b/Tests/DependencyInjection/Fixtures/xml/lock_named.xml @@ -9,9 +9,7 @@ redis://paas.com - - - + semaphore flock diff --git a/Tests/DependencyInjection/Fixtures/xml/lock_service.xml b/Tests/DependencyInjection/Fixtures/xml/lock_service.xml index a175526a9..4a335bf39 100644 --- a/Tests/DependencyInjection/Fixtures/xml/lock_service.xml +++ b/Tests/DependencyInjection/Fixtures/xml/lock_service.xml @@ -9,9 +9,7 @@ - - - + my_service diff --git a/Tests/DependencyInjection/Fixtures/xml/mailer_with_disabled_message_bus.xml b/Tests/DependencyInjection/Fixtures/xml/mailer_with_disabled_message_bus.xml index 5cc9697d5..e6d3a47e3 100644 --- a/Tests/DependencyInjection/Fixtures/xml/mailer_with_disabled_message_bus.xml +++ b/Tests/DependencyInjection/Fixtures/xml/mailer_with_disabled_message_bus.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml b/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml index d48b7423a..e3ec1bae3 100644 --- a/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml +++ b/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + sender@example.org diff --git a/Tests/DependencyInjection/Fixtures/xml/mailer_with_specific_message_bus.xml b/Tests/DependencyInjection/Fixtures/xml/mailer_with_specific_message_bus.xml index fd5d1a93b..116ba032a 100644 --- a/Tests/DependencyInjection/Fixtures/xml/mailer_with_specific_message_bus.xml +++ b/Tests/DependencyInjection/Fixtures/xml/mailer_with_specific_message_bus.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/mailer_with_transports.xml b/Tests/DependencyInjection/Fixtures/xml/mailer_with_transports.xml index 9bfd18d91..6be88fcae 100644 --- a/Tests/DependencyInjection/Fixtures/xml/mailer_with_transports.xml +++ b/Tests/DependencyInjection/Fixtures/xml/mailer_with_transports.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + smtp://example1.com smtp://example2.com diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger.xml b/Tests/DependencyInjection/Fixtures/xml/messenger.xml index a600a6e38..6b72e9a75 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml index 5e0b17851..361282635 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_bus_name_stamp.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_disabled.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_disabled.xml index 7284b0455..83561dacf 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_disabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_disabled.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_buses_with_deduplicate_middleware.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_buses_with_deduplicate_middleware.xml index 67decad20..c5a2fb3b3 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_buses_with_deduplicate_middleware.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_buses_with_deduplicate_middleware.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_buses_without_deduplicate_middleware.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_buses_without_deduplicate_middleware.xml index 3f0d96249..06b27cd85 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_buses_without_deduplicate_middleware.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_buses_without_deduplicate_middleware.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_failure_transports.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_failure_transports.xml index 7ddc598c1..b8e9f1975 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_failure_transports.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_failure_transports.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_failure_transports_global.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_failure_transports_global.xml index ee9e6e0db..c6e5c530f 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_failure_transports_global.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_multiple_failure_transports_global.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_routing.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_routing.xml index 5e3613ad2..a71d52d96 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_routing.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_routing.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_routing_invalid_transport.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_routing_invalid_transport.xml index 44c9382b6..98c487fbf 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_routing_invalid_transport.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_routing_invalid_transport.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_routing_invalid_wildcard.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_routing_invalid_wildcard.xml index 4002fbf43..93ddb789f 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_routing_invalid_wildcard.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_routing_invalid_wildcard.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_routing_single.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_routing_single.xml index aa6db8515..349a3728d 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_routing_single.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_routing_single.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_schedule.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_schedule.xml index ee8cf3dcf..f2152626b 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_schedule.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_schedule.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_transport.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_transport.xml index 167e4b64e..e5e60a398 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_transport.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_transport.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/messenger_transports.xml b/Tests/DependencyInjection/Fixtures/xml/messenger_transports.xml index b42473601..338e0c8de 100644 --- a/Tests/DependencyInjection/Fixtures/xml/messenger_transports.xml +++ b/Tests/DependencyInjection/Fixtures/xml/messenger_transports.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/notifier.xml b/Tests/DependencyInjection/Fixtures/xml/notifier.xml index 0cc1bceac..47e2e2b0c 100644 --- a/Tests/DependencyInjection/Fixtures/xml/notifier.xml +++ b/Tests/DependencyInjection/Fixtures/xml/notifier.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/notifier_with_disabled_message_bus.xml b/Tests/DependencyInjection/Fixtures/xml/notifier_with_disabled_message_bus.xml index 9a2a7e2f6..599bd23cb 100644 --- a/Tests/DependencyInjection/Fixtures/xml/notifier_with_disabled_message_bus.xml +++ b/Tests/DependencyInjection/Fixtures/xml/notifier_with_disabled_message_bus.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/notifier_with_specific_message_bus.xml b/Tests/DependencyInjection/Fixtures/xml/notifier_with_specific_message_bus.xml index 5250151d4..623734970 100644 --- a/Tests/DependencyInjection/Fixtures/xml/notifier_with_specific_message_bus.xml +++ b/Tests/DependencyInjection/Fixtures/xml/notifier_with_specific_message_bus.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/notifier_without_mailer.xml b/Tests/DependencyInjection/Fixtures/xml/notifier_without_mailer.xml index 118564ae7..1c62b5265 100644 --- a/Tests/DependencyInjection/Fixtures/xml/notifier_without_mailer.xml +++ b/Tests/DependencyInjection/Fixtures/xml/notifier_without_mailer.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/notifier_without_messenger.xml b/Tests/DependencyInjection/Fixtures/xml/notifier_without_messenger.xml index fa6b6991f..7417de697 100644 --- a/Tests/DependencyInjection/Fixtures/xml/notifier_without_messenger.xml +++ b/Tests/DependencyInjection/Fixtures/xml/notifier_without_messenger.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/notifier_without_transports.xml b/Tests/DependencyInjection/Fixtures/xml/notifier_without_transports.xml index c6060c435..36afb9039 100644 --- a/Tests/DependencyInjection/Fixtures/xml/notifier_without_transports.xml +++ b/Tests/DependencyInjection/Fixtures/xml/notifier_without_transports.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/php_errors_disabled.xml b/Tests/DependencyInjection/Fixtures/xml/php_errors_disabled.xml index 2c10cc713..cb50daa65 100644 --- a/Tests/DependencyInjection/Fixtures/xml/php_errors_disabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/php_errors_disabled.xml @@ -5,8 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/php_errors_enabled.xml b/Tests/DependencyInjection/Fixtures/xml/php_errors_enabled.xml index 9c1345b76..f608a2375 100644 --- a/Tests/DependencyInjection/Fixtures/xml/php_errors_enabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/php_errors_enabled.xml @@ -5,8 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + + diff --git a/Tests/DependencyInjection/Fixtures/xml/php_errors_log_level.xml b/Tests/DependencyInjection/Fixtures/xml/php_errors_log_level.xml index 591d717d4..ebd794845 100644 --- a/Tests/DependencyInjection/Fixtures/xml/php_errors_log_level.xml +++ b/Tests/DependencyInjection/Fixtures/xml/php_errors_log_level.xml @@ -5,8 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/php_errors_log_levels.xml b/Tests/DependencyInjection/Fixtures/xml/php_errors_log_levels.xml index d9b94e926..1b6642a57 100644 --- a/Tests/DependencyInjection/Fixtures/xml/php_errors_log_levels.xml +++ b/Tests/DependencyInjection/Fixtures/xml/php_errors_log_levels.xml @@ -5,8 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/profiler.xml b/Tests/DependencyInjection/Fixtures/xml/profiler.xml index 34d44d91c..55c766efe 100644 --- a/Tests/DependencyInjection/Fixtures/xml/profiler.xml +++ b/Tests/DependencyInjection/Fixtures/xml/profiler.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/property_accessor.xml b/Tests/DependencyInjection/Fixtures/xml/property_accessor.xml index 46d8bd939..9406919e9 100644 --- a/Tests/DependencyInjection/Fixtures/xml/property_accessor.xml +++ b/Tests/DependencyInjection/Fixtures/xml/property_accessor.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/property_info.xml b/Tests/DependencyInjection/Fixtures/xml/property_info.xml index 19bac44d9..7bf63b654 100644 --- a/Tests/DependencyInjection/Fixtures/xml/property_info.xml +++ b/Tests/DependencyInjection/Fixtures/xml/property_info.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - - + + diff --git a/Tests/DependencyInjection/Fixtures/xml/property_info_with_constructor_extractor.xml b/Tests/DependencyInjection/Fixtures/xml/property_info_without_constructor_extractor.xml similarity index 74% rename from Tests/DependencyInjection/Fixtures/xml/property_info_with_constructor_extractor.xml rename to Tests/DependencyInjection/Fixtures/xml/property_info_without_constructor_extractor.xml index df8dabe0b..a04b348c0 100644 --- a/Tests/DependencyInjection/Fixtures/xml/property_info_with_constructor_extractor.xml +++ b/Tests/DependencyInjection/Fixtures/xml/property_info_without_constructor_extractor.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - - + + diff --git a/Tests/DependencyInjection/Fixtures/xml/rate_limiter.xml b/Tests/DependencyInjection/Fixtures/xml/rate_limiter.xml index 54f8e5587..35488c853 100644 --- a/Tests/DependencyInjection/Fixtures/xml/rate_limiter.xml +++ b/Tests/DependencyInjection/Fixtures/xml/rate_limiter.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/semaphore.xml b/Tests/DependencyInjection/Fixtures/xml/semaphore.xml index dcab80326..5266e7fa6 100644 --- a/Tests/DependencyInjection/Fixtures/xml/semaphore.xml +++ b/Tests/DependencyInjection/Fixtures/xml/semaphore.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + redis://localhost diff --git a/Tests/DependencyInjection/Fixtures/xml/semaphore_named.xml b/Tests/DependencyInjection/Fixtures/xml/semaphore_named.xml index 7e454c2fd..73d696d7b 100644 --- a/Tests/DependencyInjection/Fixtures/xml/semaphore_named.xml +++ b/Tests/DependencyInjection/Fixtures/xml/semaphore_named.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + redis://paas.com %env(REDIS_DSN)% diff --git a/Tests/DependencyInjection/Fixtures/xml/semaphore_service.xml b/Tests/DependencyInjection/Fixtures/xml/semaphore_service.xml index 814823802..1d33738cb 100644 --- a/Tests/DependencyInjection/Fixtures/xml/semaphore_service.xml +++ b/Tests/DependencyInjection/Fixtures/xml/semaphore_service.xml @@ -9,9 +9,7 @@ - - - + my_service diff --git a/Tests/DependencyInjection/Fixtures/xml/serializer_disabled.xml b/Tests/DependencyInjection/Fixtures/xml/serializer_disabled.xml index 89a48c59a..0c62272c5 100644 --- a/Tests/DependencyInjection/Fixtures/xml/serializer_disabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/serializer_disabled.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/serializer_enabled.xml b/Tests/DependencyInjection/Fixtures/xml/serializer_enabled.xml index 343ad58c0..3d59d6283 100644 --- a/Tests/DependencyInjection/Fixtures/xml/serializer_enabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/serializer_enabled.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/serializer_mapping.xml b/Tests/DependencyInjection/Fixtures/xml/serializer_mapping.xml index 165669fe6..9b8f47607 100644 --- a/Tests/DependencyInjection/Fixtures/xml/serializer_mapping.xml +++ b/Tests/DependencyInjection/Fixtures/xml/serializer_mapping.xml @@ -4,9 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:framework="http://symfony.com/schema/dic/symfony"> - - - + %kernel.project_dir%/Fixtures/TestBundle/Resources/config/serializer_mapping/files diff --git a/Tests/DependencyInjection/Fixtures/xml/serializer_mapping_without_annotations.xml b/Tests/DependencyInjection/Fixtures/xml/serializer_mapping_without_attributes.xml similarity index 76% rename from Tests/DependencyInjection/Fixtures/xml/serializer_mapping_without_annotations.xml rename to Tests/DependencyInjection/Fixtures/xml/serializer_mapping_without_attributes.xml index bb8dccf9c..9b8f47607 100644 --- a/Tests/DependencyInjection/Fixtures/xml/serializer_mapping_without_annotations.xml +++ b/Tests/DependencyInjection/Fixtures/xml/serializer_mapping_without_attributes.xml @@ -4,10 +4,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:framework="http://symfony.com/schema/dic/symfony"> - - - - + + %kernel.project_dir%/Fixtures/TestBundle/Resources/config/serializer_mapping/files %kernel.project_dir%/Fixtures/TestBundle/Resources/config/serializer_mapping/serialization.yml diff --git a/Tests/DependencyInjection/Fixtures/xml/serializer_without_translator.xml b/Tests/DependencyInjection/Fixtures/xml/serializer_without_translator.xml index 584937b0a..d3e71f0a1 100644 --- a/Tests/DependencyInjection/Fixtures/xml/serializer_without_translator.xml +++ b/Tests/DependencyInjection/Fixtures/xml/serializer_without_translator.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/session.xml b/Tests/DependencyInjection/Fixtures/xml/session.xml index 2091b419d..46a70f3e7 100644 --- a/Tests/DependencyInjection/Fixtures/xml/session.xml +++ b/Tests/DependencyInjection/Fixtures/xml/session.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/session_cookie_secure_auto.xml b/Tests/DependencyInjection/Fixtures/xml/session_cookie_secure_auto.xml index 9c237407d..84bdfc686 100644 --- a/Tests/DependencyInjection/Fixtures/xml/session_cookie_secure_auto.xml +++ b/Tests/DependencyInjection/Fixtures/xml/session_cookie_secure_auto.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/ssi_disabled.xml b/Tests/DependencyInjection/Fixtures/xml/ssi_disabled.xml index 144012fdc..6aa752a46 100644 --- a/Tests/DependencyInjection/Fixtures/xml/ssi_disabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/ssi_disabled.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/translator_cache_dir_disabled.xml b/Tests/DependencyInjection/Fixtures/xml/translator_cache_dir_disabled.xml index b135907da..5704ff7cd 100644 --- a/Tests/DependencyInjection/Fixtures/xml/translator_cache_dir_disabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/translator_cache_dir_disabled.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/translator_fallbacks.xml b/Tests/DependencyInjection/Fixtures/xml/translator_fallbacks.xml index b12f54f6f..521f8e381 100644 --- a/Tests/DependencyInjection/Fixtures/xml/translator_fallbacks.xml +++ b/Tests/DependencyInjection/Fixtures/xml/translator_fallbacks.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + en fr diff --git a/Tests/DependencyInjection/Fixtures/xml/translator_globals.xml b/Tests/DependencyInjection/Fixtures/xml/translator_globals.xml index 017fd9393..9532794f2 100644 --- a/Tests/DependencyInjection/Fixtures/xml/translator_globals.xml +++ b/Tests/DependencyInjection/Fixtures/xml/translator_globals.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + My application diff --git a/Tests/DependencyInjection/Fixtures/xml/translator_without_globals.xml b/Tests/DependencyInjection/Fixtures/xml/translator_without_globals.xml index 6c686bd30..a47890243 100644 --- a/Tests/DependencyInjection/Fixtures/xml/translator_without_globals.xml +++ b/Tests/DependencyInjection/Fixtures/xml/translator_without_globals.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/type_info.xml b/Tests/DependencyInjection/Fixtures/xml/type_info.xml index 0fe4d525d..7c38cf344 100644 --- a/Tests/DependencyInjection/Fixtures/xml/type_info.xml +++ b/Tests/DependencyInjection/Fixtures/xml/type_info.xml @@ -5,9 +5,9 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - - + + + int + diff --git a/Tests/DependencyInjection/Fixtures/xml/validation_attributes.xml b/Tests/DependencyInjection/Fixtures/xml/validation_attributes.xml index fe269612a..fb00a949d 100644 --- a/Tests/DependencyInjection/Fixtures/xml/validation_attributes.xml +++ b/Tests/DependencyInjection/Fixtures/xml/validation_attributes.xml @@ -6,10 +6,8 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - - + + diff --git a/Tests/DependencyInjection/Fixtures/xml/validation_auto_mapping.xml b/Tests/DependencyInjection/Fixtures/xml/validation_auto_mapping.xml index 966598091..a05aaf801 100644 --- a/Tests/DependencyInjection/Fixtures/xml/validation_auto_mapping.xml +++ b/Tests/DependencyInjection/Fixtures/xml/validation_auto_mapping.xml @@ -3,11 +3,9 @@ - - - - - + + + foo bar diff --git a/Tests/DependencyInjection/Fixtures/xml/validation_email_validation_mode.xml b/Tests/DependencyInjection/Fixtures/xml/validation_email_validation_mode.xml index a55681e8f..9472b7af1 100644 --- a/Tests/DependencyInjection/Fixtures/xml/validation_email_validation_mode.xml +++ b/Tests/DependencyInjection/Fixtures/xml/validation_email_validation_mode.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - - + + diff --git a/Tests/DependencyInjection/Fixtures/xml/validation_mapping.xml b/Tests/DependencyInjection/Fixtures/xml/validation_mapping.xml index 28e3917c1..8d74ebb21 100644 --- a/Tests/DependencyInjection/Fixtures/xml/validation_mapping.xml +++ b/Tests/DependencyInjection/Fixtures/xml/validation_mapping.xml @@ -4,10 +4,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:framework="http://symfony.com/schema/dic/symfony"> - - - - + + %kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/files %kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/validation.yml diff --git a/Tests/DependencyInjection/Fixtures/xml/validation_multiple_static_methods.xml b/Tests/DependencyInjection/Fixtures/xml/validation_multiple_static_methods.xml index ba43487e0..c2e84c3b9 100644 --- a/Tests/DependencyInjection/Fixtures/xml/validation_multiple_static_methods.xml +++ b/Tests/DependencyInjection/Fixtures/xml/validation_multiple_static_methods.xml @@ -6,10 +6,8 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - - + + loadFoo loadBar diff --git a/Tests/DependencyInjection/Fixtures/xml/validation_no_static_method.xml b/Tests/DependencyInjection/Fixtures/xml/validation_no_static_method.xml index b73890cff..61770d88a 100644 --- a/Tests/DependencyInjection/Fixtures/xml/validation_no_static_method.xml +++ b/Tests/DependencyInjection/Fixtures/xml/validation_no_static_method.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - - + + diff --git a/Tests/DependencyInjection/Fixtures/xml/validation_translation_domain.xml b/Tests/DependencyInjection/Fixtures/xml/validation_translation_domain.xml index 4f7027a05..3690f9e10 100644 --- a/Tests/DependencyInjection/Fixtures/xml/validation_translation_domain.xml +++ b/Tests/DependencyInjection/Fixtures/xml/validation_translation_domain.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - - + + diff --git a/Tests/DependencyInjection/Fixtures/xml/web_link.xml b/Tests/DependencyInjection/Fixtures/xml/web_link.xml index 62aa77125..718ceb31a 100644 --- a/Tests/DependencyInjection/Fixtures/xml/web_link.xml +++ b/Tests/DependencyInjection/Fixtures/xml/web_link.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/webhook.xml b/Tests/DependencyInjection/Fixtures/xml/webhook.xml index fba138407..411ea9b81 100644 --- a/Tests/DependencyInjection/Fixtures/xml/webhook.xml +++ b/Tests/DependencyInjection/Fixtures/xml/webhook.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/webhook_without_serializer.xml b/Tests/DependencyInjection/Fixtures/xml/webhook_without_serializer.xml index 8e4ec9443..4bc4dfd33 100644 --- a/Tests/DependencyInjection/Fixtures/xml/webhook_without_serializer.xml +++ b/Tests/DependencyInjection/Fixtures/xml/webhook_without_serializer.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/workflow_glob_places.xml b/Tests/DependencyInjection/Fixtures/xml/workflow_glob_places.xml new file mode 100644 index 000000000..f5d198b5b --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/xml/workflow_glob_places.xml @@ -0,0 +1,23 @@ + + + + + + + + Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase + + a + b + + + b + c + + + + diff --git a/Tests/DependencyInjection/Fixtures/xml/workflow_not_valid.xml b/Tests/DependencyInjection/Fixtures/xml/workflow_not_valid.xml index c2126f0f3..1aa7b099a 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflow_not_valid.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflow_not_valid.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase diff --git a/Tests/DependencyInjection/Fixtures/xml/workflow_with_complex_place_follow_by_simplistic_place_config.xml b/Tests/DependencyInjection/Fixtures/xml/workflow_with_complex_place_follow_by_simplistic_place_config.xml index 364faa62f..70962025d 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflow_with_complex_place_follow_by_simplistic_place_config.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflow_with_complex_place_follow_by_simplistic_place_config.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" > - - - + draft diff --git a/Tests/DependencyInjection/Fixtures/xml/workflow_with_guard_expression.xml b/Tests/DependencyInjection/Fixtures/xml/workflow_with_guard_expression.xml index 56070b016..6420f099b 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflow_with_guard_expression.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflow_with_guard_expression.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + draft Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase diff --git a/Tests/DependencyInjection/Fixtures/xml/workflow_with_multiple_transitions_with_same_name.xml b/Tests/DependencyInjection/Fixtures/xml/workflow_with_multiple_transitions_with_same_name.xml index 0435447b6..815c83aff 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflow_with_multiple_transitions_with_same_name.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflow_with_multiple_transitions_with_same_name.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + draft Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase diff --git a/Tests/DependencyInjection/Fixtures/xml/workflow_with_no_events_to_dispatch.xml b/Tests/DependencyInjection/Fixtures/xml/workflow_with_no_events_to_dispatch.xml index 1e1ae4746..4842e54bf 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflow_with_no_events_to_dispatch.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflow_with_no_events_to_dispatch.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + one diff --git a/Tests/DependencyInjection/Fixtures/xml/workflow_with_simplistic_place_follow_by_complex_place_config.xml b/Tests/DependencyInjection/Fixtures/xml/workflow_with_simplistic_place_follow_by_complex_place_config.xml index 81046a75b..baa3603aa 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflow_with_simplistic_place_follow_by_complex_place_config.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflow_with_simplistic_place_follow_by_complex_place_config.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" > - - - + draft diff --git a/Tests/DependencyInjection/Fixtures/xml/workflow_with_specified_events_to_dispatch.xml b/Tests/DependencyInjection/Fixtures/xml/workflow_with_specified_events_to_dispatch.xml index e51495001..aa5cca25b 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflow_with_specified_events_to_dispatch.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflow_with_specified_events_to_dispatch.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + one diff --git a/Tests/DependencyInjection/Fixtures/xml/workflow_with_support_and_support_strategy.xml b/Tests/DependencyInjection/Fixtures/xml/workflow_with_support_and_support_strategy.xml index f36890a5b..c6170b6fe 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflow_with_support_and_support_strategy.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflow_with_support_and_support_strategy.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase diff --git a/Tests/DependencyInjection/Fixtures/xml/workflow_without_support_and_support_strategy.xml b/Tests/DependencyInjection/Fixtures/xml/workflow_without_support_and_support_strategy.xml index fe43059da..c6ee7d77b 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflow_without_support_and_support_strategy.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflow_without_support_and_support_strategy.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/workflows.xml b/Tests/DependencyInjection/Fixtures/xml/workflows.xml index c5dae479d..ae3b72112 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflows.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflows.xml @@ -6,9 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + draft diff --git a/Tests/DependencyInjection/Fixtures/xml/workflows_enabled.xml b/Tests/DependencyInjection/Fixtures/xml/workflows_enabled.xml index dcd9a89db..26e622e9e 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflows_enabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflows_enabled.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + diff --git a/Tests/DependencyInjection/Fixtures/xml/workflows_explicitly_enabled.xml b/Tests/DependencyInjection/Fixtures/xml/workflows_explicitly_enabled.xml index 9960de99a..c27c51d06 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflows_explicitly_enabled.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflows_explicitly_enabled.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase bar diff --git a/Tests/DependencyInjection/Fixtures/xml/workflows_explicitly_enabled_named_workflows.xml b/Tests/DependencyInjection/Fixtures/xml/workflows_explicitly_enabled_named_workflows.xml index 7ee4c5136..34e58c86d 100644 --- a/Tests/DependencyInjection/Fixtures/xml/workflows_explicitly_enabled_named_workflows.xml +++ b/Tests/DependencyInjection/Fixtures/xml/workflows_explicitly_enabled_named_workflows.xml @@ -5,9 +5,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> - - - + bar Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase diff --git a/Tests/DependencyInjection/Fixtures/yml/asset_mapper_without_assets.yml b/Tests/DependencyInjection/Fixtures/yml/asset_mapper_without_assets.yml index 51f302b66..5c09f79ae 100644 --- a/Tests/DependencyInjection/Fixtures/yml/asset_mapper_without_assets.yml +++ b/Tests/DependencyInjection/Fixtures/yml/asset_mapper_without_assets.yml @@ -1,8 +1,3 @@ framework: - annotations: false asset_mapper: ~ assets: false - handle_all_throwables: true - http_method_override: false - php_errors: - log: true diff --git a/Tests/DependencyInjection/Fixtures/yml/assets.yml b/Tests/DependencyInjection/Fixtures/yml/assets.yml index 6340f50d7..cfd4f07b0 100644 --- a/Tests/DependencyInjection/Fixtures/yml/assets.yml +++ b/Tests/DependencyInjection/Fixtures/yml/assets.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true assets: version: SomeVersionScheme version_format: '%%s?version=%%s' diff --git a/Tests/DependencyInjection/Fixtures/yml/assets_disabled.yml b/Tests/DependencyInjection/Fixtures/yml/assets_disabled.yml index eb8aecb1e..17ba4e90a 100644 --- a/Tests/DependencyInjection/Fixtures/yml/assets_disabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/assets_disabled.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true assets: enabled: false diff --git a/Tests/DependencyInjection/Fixtures/yml/assets_version_strategy_as_service.yml b/Tests/DependencyInjection/Fixtures/yml/assets_version_strategy_as_service.yml index 73614bde6..2528462f8 100644 --- a/Tests/DependencyInjection/Fixtures/yml/assets_version_strategy_as_service.yml +++ b/Tests/DependencyInjection/Fixtures/yml/assets_version_strategy_as_service.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true assets: version_strategy: assets.custom_version_strategy base_urls: http://cdn.example.com diff --git a/Tests/DependencyInjection/Fixtures/yml/cache.yml b/Tests/DependencyInjection/Fixtures/yml/cache.yml index e88c77f1c..c89c027f5 100644 --- a/Tests/DependencyInjection/Fixtures/yml/cache.yml +++ b/Tests/DependencyInjection/Fixtures/yml/cache.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true cache: pools: cache.foo: diff --git a/Tests/DependencyInjection/Fixtures/yml/cache_app_redis_tag_aware.yml b/Tests/DependencyInjection/Fixtures/yml/cache_app_redis_tag_aware.yml index c19943a8e..b1c89adaf 100644 --- a/Tests/DependencyInjection/Fixtures/yml/cache_app_redis_tag_aware.yml +++ b/Tests/DependencyInjection/Fixtures/yml/cache_app_redis_tag_aware.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true cache: app: cache.adapter.redis_tag_aware diff --git a/Tests/DependencyInjection/Fixtures/yml/cache_app_redis_tag_aware_pool.yml b/Tests/DependencyInjection/Fixtures/yml/cache_app_redis_tag_aware_pool.yml index 35df91a24..9eb8b83c7 100644 --- a/Tests/DependencyInjection/Fixtures/yml/cache_app_redis_tag_aware_pool.yml +++ b/Tests/DependencyInjection/Fixtures/yml/cache_app_redis_tag_aware_pool.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true cache: app: cache.redis_tag_aware.foo pools: diff --git a/Tests/DependencyInjection/Fixtures/yml/csrf.yml b/Tests/DependencyInjection/Fixtures/yml/csrf.yml index 6e24d410d..e222e108f 100644 --- a/Tests/DependencyInjection/Fixtures/yml/csrf.yml +++ b/Tests/DependencyInjection/Fixtures/yml/csrf.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true secret: s3cr3t csrf_protection: ~ session: diff --git a/Tests/DependencyInjection/Fixtures/yml/csrf_needs_session.yml b/Tests/DependencyInjection/Fixtures/yml/csrf_needs_session.yml index 1f6e73d0c..b8065b6fb 100644 --- a/Tests/DependencyInjection/Fixtures/yml/csrf_needs_session.yml +++ b/Tests/DependencyInjection/Fixtures/yml/csrf_needs_session.yml @@ -1,7 +1,2 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true csrf_protection: ~ diff --git a/Tests/DependencyInjection/Fixtures/yml/default_config.yml b/Tests/DependencyInjection/Fixtures/yml/default_config.yml index 0fb93a414..6455b36d2 100644 --- a/Tests/DependencyInjection/Fixtures/yml/default_config.yml +++ b/Tests/DependencyInjection/Fixtures/yml/default_config.yml @@ -1,6 +1 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true diff --git a/Tests/DependencyInjection/Fixtures/yml/esi_and_ssi_without_fragments.yml b/Tests/DependencyInjection/Fixtures/yml/esi_and_ssi_without_fragments.yml index 428a2fa04..49d63c8d6 100644 --- a/Tests/DependencyInjection/Fixtures/yml/esi_and_ssi_without_fragments.yml +++ b/Tests/DependencyInjection/Fixtures/yml/esi_and_ssi_without_fragments.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true fragments: enabled: false esi: diff --git a/Tests/DependencyInjection/Fixtures/yml/esi_disabled.yml b/Tests/DependencyInjection/Fixtures/yml/esi_disabled.yml index 255a3a863..2a78e6da0 100644 --- a/Tests/DependencyInjection/Fixtures/yml/esi_disabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/esi_disabled.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true esi: enabled: false diff --git a/Tests/DependencyInjection/Fixtures/yml/exceptions.yml b/Tests/DependencyInjection/Fixtures/yml/exceptions.yml index 3744d5402..3958c4c5f 100644 --- a/Tests/DependencyInjection/Fixtures/yml/exceptions.yml +++ b/Tests/DependencyInjection/Fixtures/yml/exceptions.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true exceptions: Symfony\Component\HttpKernel\Exception\BadRequestHttpException: log_level: info diff --git a/Tests/DependencyInjection/Fixtures/yml/form_csrf_disabled.yml b/Tests/DependencyInjection/Fixtures/yml/form_csrf_disabled.yml index 20350c9e8..9319019c8 100644 --- a/Tests/DependencyInjection/Fixtures/yml/form_csrf_disabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/form_csrf_disabled.yml @@ -1,9 +1,4 @@ framework: - annotations: false csrf_protection: false form: csrf_protection: true - http_method_override: false - handle_all_throwables: true - php_errors: - log: true diff --git a/Tests/DependencyInjection/Fixtures/yml/form_csrf_field_attr.yml b/Tests/DependencyInjection/Fixtures/yml/form_csrf_field_attr.yml index db5199775..8307b6d14 100644 --- a/Tests/DependencyInjection/Fixtures/yml/form_csrf_field_attr.yml +++ b/Tests/DependencyInjection/Fixtures/yml/form_csrf_field_attr.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true csrf_protection: enabled: true form: diff --git a/Tests/DependencyInjection/Fixtures/yml/form_default_csrf.yml b/Tests/DependencyInjection/Fixtures/yml/form_default_csrf.yml index 001f7c4ca..fbe2aaa71 100644 --- a/Tests/DependencyInjection/Fixtures/yml/form_default_csrf.yml +++ b/Tests/DependencyInjection/Fixtures/yml/form_default_csrf.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true session: storage_factory_id: session.storage.factory.native handler_id: null diff --git a/Tests/DependencyInjection/Fixtures/yml/form_no_csrf.yml b/Tests/DependencyInjection/Fixtures/yml/form_no_csrf.yml index a86432f8d..e3ac7e8da 100644 --- a/Tests/DependencyInjection/Fixtures/yml/form_no_csrf.yml +++ b/Tests/DependencyInjection/Fixtures/yml/form_no_csrf.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true form: csrf_protection: enabled: false diff --git a/Tests/DependencyInjection/Fixtures/yml/fragments_and_hinclude.yml b/Tests/DependencyInjection/Fixtures/yml/fragments_and_hinclude.yml index 876ff7289..b03f37da7 100644 --- a/Tests/DependencyInjection/Fixtures/yml/fragments_and_hinclude.yml +++ b/Tests/DependencyInjection/Fixtures/yml/fragments_and_hinclude.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true fragments: enabled: true hinclude_default_template: global_hinclude_template diff --git a/Tests/DependencyInjection/Fixtures/yml/full.yml b/Tests/DependencyInjection/Fixtures/yml/full.yml index 8a1a3834b..28111b589 100644 --- a/Tests/DependencyInjection/Fixtures/yml/full.yml +++ b/Tests/DependencyInjection/Fixtures/yml/full.yml @@ -48,7 +48,6 @@ framework: validation: enabled: true email_validation_mode: html5 - annotations: false serializer: enabled: true enable_attributes: true @@ -64,8 +63,7 @@ framework: default_context: enable_max_depth: false type_info: ~ - property_info: - with_constructor_extractor: true + property_info: ~ ide: file%%link%%format request: formats: diff --git a/Tests/DependencyInjection/Fixtures/yml/html_sanitizer.yml b/Tests/DependencyInjection/Fixtures/yml/html_sanitizer.yml index f0d515e41..fd7fbd1c3 100644 --- a/Tests/DependencyInjection/Fixtures/yml/html_sanitizer.yml +++ b/Tests/DependencyInjection/Fixtures/yml/html_sanitizer.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true html_sanitizer: sanitizers: custom: diff --git a/Tests/DependencyInjection/Fixtures/yml/html_sanitizer_default_allowed_link_and_media_hosts.yml b/Tests/DependencyInjection/Fixtures/yml/html_sanitizer_default_allowed_link_and_media_hosts.yml index c5b79e9da..ab77b0144 100644 --- a/Tests/DependencyInjection/Fixtures/yml/html_sanitizer_default_allowed_link_and_media_hosts.yml +++ b/Tests/DependencyInjection/Fixtures/yml/html_sanitizer_default_allowed_link_and_media_hosts.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true html_sanitizer: sanitizers: custom_default: ~ diff --git a/Tests/DependencyInjection/Fixtures/yml/html_sanitizer_default_config.yml b/Tests/DependencyInjection/Fixtures/yml/html_sanitizer_default_config.yml index e7f48e904..7b4c5cb09 100644 --- a/Tests/DependencyInjection/Fixtures/yml/html_sanitizer_default_config.yml +++ b/Tests/DependencyInjection/Fixtures/yml/html_sanitizer_default_config.yml @@ -1,7 +1,2 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true html_sanitizer: ~ diff --git a/Tests/DependencyInjection/Fixtures/yml/http_client_default_options.yml b/Tests/DependencyInjection/Fixtures/yml/http_client_default_options.yml index d062da83e..6828f8ec2 100644 --- a/Tests/DependencyInjection/Fixtures/yml/http_client_default_options.yml +++ b/Tests/DependencyInjection/Fixtures/yml/http_client_default_options.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true http_client: max_host_connections: 4 default_options: ~ diff --git a/Tests/DependencyInjection/Fixtures/yml/http_client_full_default_options.yml b/Tests/DependencyInjection/Fixtures/yml/http_client_full_default_options.yml index ee88b7213..e0263544e 100644 --- a/Tests/DependencyInjection/Fixtures/yml/http_client_full_default_options.yml +++ b/Tests/DependencyInjection/Fixtures/yml/http_client_full_default_options.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true http_client: default_options: headers: diff --git a/Tests/DependencyInjection/Fixtures/yml/http_client_mock_response_factory.yml b/Tests/DependencyInjection/Fixtures/yml/http_client_mock_response_factory.yml index 92c40b459..b95859108 100644 --- a/Tests/DependencyInjection/Fixtures/yml/http_client_mock_response_factory.yml +++ b/Tests/DependencyInjection/Fixtures/yml/http_client_mock_response_factory.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true http_client: default_options: ~ mock_response_factory: my_response_factory diff --git a/Tests/DependencyInjection/Fixtures/yml/http_client_override_default_options.yml b/Tests/DependencyInjection/Fixtures/yml/http_client_override_default_options.yml index dcc77c7d9..baa29b1ab 100644 --- a/Tests/DependencyInjection/Fixtures/yml/http_client_override_default_options.yml +++ b/Tests/DependencyInjection/Fixtures/yml/http_client_override_default_options.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true http_client: max_host_connections: 4 default_options: diff --git a/Tests/DependencyInjection/Fixtures/yml/http_client_rate_limiter.yml b/Tests/DependencyInjection/Fixtures/yml/http_client_rate_limiter.yml index 6376192b7..5a0eb41a9 100644 --- a/Tests/DependencyInjection/Fixtures/yml/http_client_rate_limiter.yml +++ b/Tests/DependencyInjection/Fixtures/yml/http_client_rate_limiter.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true rate_limiter: foo_limiter: lock_factory: null diff --git a/Tests/DependencyInjection/Fixtures/yml/http_client_retry.yml b/Tests/DependencyInjection/Fixtures/yml/http_client_retry.yml index ea59b82d9..eba686819 100644 --- a/Tests/DependencyInjection/Fixtures/yml/http_client_retry.yml +++ b/Tests/DependencyInjection/Fixtures/yml/http_client_retry.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true http_client: default_options: retry_failed: diff --git a/Tests/DependencyInjection/Fixtures/yml/http_client_scoped_without_query_option.yml b/Tests/DependencyInjection/Fixtures/yml/http_client_scoped_without_query_option.yml index 63435d075..ecfc9d41f 100644 --- a/Tests/DependencyInjection/Fixtures/yml/http_client_scoped_without_query_option.yml +++ b/Tests/DependencyInjection/Fixtures/yml/http_client_scoped_without_query_option.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true http_client: scoped_clients: foo: diff --git a/Tests/DependencyInjection/Fixtures/yml/http_client_xml_key.yml b/Tests/DependencyInjection/Fixtures/yml/http_client_xml_key.yml index b3cab477a..dc87555a9 100644 --- a/Tests/DependencyInjection/Fixtures/yml/http_client_xml_key.yml +++ b/Tests/DependencyInjection/Fixtures/yml/http_client_xml_key.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true http_client: default_options: resolve: diff --git a/Tests/DependencyInjection/Fixtures/yml/json_streamer.yml b/Tests/DependencyInjection/Fixtures/yml/json_streamer.yml index 8873fea97..62d23aebc 100644 --- a/Tests/DependencyInjection/Fixtures/yml/json_streamer.yml +++ b/Tests/DependencyInjection/Fixtures/yml/json_streamer.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true type_info: enabled: true json_streamer: diff --git a/Tests/DependencyInjection/Fixtures/yml/lock.yml b/Tests/DependencyInjection/Fixtures/yml/lock.yml index d5db440e5..70f578a14 100644 --- a/Tests/DependencyInjection/Fixtures/yml/lock.yml +++ b/Tests/DependencyInjection/Fixtures/yml/lock.yml @@ -1,7 +1,2 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true lock: ~ diff --git a/Tests/DependencyInjection/Fixtures/yml/lock_named.yml b/Tests/DependencyInjection/Fixtures/yml/lock_named.yml index 631574030..3e32f4f0a 100644 --- a/Tests/DependencyInjection/Fixtures/yml/lock_named.yml +++ b/Tests/DependencyInjection/Fixtures/yml/lock_named.yml @@ -2,11 +2,6 @@ parameters: env(REDIS_DSN): redis://paas.com framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true lock: foo: semaphore bar: flock diff --git a/Tests/DependencyInjection/Fixtures/yml/lock_service.yml b/Tests/DependencyInjection/Fixtures/yml/lock_service.yml index 1b5dfea17..4a7e77cfc 100644 --- a/Tests/DependencyInjection/Fixtures/yml/lock_service.yml +++ b/Tests/DependencyInjection/Fixtures/yml/lock_service.yml @@ -3,9 +3,4 @@ services: class: \Redis framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true lock: my_service diff --git a/Tests/DependencyInjection/Fixtures/yml/mailer_with_disabled_message_bus.yml b/Tests/DependencyInjection/Fixtures/yml/mailer_with_disabled_message_bus.yml index d6e62c3ce..f941f7c8c 100644 --- a/Tests/DependencyInjection/Fixtures/yml/mailer_with_disabled_message_bus.yml +++ b/Tests/DependencyInjection/Fixtures/yml/mailer_with_disabled_message_bus.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true mailer: dsn: 'smtp://example.com' message_bus: false diff --git a/Tests/DependencyInjection/Fixtures/yml/mailer_with_dsn.yml b/Tests/DependencyInjection/Fixtures/yml/mailer_with_dsn.yml index ea703bdad..a9aafa4ab 100644 --- a/Tests/DependencyInjection/Fixtures/yml/mailer_with_dsn.yml +++ b/Tests/DependencyInjection/Fixtures/yml/mailer_with_dsn.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true mailer: dsn: 'smtp://example.com' envelope: diff --git a/Tests/DependencyInjection/Fixtures/yml/mailer_with_specific_message_bus.yml b/Tests/DependencyInjection/Fixtures/yml/mailer_with_specific_message_bus.yml index 10942315e..ddfc7a479 100644 --- a/Tests/DependencyInjection/Fixtures/yml/mailer_with_specific_message_bus.yml +++ b/Tests/DependencyInjection/Fixtures/yml/mailer_with_specific_message_bus.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true mailer: dsn: 'smtp://example.com' message_bus: app.another_bus diff --git a/Tests/DependencyInjection/Fixtures/yml/mailer_with_transports.yml b/Tests/DependencyInjection/Fixtures/yml/mailer_with_transports.yml index ae10f6aee..cc15a174d 100644 --- a/Tests/DependencyInjection/Fixtures/yml/mailer_with_transports.yml +++ b/Tests/DependencyInjection/Fixtures/yml/mailer_with_transports.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true mailer: transports: transport1: 'smtp://example1.com' diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger.yml b/Tests/DependencyInjection/Fixtures/yml/messenger.yml index fc22c3a2e..a463c4a10 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true scheduler: true messenger: routing: diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml index 79f8d7c87..9eb913ec5 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_bus_name_stamp.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true lock: false messenger: default_bus: messenger.bus.commands diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_disabled.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_disabled.yml index 2d2b18519..4c1508c74 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_disabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_disabled.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: false scheduler: false diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_middleware_factory_erroneous_format.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_middleware_factory_erroneous_format.yml index 0c12e95d5..74431414b 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_middleware_factory_erroneous_format.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_middleware_factory_erroneous_format.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: buses: command_bus: diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_buses_with_deduplicate_middleware.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_buses_with_deduplicate_middleware.yml index ed52564c7..0b57eaeca 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_buses_with_deduplicate_middleware.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_buses_with_deduplicate_middleware.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true lock: ~ messenger: default_bus: messenger.bus.commands diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_buses_without_deduplicate_middleware.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_buses_without_deduplicate_middleware.yml index 38fca5737..e60cbf84c 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_buses_without_deduplicate_middleware.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_buses_without_deduplicate_middleware.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true lock: false messenger: default_bus: messenger.bus.commands diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_failure_transports.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_failure_transports.yml index 38ad9f4f2..863f18a7d 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_failure_transports.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_failure_transports.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: transports: transport_1: diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_failure_transports_global.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_failure_transports_global.yml index 7348cb01e..10023edb0 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_failure_transports_global.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_multiple_failure_transports_global.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: failure_transport: failure_transport_global transports: diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_routing.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_routing.yml index 44f298a25..be91c828c 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_routing.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_routing.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true serializer: true messenger: serializer: diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_routing_invalid_transport.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_routing_invalid_transport.yml index f3b847010..3bf0f2ddf 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_routing_invalid_transport.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_routing_invalid_transport.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true serializer: true messenger: serializer: diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_routing_invalid_wildcard.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_routing_invalid_wildcard.yml index a847ca62c..ed22e0afc 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_routing_invalid_wildcard.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_routing_invalid_wildcard.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true serializer: true messenger: serializer: diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_routing_single.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_routing_single.yml index 21f51aeff..caa886418 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_routing_single.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_routing_single.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: routing: 'Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage': [amqp] diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_schedule.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_schedule.yml index e7c0e78be..a8e4cb010 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_schedule.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_schedule.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: transports: schedule: 'schedule://default' diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_transport.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_transport.yml index 040be0530..b51feb73b 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_transport.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_transport.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true serializer: true messenger: serializer: diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_transports.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_transports.yml index 6fb095a3e..36e429a2e 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_transports.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_transports.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true serializer: true messenger: failure_transport: failed diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_with_disabled_reset_on_message.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_with_disabled_reset_on_message.yml index 7fb1cdc05..f67395c85 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_with_disabled_reset_on_message.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_with_disabled_reset_on_message.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: reset_on_message: false routing: diff --git a/Tests/DependencyInjection/Fixtures/yml/messenger_with_explict_reset_on_message_legacy.yml b/Tests/DependencyInjection/Fixtures/yml/messenger_with_explict_reset_on_message_legacy.yml index 20e7ace17..3bf374f47 100644 --- a/Tests/DependencyInjection/Fixtures/yml/messenger_with_explict_reset_on_message_legacy.yml +++ b/Tests/DependencyInjection/Fixtures/yml/messenger_with_explict_reset_on_message_legacy.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: reset_on_message: true routing: diff --git a/Tests/DependencyInjection/Fixtures/yml/notifier.yml b/Tests/DependencyInjection/Fixtures/yml/notifier.yml index 0263b587b..586cb98a4 100644 --- a/Tests/DependencyInjection/Fixtures/yml/notifier.yml +++ b/Tests/DependencyInjection/Fixtures/yml/notifier.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: enabled: true mailer: diff --git a/Tests/DependencyInjection/Fixtures/yml/notifier_with_disabled_message_bus.yml b/Tests/DependencyInjection/Fixtures/yml/notifier_with_disabled_message_bus.yml index 945f60838..08b3d6ad6 100644 --- a/Tests/DependencyInjection/Fixtures/yml/notifier_with_disabled_message_bus.yml +++ b/Tests/DependencyInjection/Fixtures/yml/notifier_with_disabled_message_bus.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: enabled: true mailer: diff --git a/Tests/DependencyInjection/Fixtures/yml/notifier_with_specific_message_bus.yml b/Tests/DependencyInjection/Fixtures/yml/notifier_with_specific_message_bus.yml index 65efbf567..1851717bd 100644 --- a/Tests/DependencyInjection/Fixtures/yml/notifier_with_specific_message_bus.yml +++ b/Tests/DependencyInjection/Fixtures/yml/notifier_with_specific_message_bus.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true messenger: enabled: true mailer: diff --git a/Tests/DependencyInjection/Fixtures/yml/notifier_without_mailer.yml b/Tests/DependencyInjection/Fixtures/yml/notifier_without_mailer.yml index 7c5817cdf..75fa3cf88 100644 --- a/Tests/DependencyInjection/Fixtures/yml/notifier_without_mailer.yml +++ b/Tests/DependencyInjection/Fixtures/yml/notifier_without_mailer.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true mailer: enabled: false messenger: diff --git a/Tests/DependencyInjection/Fixtures/yml/notifier_without_messenger.yml b/Tests/DependencyInjection/Fixtures/yml/notifier_without_messenger.yml index f6f6572ec..be48fb168 100644 --- a/Tests/DependencyInjection/Fixtures/yml/notifier_without_messenger.yml +++ b/Tests/DependencyInjection/Fixtures/yml/notifier_without_messenger.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true mailer: dsn: 'smtp://example.com' messenger: diff --git a/Tests/DependencyInjection/Fixtures/yml/notifier_without_transports.yml b/Tests/DependencyInjection/Fixtures/yml/notifier_without_transports.yml index afc9913d3..856b0cd7c 100644 --- a/Tests/DependencyInjection/Fixtures/yml/notifier_without_transports.yml +++ b/Tests/DependencyInjection/Fixtures/yml/notifier_without_transports.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true notifier: enabled: true diff --git a/Tests/DependencyInjection/Fixtures/yml/php_errors_disabled.yml b/Tests/DependencyInjection/Fixtures/yml/php_errors_disabled.yml index f63424f12..e31944f5a 100644 --- a/Tests/DependencyInjection/Fixtures/yml/php_errors_disabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/php_errors_disabled.yml @@ -1,7 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true php_errors: log: false throw: false diff --git a/Tests/DependencyInjection/Fixtures/yml/php_errors_enabled.yml b/Tests/DependencyInjection/Fixtures/yml/php_errors_enabled.yml index f9f5b4fd4..6897f9623 100644 --- a/Tests/DependencyInjection/Fixtures/yml/php_errors_enabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/php_errors_enabled.yml @@ -1,7 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true php_errors: - log: true throw: true diff --git a/Tests/DependencyInjection/Fixtures/yml/php_errors_log_level.yml b/Tests/DependencyInjection/Fixtures/yml/php_errors_log_level.yml index 4bcc0e4ec..e5cff7767 100644 --- a/Tests/DependencyInjection/Fixtures/yml/php_errors_log_level.yml +++ b/Tests/DependencyInjection/Fixtures/yml/php_errors_log_level.yml @@ -1,6 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true php_errors: log: 8 diff --git a/Tests/DependencyInjection/Fixtures/yml/php_errors_log_levels.yml b/Tests/DependencyInjection/Fixtures/yml/php_errors_log_levels.yml index e89eb64aa..ad9fd3066 100644 --- a/Tests/DependencyInjection/Fixtures/yml/php_errors_log_levels.yml +++ b/Tests/DependencyInjection/Fixtures/yml/php_errors_log_levels.yml @@ -1,7 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true php_errors: log: !php/const \E_NOTICE: !php/const Psr\Log\LogLevel::ERROR diff --git a/Tests/DependencyInjection/Fixtures/yml/profiler.yml b/Tests/DependencyInjection/Fixtures/yml/profiler.yml index 2ccec1685..8cc59ab8f 100644 --- a/Tests/DependencyInjection/Fixtures/yml/profiler.yml +++ b/Tests/DependencyInjection/Fixtures/yml/profiler.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true profiler: enabled: true collect_serializer_data: true diff --git a/Tests/DependencyInjection/Fixtures/yml/property_accessor.yml b/Tests/DependencyInjection/Fixtures/yml/property_accessor.yml index b690216c8..931b50383 100644 --- a/Tests/DependencyInjection/Fixtures/yml/property_accessor.yml +++ b/Tests/DependencyInjection/Fixtures/yml/property_accessor.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true property_access: magic_call: true magic_get: true diff --git a/Tests/DependencyInjection/Fixtures/yml/property_info.yml b/Tests/DependencyInjection/Fixtures/yml/property_info.yml index 4fde73710..fbdf7a7b0 100644 --- a/Tests/DependencyInjection/Fixtures/yml/property_info.yml +++ b/Tests/DependencyInjection/Fixtures/yml/property_info.yml @@ -1,9 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true property_info: enabled: true - with_constructor_extractor: false diff --git a/Tests/DependencyInjection/Fixtures/yml/property_info_with_constructor_extractor.yml b/Tests/DependencyInjection/Fixtures/yml/property_info_with_constructor_extractor.yml deleted file mode 100644 index a43762df3..000000000 --- a/Tests/DependencyInjection/Fixtures/yml/property_info_with_constructor_extractor.yml +++ /dev/null @@ -1,9 +0,0 @@ -framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true - property_info: - enabled: true - with_constructor_extractor: true diff --git a/Tests/DependencyInjection/Fixtures/yml/property_info_without_constructor_extractor.yml b/Tests/DependencyInjection/Fixtures/yml/property_info_without_constructor_extractor.yml new file mode 100644 index 000000000..20dc3340a --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/yml/property_info_without_constructor_extractor.yml @@ -0,0 +1,4 @@ +framework: + property_info: + enabled: true + with_constructor_extractor: false diff --git a/Tests/DependencyInjection/Fixtures/yml/request.yml b/Tests/DependencyInjection/Fixtures/yml/request.yml index 8d6520c5a..9beae1dc5 100644 --- a/Tests/DependencyInjection/Fixtures/yml/request.yml +++ b/Tests/DependencyInjection/Fixtures/yml/request.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true request: formats: ~ diff --git a/Tests/DependencyInjection/Fixtures/yml/semaphore.yml b/Tests/DependencyInjection/Fixtures/yml/semaphore.yml index 5fd71f69d..47b132351 100644 --- a/Tests/DependencyInjection/Fixtures/yml/semaphore.yml +++ b/Tests/DependencyInjection/Fixtures/yml/semaphore.yml @@ -1,7 +1,2 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true semaphore: redis://localhost diff --git a/Tests/DependencyInjection/Fixtures/yml/semaphore_named.yml b/Tests/DependencyInjection/Fixtures/yml/semaphore_named.yml index 0428a2e88..0a29e4ea8 100644 --- a/Tests/DependencyInjection/Fixtures/yml/semaphore_named.yml +++ b/Tests/DependencyInjection/Fixtures/yml/semaphore_named.yml @@ -2,11 +2,6 @@ parameters: env(REDIS_DSN): redis://paas.com framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true semaphore: foo: redis://paas.com qux: "%env(REDIS_DSN)%" diff --git a/Tests/DependencyInjection/Fixtures/yml/semaphore_service.yml b/Tests/DependencyInjection/Fixtures/yml/semaphore_service.yml index 62765ac91..ed3d6fa77 100644 --- a/Tests/DependencyInjection/Fixtures/yml/semaphore_service.yml +++ b/Tests/DependencyInjection/Fixtures/yml/semaphore_service.yml @@ -3,9 +3,4 @@ services: class: \Redis framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true semaphore: my_service diff --git a/Tests/DependencyInjection/Fixtures/yml/serializer_disabled.yml b/Tests/DependencyInjection/Fixtures/yml/serializer_disabled.yml index ad53d643e..330e19a69 100644 --- a/Tests/DependencyInjection/Fixtures/yml/serializer_disabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/serializer_disabled.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true serializer: enabled: false diff --git a/Tests/DependencyInjection/Fixtures/yml/serializer_enabled.yml b/Tests/DependencyInjection/Fixtures/yml/serializer_enabled.yml index 40d7c604e..40a1ff7d6 100644 --- a/Tests/DependencyInjection/Fixtures/yml/serializer_enabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/serializer_enabled.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true serializer: enabled: true diff --git a/Tests/DependencyInjection/Fixtures/yml/serializer_mapping.yml b/Tests/DependencyInjection/Fixtures/yml/serializer_mapping.yml index b2966b0ed..54d46ac61 100644 --- a/Tests/DependencyInjection/Fixtures/yml/serializer_mapping.yml +++ b/Tests/DependencyInjection/Fixtures/yml/serializer_mapping.yml @@ -1,9 +1,4 @@ framework: - http_method_override: false - handle_all_throwables: true - php_errors: - log: true - annotations: false serializer: enable_attributes: true mapping: diff --git a/Tests/DependencyInjection/Fixtures/yml/serializer_mapping_without_annotations.yml b/Tests/DependencyInjection/Fixtures/yml/serializer_mapping_without_attributes.yml similarity index 72% rename from Tests/DependencyInjection/Fixtures/yml/serializer_mapping_without_annotations.yml rename to Tests/DependencyInjection/Fixtures/yml/serializer_mapping_without_attributes.yml index 46425dc94..54d46ac61 100644 --- a/Tests/DependencyInjection/Fixtures/yml/serializer_mapping_without_annotations.yml +++ b/Tests/DependencyInjection/Fixtures/yml/serializer_mapping_without_attributes.yml @@ -1,11 +1,6 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true serializer: - enable_attributes: false + enable_attributes: true mapping: paths: - "%kernel.project_dir%/Fixtures/TestBundle/Resources/config/serializer_mapping/files" diff --git a/Tests/DependencyInjection/Fixtures/yml/serializer_without_translator.yml b/Tests/DependencyInjection/Fixtures/yml/serializer_without_translator.yml index 33ee3f4b8..3699306a6 100644 --- a/Tests/DependencyInjection/Fixtures/yml/serializer_without_translator.yml +++ b/Tests/DependencyInjection/Fixtures/yml/serializer_without_translator.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true serializer: enabled: true translator: diff --git a/Tests/DependencyInjection/Fixtures/yml/session.yml b/Tests/DependencyInjection/Fixtures/yml/session.yml index cddbf5a69..904fd3511 100644 --- a/Tests/DependencyInjection/Fixtures/yml/session.yml +++ b/Tests/DependencyInjection/Fixtures/yml/session.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true session: storage_factory_id: session.storage.factory.native handler_id: null diff --git a/Tests/DependencyInjection/Fixtures/yml/session_cookie_secure_auto.yml b/Tests/DependencyInjection/Fixtures/yml/session_cookie_secure_auto.yml index 04825830b..783f19c13 100644 --- a/Tests/DependencyInjection/Fixtures/yml/session_cookie_secure_auto.yml +++ b/Tests/DependencyInjection/Fixtures/yml/session_cookie_secure_auto.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true session: storage_factory_id: session.storage.factory.native handler_id: ~ diff --git a/Tests/DependencyInjection/Fixtures/yml/ssi_disabled.yml b/Tests/DependencyInjection/Fixtures/yml/ssi_disabled.yml index 5a1b61021..3a8a820c7 100644 --- a/Tests/DependencyInjection/Fixtures/yml/ssi_disabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/ssi_disabled.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true ssi: enabled: false diff --git a/Tests/DependencyInjection/Fixtures/yml/translator_cache_dir_disabled.yml b/Tests/DependencyInjection/Fixtures/yml/translator_cache_dir_disabled.yml index 0d37c5562..6ad1c7330 100644 --- a/Tests/DependencyInjection/Fixtures/yml/translator_cache_dir_disabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/translator_cache_dir_disabled.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true translator: cache_dir: ~ diff --git a/Tests/DependencyInjection/Fixtures/yml/translator_fallbacks.yml b/Tests/DependencyInjection/Fixtures/yml/translator_fallbacks.yml index 7a950774b..271d78118 100644 --- a/Tests/DependencyInjection/Fixtures/yml/translator_fallbacks.yml +++ b/Tests/DependencyInjection/Fixtures/yml/translator_fallbacks.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true translator: fallbacks: [en, fr] diff --git a/Tests/DependencyInjection/Fixtures/yml/translator_globals.yml b/Tests/DependencyInjection/Fixtures/yml/translator_globals.yml index ed42b676c..fba56beb9 100644 --- a/Tests/DependencyInjection/Fixtures/yml/translator_globals.yml +++ b/Tests/DependencyInjection/Fixtures/yml/translator_globals.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true translator: globals: '%%app_name%%': 'My application' diff --git a/Tests/DependencyInjection/Fixtures/yml/translator_without_globals.yml b/Tests/DependencyInjection/Fixtures/yml/translator_without_globals.yml index dc7323868..ad6c13178 100644 --- a/Tests/DependencyInjection/Fixtures/yml/translator_without_globals.yml +++ b/Tests/DependencyInjection/Fixtures/yml/translator_without_globals.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true translator: globals: [] diff --git a/Tests/DependencyInjection/Fixtures/yml/type_info.yml b/Tests/DependencyInjection/Fixtures/yml/type_info.yml index 4d6b405b2..383471714 100644 --- a/Tests/DependencyInjection/Fixtures/yml/type_info.yml +++ b/Tests/DependencyInjection/Fixtures/yml/type_info.yml @@ -1,8 +1,5 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true type_info: enabled: true + aliases: + CustomAlias: int diff --git a/Tests/DependencyInjection/Fixtures/yml/validation_attributes.yml b/Tests/DependencyInjection/Fixtures/yml/validation_attributes.yml index 2b62f8a3e..16ae007fc 100644 --- a/Tests/DependencyInjection/Fixtures/yml/validation_attributes.yml +++ b/Tests/DependencyInjection/Fixtures/yml/validation_attributes.yml @@ -1,14 +1,8 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true secret: s3cr3t validation: enabled: true enable_attributes: true - email_validation_mode: html5 services: validator.alias: diff --git a/Tests/DependencyInjection/Fixtures/yml/validation_auto_mapping.yml b/Tests/DependencyInjection/Fixtures/yml/validation_auto_mapping.yml index e81203e24..7686c0a49 100644 --- a/Tests/DependencyInjection/Fixtures/yml/validation_auto_mapping.yml +++ b/Tests/DependencyInjection/Fixtures/yml/validation_auto_mapping.yml @@ -1,15 +1,7 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true - property_info: - enabled: true - with_constructor_extractor: true - validation: - email_validation_mode: html5 - auto_mapping: - 'App\': ['foo', 'bar'] - 'Symfony\': ['a', 'b'] - 'Foo\': [] + property_info: { enabled: true } + validation: + auto_mapping: + 'App\': ['foo', 'bar'] + 'Symfony\': ['a', 'b'] + 'Foo\': [] diff --git a/Tests/DependencyInjection/Fixtures/yml/validation_email_validation_mode.yml b/Tests/DependencyInjection/Fixtures/yml/validation_email_validation_mode.yml index f84d52237..22f1d2d41 100644 --- a/Tests/DependencyInjection/Fixtures/yml/validation_email_validation_mode.yml +++ b/Tests/DependencyInjection/Fixtures/yml/validation_email_validation_mode.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true validation: - email_validation_mode: html5 + email_validation_mode: html5-allow-no-tld diff --git a/Tests/DependencyInjection/Fixtures/yml/validation_mapping.yml b/Tests/DependencyInjection/Fixtures/yml/validation_mapping.yml index 4c15245da..02d198f88 100644 --- a/Tests/DependencyInjection/Fixtures/yml/validation_mapping.yml +++ b/Tests/DependencyInjection/Fixtures/yml/validation_mapping.yml @@ -1,13 +1,7 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true - validation: - email_validation_mode: html5 - mapping: - paths: - - "%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/files" - - "%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/validation.yml" - - "%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/validation.yaml" + validation: + mapping: + paths: + - "%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/files" + - "%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/validation.yml" + - "%kernel.project_dir%/Fixtures/TestBundle/Resources/config/validation_mapping/validation.yaml" diff --git a/Tests/DependencyInjection/Fixtures/yml/validation_multiple_static_methods.yml b/Tests/DependencyInjection/Fixtures/yml/validation_multiple_static_methods.yml index e6cbbf5ac..4ff60d88b 100644 --- a/Tests/DependencyInjection/Fixtures/yml/validation_multiple_static_methods.yml +++ b/Tests/DependencyInjection/Fixtures/yml/validation_multiple_static_methods.yml @@ -1,11 +1,5 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true secret: s3cr3t validation: - enabled: true - email_validation_mode: html5 + enabled: true static_method: [loadFoo, loadBar] diff --git a/Tests/DependencyInjection/Fixtures/yml/validation_no_static_method.yml b/Tests/DependencyInjection/Fixtures/yml/validation_no_static_method.yml index 96035d358..ca5214964 100644 --- a/Tests/DependencyInjection/Fixtures/yml/validation_no_static_method.yml +++ b/Tests/DependencyInjection/Fixtures/yml/validation_no_static_method.yml @@ -1,11 +1,5 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true secret: s3cr3t validation: enabled: true - email_validation_mode: html5 static_method: false diff --git a/Tests/DependencyInjection/Fixtures/yml/validation_translation_domain.yml b/Tests/DependencyInjection/Fixtures/yml/validation_translation_domain.yml index 79c48c231..167b5fcce 100644 --- a/Tests/DependencyInjection/Fixtures/yml/validation_translation_domain.yml +++ b/Tests/DependencyInjection/Fixtures/yml/validation_translation_domain.yml @@ -1,9 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true validation: - email_validation_mode: html5 translation_domain: messages diff --git a/Tests/DependencyInjection/Fixtures/yml/web_link.yml b/Tests/DependencyInjection/Fixtures/yml/web_link.yml index c6786a344..4276aacbe 100644 --- a/Tests/DependencyInjection/Fixtures/yml/web_link.yml +++ b/Tests/DependencyInjection/Fixtures/yml/web_link.yml @@ -1,8 +1,3 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true web_link: enabled: true diff --git a/Tests/DependencyInjection/Fixtures/yml/webhook.yml b/Tests/DependencyInjection/Fixtures/yml/webhook.yml index 171f7919f..a91ba7fee 100644 --- a/Tests/DependencyInjection/Fixtures/yml/webhook.yml +++ b/Tests/DependencyInjection/Fixtures/yml/webhook.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true webhook: enabled: true http_client: diff --git a/Tests/DependencyInjection/Fixtures/yml/webhook_without_serializer.yml b/Tests/DependencyInjection/Fixtures/yml/webhook_without_serializer.yml index 63370200d..962548ffc 100644 --- a/Tests/DependencyInjection/Fixtures/yml/webhook_without_serializer.yml +++ b/Tests/DependencyInjection/Fixtures/yml/webhook_without_serializer.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true webhook: enabled: true http_client: diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_enum_places.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_enum_places.yml new file mode 100644 index 000000000..d72eab0e3 --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_enum_places.yml @@ -0,0 +1,13 @@ +framework: + workflows: + enum: + supports: + - Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase + places: !php/enum Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Places + transitions: + one: + from: !php/enum Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Places::A + to: !php/enum Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Places::B + two: + from: !php/enum Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Places::B + to: !php/enum Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Places::C diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_glob_places.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_glob_places.yml new file mode 100644 index 000000000..b0591682f --- /dev/null +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_glob_places.yml @@ -0,0 +1,13 @@ +framework: + workflows: + enum: + supports: + - Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\FrameworkExtensionTestCase + places: 'Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Places::*' + transitions: + one: + from: !php/enum Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Places::A + to: !php/enum Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Places::B + two: + from: !php/enum Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Places::B + to: !php/enum Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Places::C diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_not_valid.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_not_valid.yml index 08e1de448..2228751bf 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_not_valid.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_not_valid.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: my_workflow: type: state_machine diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_with_complex_place_follow_by_simplistic_place_config.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_with_complex_place_follow_by_simplistic_place_config.yml index b5e184db5..829201b3e 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_with_complex_place_follow_by_simplistic_place_config.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_with_complex_place_follow_by_simplistic_place_config.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: article: type: workflow diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_with_complex_place_follow_by_simplistic_place_config_with_alternative_syntax.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_with_complex_place_follow_by_simplistic_place_config_with_alternative_syntax.yml index 1f3131b9e..572c73425 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_with_complex_place_follow_by_simplistic_place_config_with_alternative_syntax.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_with_complex_place_follow_by_simplistic_place_config_with_alternative_syntax.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: article: type: workflow diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_with_guard_expression.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_with_guard_expression.yml index 2475cf41f..d3012f77a 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_with_guard_expression.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_with_guard_expression.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: article: type: workflow diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_with_multiple_transitions_with_same_name.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_with_multiple_transitions_with_same_name.yml index 67eccb425..d5e3f7fec 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_with_multiple_transitions_with_same_name.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_with_multiple_transitions_with_same_name.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: article: type: workflow diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_with_no_events_to_dispatch.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_with_no_events_to_dispatch.yml index 7cac249d8..dadc41899 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_with_no_events_to_dispatch.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_with_no_events_to_dispatch.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: my_workflow: type: state_machine diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_with_simplistic_place_follow_by_complex_place_config.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_with_simplistic_place_follow_by_complex_place_config.yml index bdd98fd71..7c16f112b 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_with_simplistic_place_follow_by_complex_place_config.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_with_simplistic_place_follow_by_complex_place_config.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: article: type: workflow diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_with_simplistic_place_follow_by_complex_place_config_with_alternative_syntax.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_with_simplistic_place_follow_by_complex_place_config_with_alternative_syntax.yml index ca033acb6..3a0ea9c4d 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_with_simplistic_place_follow_by_complex_place_config_with_alternative_syntax.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_with_simplistic_place_follow_by_complex_place_config_with_alternative_syntax.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: article: type: workflow diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_with_specified_events_to_dispatch.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_with_specified_events_to_dispatch.yml index 850b91011..1ffd21e1b 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_with_specified_events_to_dispatch.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_with_specified_events_to_dispatch.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: my_workflow: type: state_machine diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_with_support_and_support_strategy.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_with_support_and_support_strategy.yml index 781feb392..1b043700b 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_with_support_and_support_strategy.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_with_support_and_support_strategy.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: my_workflow: type: workflow diff --git a/Tests/DependencyInjection/Fixtures/yml/workflow_without_support_and_support_strategy.yml b/Tests/DependencyInjection/Fixtures/yml/workflow_without_support_and_support_strategy.yml index a91cdf62d..de74adbe5 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflow_without_support_and_support_strategy.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflow_without_support_and_support_strategy.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: my_workflow: type: workflow diff --git a/Tests/DependencyInjection/Fixtures/yml/workflows.yml b/Tests/DependencyInjection/Fixtures/yml/workflows.yml index cac5f6f23..285bee872 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflows.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflows.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: article: type: workflow diff --git a/Tests/DependencyInjection/Fixtures/yml/workflows_enabled.yml b/Tests/DependencyInjection/Fixtures/yml/workflows_enabled.yml index 7c3fbc758..2a716ff0a 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflows_enabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflows_enabled.yml @@ -1,7 +1,2 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: ~ diff --git a/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled.yml b/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled.yml index a24609130..685ea9733 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: enabled: true workflows: diff --git a/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled_named_workflows.yml b/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled_named_workflows.yml index 6e22964cb..d97e72bb3 100644 --- a/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled_named_workflows.yml +++ b/Tests/DependencyInjection/Fixtures/yml/workflows_explicitly_enabled_named_workflows.yml @@ -1,9 +1,4 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true - php_errors: - log: true workflows: enabled: true workflows: diff --git a/Tests/DependencyInjection/FrameworkExtensionTestCase.php b/Tests/DependencyInjection/FrameworkExtensionTestCase.php index 1a0251d56..b2ddd74a7 100644 --- a/Tests/DependencyInjection/FrameworkExtensionTestCase.php +++ b/Tests/DependencyInjection/FrameworkExtensionTestCase.php @@ -11,8 +11,10 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection; +use PHPUnit\Framework\Attributes\DataProvider; use Psr\Cache\CacheItemPoolInterface; use Psr\Log\LoggerAwareInterface; +use Psr\Log\LogLevel; use Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Fixtures\Workflow\Validator\DefinitionValidator; @@ -58,6 +60,10 @@ use Symfony\Component\HttpClient\ThrottlingHttpClient; use Symfony\Component\HttpFoundation\IpUtils; use Symfony\Component\HttpKernel\DependencyInjection\LoggerPass; +use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; +use Symfony\Component\HttpKernel\Exception\ConflictHttpException; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; use Symfony\Component\HttpKernel\Fragment\FragmentUriGeneratorInterface; use Symfony\Component\Lock\Store\SemaphoreStore; use Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\AmazonSqsTransportFactory; @@ -71,7 +77,6 @@ use Symfony\Component\PropertyAccess\PropertyAccessor; use Symfony\Component\Security\Core\AuthenticationEvents; use Symfony\Component\Serializer\DependencyInjection\SerializerPass; -use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader; use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader; use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader; use Symfony\Component\Serializer\Normalizer\BackedEnumNormalizer; @@ -87,6 +92,7 @@ use Symfony\Component\Translation\DependencyInjection\TranslatorPass; use Symfony\Component\Translation\LocaleSwitcher; use Symfony\Component\Translation\TranslatableMessage; +use Symfony\Component\Validator\Constraints\Traverse; use Symfony\Component\Validator\DependencyInjection\AddConstraintValidatorsPass; use Symfony\Component\Validator\Validation; use Symfony\Component\Validator\Validator\ValidatorInterface; @@ -146,12 +152,6 @@ public function testPropertyAccessCache() { $container = $this->createContainerFromFile('property_accessor'); - if (!method_exists(PropertyAccessor::class, 'createCache')) { - $this->assertFalse($container->hasDefinition('cache.property_access')); - - return; - } - $cache = $container->getDefinition('cache.property_access'); $this->assertSame([PropertyAccessor::class, 'createCache'], $cache->getFactory(), 'PropertyAccessor::createCache() should be used in non-debug mode'); $this->assertSame(AdapterInterface::class, $cache->getClass()); @@ -161,12 +161,6 @@ public function testPropertyAccessCacheWithDebug() { $container = $this->createContainerFromFile('property_accessor', ['kernel.debug' => true]); - if (!method_exists(PropertyAccessor::class, 'createCache')) { - $this->assertFalse($container->hasDefinition('cache.property_access')); - - return; - } - $cache = $container->getDefinition('cache.property_access'); $this->assertNull($cache->getFactory()); $this->assertSame(ArrayAdapter::class, $cache->getClass(), 'ArrayAdapter should be used in debug mode'); @@ -513,6 +507,26 @@ public function testWorkflowMultipleTransitionsWithSameName() ], $container->getDefinition($transitions[4])->getArguments()); } + public function testWorkflowEnumPlaces() + { + $container = $this->createContainerFromFile('workflow_enum_places'); + + $workflowDefinition = $container->getDefinition('state_machine.enum.definition'); + $this->assertSame(['a', 'b', 'c'], $workflowDefinition->getArgument(0)); + $transitionOne = $container->getDefinition('.state_machine.enum.transition.0'); + $this->assertSame(['one', 'a', 'b'], $transitionOne->getArguments()); + $transitionTwo = $container->getDefinition('.state_machine.enum.transition.1'); + $this->assertSame(['two', 'b', 'c'], $transitionTwo->getArguments()); + } + + public function testWorkflowGlobPlaces() + { + $container = $this->createContainerFromFile('workflow_glob_places'); + + $workflowDefinition = $container->getDefinition('state_machine.enum.definition'); + $this->assertSame(['a', 'b', 'c'], $workflowDefinition->getArgument(0)); + } + public function testWorkflowGuardExpressions() { $container = $this->createContainerFromFile('workflow_with_guard_expression'); @@ -633,8 +647,8 @@ public function testPhpErrorsWithLogLevels() $definition = $container->getDefinition('debug.error_handler_configurator'); $this->assertEquals(new Reference('logger', ContainerInterface::NULL_ON_INVALID_REFERENCE), $definition->getArgument(0)); $this->assertSame([ - \E_NOTICE => \Psr\Log\LogLevel::ERROR, - \E_WARNING => \Psr\Log\LogLevel::ERROR, + \E_NOTICE => LogLevel::ERROR, + \E_WARNING => LogLevel::ERROR, ], $definition->getArgument(1)); } @@ -645,35 +659,35 @@ public function testExceptionsConfig() $configuration = $container->getDefinition('exception_listener')->getArgument(3); $this->assertSame([ - \Symfony\Component\HttpKernel\Exception\BadRequestHttpException::class, - \Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class, - \Symfony\Component\HttpKernel\Exception\ConflictHttpException::class, - \Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException::class, + BadRequestHttpException::class, + NotFoundHttpException::class, + ConflictHttpException::class, + ServiceUnavailableHttpException::class, ], array_keys($configuration)); $this->assertEqualsCanonicalizing([ 'log_channel' => null, 'log_level' => 'info', 'status_code' => 422, - ], $configuration[\Symfony\Component\HttpKernel\Exception\BadRequestHttpException::class]); + ], $configuration[BadRequestHttpException::class]); $this->assertEqualsCanonicalizing([ 'log_channel' => null, 'log_level' => 'info', 'status_code' => null, - ], $configuration[\Symfony\Component\HttpKernel\Exception\NotFoundHttpException::class]); + ], $configuration[NotFoundHttpException::class]); $this->assertEqualsCanonicalizing([ 'log_channel' => null, 'log_level' => 'info', 'status_code' => null, - ], $configuration[\Symfony\Component\HttpKernel\Exception\ConflictHttpException::class]); + ], $configuration[ConflictHttpException::class]); $this->assertEqualsCanonicalizing([ 'log_channel' => null, 'log_level' => null, 'status_code' => 500, - ], $configuration[\Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException::class]); + ], $configuration[ServiceUnavailableHttpException::class]); } public function testRouter() @@ -696,7 +710,7 @@ public function testRouterRequiresResourceOption() $this->expectException(InvalidConfigurationException::class); - $loader->load([['http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' => ['log' => true], 'router' => true]], $container); + $loader->load([['router' => true]], $container); } public function testSession() @@ -1105,6 +1119,7 @@ public function testMessengerWithMultipleBusesWithoutDeduplicateMiddleware() $this->assertTrue($container->has('messenger.bus.commands')); $this->assertSame([], $container->getDefinition('messenger.bus.commands')->getArgument(0)); $this->assertEquals([ + ['id' => 'add_default_stamps_middleware'], ['id' => 'add_bus_name_stamp_middleware', 'arguments' => ['messenger.bus.commands']], ['id' => 'reject_redelivered_message_middleware'], ['id' => 'dispatch_after_current_bus'], @@ -1115,6 +1130,7 @@ public function testMessengerWithMultipleBusesWithoutDeduplicateMiddleware() $this->assertTrue($container->has('messenger.bus.events')); $this->assertSame([], $container->getDefinition('messenger.bus.events')->getArgument(0)); $this->assertEquals([ + ['id' => 'add_default_stamps_middleware'], ['id' => 'add_bus_name_stamp_middleware', 'arguments' => ['messenger.bus.events']], ['id' => 'reject_redelivered_message_middleware'], ['id' => 'dispatch_after_current_bus'], @@ -1147,6 +1163,7 @@ public function testMessengerWithAddBusNameStampMiddleware() $this->assertTrue($container->has('messenger.bus.events')); $this->assertSame([], $container->getDefinition('messenger.bus.events')->getArgument(0)); $this->assertEquals([ + ['id' => 'add_default_stamps_middleware'], ['id' => 'add_bus_name_stamp_middleware', 'arguments' => ['messenger.bus.events']], ['id' => 'reject_redelivered_message_middleware'], ['id' => 'dispatch_after_current_bus'], @@ -1167,6 +1184,7 @@ public function testMessengerWithMultipleBusesWithDeduplicateMiddleware() $this->assertTrue($container->has('messenger.bus.commands')); $this->assertSame([], $container->getDefinition('messenger.bus.commands')->getArgument(0)); $this->assertEquals([ + ['id' => 'add_default_stamps_middleware'], ['id' => 'add_bus_name_stamp_middleware', 'arguments' => ['messenger.bus.commands']], ['id' => 'reject_redelivered_message_middleware'], ['id' => 'dispatch_after_current_bus'], @@ -1178,6 +1196,7 @@ public function testMessengerWithMultipleBusesWithDeduplicateMiddleware() $this->assertTrue($container->has('messenger.bus.events')); $this->assertSame([], $container->getDefinition('messenger.bus.events')->getArgument(0)); $this->assertEquals([ + ['id' => 'add_default_stamps_middleware'], ['id' => 'add_bus_name_stamp_middleware', 'arguments' => ['messenger.bus.events']], ['id' => 'reject_redelivered_message_middleware'], ['id' => 'dispatch_after_current_bus'], @@ -1341,16 +1360,17 @@ public function testValidation() $projectDir = $container->getParameter('kernel.project_dir'); $ref = new \ReflectionClass(Form::class); - $xmlMappings = [ - \dirname($ref->getFileName()).'/Resources/config/validation.xml', - strtr($projectDir.'/config/validator/foo.xml', '/', \DIRECTORY_SEPARATOR), - ]; + $xmlMappings = []; + if (!$ref->getAttributes(Traverse::class)) { + $xmlMappings[] = \dirname($ref->getFileName()).'/Resources/config/validation.xml'; + } + $xmlMappings[] = strtr($projectDir.'/config/validator/foo.xml', '/', \DIRECTORY_SEPARATOR); $calls = $container->getDefinition('validator.builder')->getMethodCalls(); - $annotations = !class_exists(FullStack::class); + $attributes = !class_exists(FullStack::class); - $this->assertCount($annotations ? 8 : 7, $calls); + $this->assertCount($attributes ? 8 : 7, $calls); $this->assertSame('setConstraintValidatorFactory', $calls[0][0]); $this->assertEquals([new Reference('validator.validator_factory')], $calls[0][1]); $this->assertSame('setGroupProviderLocator', $calls[1][0]); @@ -1362,7 +1382,7 @@ public function testValidation() $this->assertSame('addXmlMappings', $calls[4][0]); $this->assertSame([$xmlMappings], $calls[4][1]); $i = 4; - if ($annotations) { + if ($attributes) { $this->assertSame('enableAttributeMapping', $calls[++$i][0]); } $this->assertSame('addMethodMapping', $calls[++$i][0]); @@ -1378,18 +1398,6 @@ public function testValidationService() $this->assertInstanceOf(ValidatorInterface::class, $container->get('validator.alias')); } - public function testAnnotations() - { - $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('Invalid configuration for path "framework.annotations": Enabling the doctrine/annotations integration is not supported anymore.'); - - $this->createContainerFromClosure(function (ContainerBuilder $container) { - $container->loadFromExtension('framework', [ - 'annotations' => true, - ]); - }); - } - public function testFileLinkFormat() { if (\ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) { @@ -1437,15 +1445,19 @@ public function testValidationPaths() $this->assertEquals([new Reference('validator.mapping.cache.adapter')], $calls[8][1]); $xmlMappings = $calls[4][1][0]; - $this->assertCount(3, $xmlMappings); - try { - // Testing symfony/symfony - $this->assertStringEndsWith('Component'.\DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]); - } catch (\Exception $e) { - // Testing symfony/framework-bundle with deps=high - $this->assertStringEndsWith('symfony'.\DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]); + + if (!(new \ReflectionClass(Form::class))->getAttributes(Traverse::class)) { + try { + // Testing symfony/symfony + $this->assertStringEndsWith('Component'.\DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]); + } catch (\Exception $e) { + // Testing symfony/framework-bundle with deps=high + $this->assertStringEndsWith('symfony'.\DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]); + } + array_shift($xmlMappings); } - $this->assertStringEndsWith('TestBundle/Resources/config/validation.xml', $xmlMappings[1]); + $this->assertCount(2, $xmlMappings); + $this->assertStringEndsWith('TestBundle/Resources/config/validation.xml', $xmlMappings[0]); $yamlMappings = $calls[5][1][0]; $this->assertCount(1, $yamlMappings); @@ -1463,16 +1475,19 @@ public function testValidationPathsUsingCustomBundlePath() $calls = $container->getDefinition('validator.builder')->getMethodCalls(); $xmlMappings = $calls[4][1][0]; - $this->assertCount(3, $xmlMappings); - - try { - // Testing symfony/symfony - $this->assertStringEndsWith('Component'.\DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]); - } catch (\Exception $e) { - // Testing symfony/framework-bundle with deps=high - $this->assertStringEndsWith('symfony'.\DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]); + + if (!(new \ReflectionClass(Form::class))->getAttributes(Traverse::class)) { + try { + // Testing symfony/symfony + $this->assertStringEndsWith('Component'.\DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]); + } catch (\Exception $e) { + // Testing symfony/framework-bundle with deps=high + $this->assertStringEndsWith('symfony'.\DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]); + } + array_shift($xmlMappings); } - $this->assertStringEndsWith('CustomPathBundle/Resources/config/validation.xml', $xmlMappings[1]); + $this->assertCount(2, $xmlMappings); + $this->assertStringEndsWith('CustomPathBundle/Resources/config/validation.xml', $xmlMappings[0]); $yamlMappings = $calls[5][1][0]; $this->assertCount(1, $yamlMappings); @@ -1485,24 +1500,24 @@ public function testValidationNoStaticMethod() $calls = $container->getDefinition('validator.builder')->getMethodCalls(); - $annotations = !class_exists(FullStack::class); + $attributes = !class_exists(FullStack::class); - $this->assertCount($annotations ? 7 : 6, $calls); + $this->assertCount($attributes ? 7 : 6, $calls); $this->assertSame('addXmlMappings', $calls[4][0]); $i = 4; - if ($annotations) { + if ($attributes) { $this->assertSame('enableAttributeMapping', $calls[++$i][0]); } $this->assertSame('setMappingCache', $calls[++$i][0]); $this->assertEquals([new Reference('validator.mapping.cache.adapter')], $calls[$i][1]); - // no cache, no annotations, no static methods + // no cache, no attributes, no static methods } public function testEmailValidationModeIsPassedToEmailValidator() { $container = $this->createContainerFromFile('validation_email_validation_mode'); - $this->assertSame('html5', $container->getDefinition('validator.email')->getArgument(0)); + $this->assertSame('html5-allow-no-tld', $container->getDefinition('validator.email')->getArgument(0)); } public function testValidationTranslationDomain() @@ -1519,7 +1534,6 @@ public function testValidationMapping() $calls = $container->getDefinition('validator.builder')->getMethodCalls(); $this->assertSame('addXmlMappings', $calls[4][0]); - $this->assertCount(3, $calls[4][1][0]); $this->assertSame('addYamlMappings', $calls[5][0]); $this->assertCount(3, $calls[5][1][0]); @@ -1592,7 +1606,7 @@ public function testSerializerEnabled() $argument = $container->getDefinition('serializer.mapping.chain_loader')->getArgument(0); $this->assertCount(2, $argument); - $this->assertEquals(AttributeLoader::class, $argument[0]->getClass()); + $this->assertEquals(new Reference('serializer.mapping.attribute_loader'), $argument[0]); $this->assertEquals(new Reference('serializer.name_converter.camel_case_to_snake_case'), $container->getDefinition('serializer.name_converter.metadata_aware')->getArgument(1)); $this->assertEquals(new Reference('property_info', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE), $container->getDefinition('serializer.normalizer.object')->getArgument(3)); } @@ -1630,7 +1644,7 @@ public function testRegisterSerializerExtractor() $serializerExtractorDefinition = $container->getDefinition('property_info.serializer_extractor'); $this->assertEquals('serializer.mapping.class_metadata_factory', $serializerExtractorDefinition->getArgument(0)->__toString()); - $this->assertTrue(!$serializerExtractorDefinition->isPublic() || $serializerExtractorDefinition->isPrivate()); + $this->assertTrue($serializerExtractorDefinition->isPrivate()); $tag = $serializerExtractorDefinition->getTag('property_info.list_extractor'); $this->assertEquals(['priority' => -999], $tag[0]); } @@ -1758,19 +1772,19 @@ public function testSerializerCacheActivated() $this->assertEquals(new Reference('serializer.mapping.cache.symfony'), $cache); } - public function testSerializerCacheUsedWithoutAnnotationsAndMappingFiles() + public function testSerializerCacheUsedWithoutAttributesAndMappingFiles() { - $container = $this->createContainerFromFile('serializer_mapping_without_annotations', ['kernel.debug' => true, 'kernel.container_class' => __CLASS__]); + $container = $this->createContainerFromFile('serializer_mapping_without_attributes', ['kernel.debug' => true, 'kernel.container_class' => __CLASS__]); $this->assertFalse($container->hasDefinition('serializer.mapping.cache_class_metadata_factory')); } - public function testSerializerCacheUsedWithoutAnnotationsAndMappingFilesNoDebug() + public function testSerializerCacheUsedWithoutAttributesAndMappingFilesNoDebug() { - $container = $this->createContainerFromFile('serializer_mapping_without_annotations', ['kernel.debug' => false, 'kernel.container_class' => __CLASS__]); + $container = $this->createContainerFromFile('serializer_mapping_without_attributes', ['kernel.debug' => false, 'kernel.container_class' => __CLASS__]); $this->assertTrue($container->hasDefinition('serializer.mapping.cache_class_metadata_factory')); } - public function testSerializerCacheNotActivatedWithAnnotations() + public function testSerializerCacheNotActivatedWithAttributes() { $container = $this->createContainerFromFile('serializer_mapping', ['kernel.debug' => true, 'kernel.container_class' => __CLASS__]); $this->assertFalse($container->hasDefinition('serializer.mapping.cache_class_metadata_factory')); @@ -1778,10 +1792,11 @@ public function testSerializerCacheNotActivatedWithAnnotations() public function testSerializerMapping() { - $container = $this->createContainerFromFile('serializer_mapping_without_annotations', ['kernel.bundles_metadata' => ['TestBundle' => ['namespace' => 'Symfony\\Bundle\\FrameworkBundle\\Tests', 'path' => __DIR__.'/Fixtures/TestBundle']]]); + $container = $this->createContainerFromFile('serializer_mapping_without_attributes', ['kernel.bundles_metadata' => ['TestBundle' => ['namespace' => 'Symfony\\Bundle\\FrameworkBundle\\Tests', 'path' => __DIR__.'/Fixtures/TestBundle']]]); $projectDir = $container->getParameter('kernel.project_dir'); $configDir = __DIR__.'/Fixtures/TestBundle/Resources/config'; $expectedLoaders = [ + new Reference('serializer.mapping.attribute_loader'), new Definition(XmlFileLoader::class, [$configDir.'/serialization.xml']), new Definition(YamlFileLoader::class, [$configDir.'/serialization.yml']), new Definition(YamlFileLoader::class, [$projectDir.'/config/serializer/foo.yml']), @@ -1791,15 +1806,15 @@ public function testSerializerMapping() new Definition(YamlFileLoader::class, [$configDir.'/serializer_mapping/serialization.yaml']), ]; - foreach ($expectedLoaders as $definition) { - if (is_file($arg = $definition->getArgument(0))) { - $definition->replaceArgument(0, strtr($arg, '/', \DIRECTORY_SEPARATOR)); + foreach ($expectedLoaders as $loader) { + if ($loader instanceof Definition && is_file($arg = $loader->getArgument(0))) { + $loader->replaceArgument(0, strtr($arg, '/', \DIRECTORY_SEPARATOR)); } } $loaders = $container->getDefinition('serializer.mapping.chain_loader')->getArgument(0); foreach ($loaders as $loader) { - if (is_file($arg = $loader->getArgument(0))) { + if ($loader instanceof Definition && is_file($arg = $loader->getArgument(0))) { $loader->replaceArgument(0, strtr($arg, '/', \DIRECTORY_SEPARATOR)); } } @@ -1830,14 +1845,14 @@ public function testPropertyInfoEnabled() { $container = $this->createContainerFromFile('property_info'); $this->assertTrue($container->has('property_info')); - $this->assertFalse($container->has('property_info.constructor_extractor')); + $this->assertTrue($container->has('property_info.constructor_extractor')); } - public function testPropertyInfoWithConstructorExtractorEnabled() + public function testPropertyInfoWithConstructorExtractorDisabled() { - $container = $this->createContainerFromFile('property_info_with_constructor_extractor'); + $container = $this->createContainerFromFile('property_info_without_constructor_extractor'); $this->assertTrue($container->has('property_info')); - $this->assertTrue($container->has('property_info.constructor_extractor')); + $this->assertFalse($container->has('property_info.constructor_extractor')); } public function testPropertyInfoCacheActivated() @@ -1926,12 +1941,10 @@ public function testCachePoolServices() $this->assertSame(TagAwareAdapter::class, $tagAwareDefinition->getClass()); $this->assertCachePoolServiceDefinitionIsCreated($container, (string) $tagAwareDefinition->getArgument(0), 'cache.adapter.array', 410); - if (method_exists(TagAwareAdapter::class, 'setLogger')) { - $this->assertEquals([ - ['setLogger', [new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]], - ], $tagAwareDefinition->getMethodCalls()); - $this->assertSame([['channel' => 'cache']], $tagAwareDefinition->getTag('monolog.logger')); - } + $this->assertEquals([ + ['setLogger', [new Reference('logger', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]], + ], $tagAwareDefinition->getMethodCalls()); + $this->assertSame([['channel' => 'cache']], $tagAwareDefinition->getTag('monolog.logger')); } public function testRedisTagAwareAdapter() @@ -1969,9 +1982,7 @@ public function testRedisTagAwareAdapter() } } - /** - * @dataProvider appRedisTagAwareConfigProvider - */ + #[DataProvider('appRedisTagAwareConfigProvider')] public function testAppRedisTagAwareAdapter(string $configFile) { $container = $this->createContainerFromFile($configFile); @@ -2015,9 +2026,7 @@ public function testCacheTaggableTagAppliedToPools() } } - /** - * @dataProvider appRedisTagAwareConfigProvider - */ + #[DataProvider('appRedisTagAwareConfigProvider')] public function testCacheTaggableTagAppliedToRedisAwareAppPool(string $configFile) { $container = $this->createContainerFromFile($configFile); @@ -2047,11 +2056,11 @@ public function testCachePoolInvalidateTagsCommandRegistered() public function testRemovesResourceCheckerConfigCacheFactoryArgumentOnlyIfNoDebug() { $container = $this->createContainer(['kernel.debug' => true]); - (new FrameworkExtension())->load([['annotations' => false, 'http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' => ['log' => true]]], $container); + (new FrameworkExtension())->load([], $container); $this->assertCount(1, $container->getDefinition('config_cache_factory')->getArguments()); $container = $this->createContainer(['kernel.debug' => false]); - (new FrameworkExtension())->load([['annotations' => false, 'http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' => ['log' => true]]], $container); + (new FrameworkExtension())->load([], $container); $this->assertSame([], $container->getDefinition('config_cache_factory')->getArguments()); } @@ -2082,21 +2091,21 @@ public function testSessionCookieSecureAuto() public function testRobotsTagListenerIsRegisteredInDebugMode() { $container = $this->createContainer(['kernel.debug' => true]); - (new FrameworkExtension())->load([['annotations' => false, 'http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' => ['log' => true]]], $container); + (new FrameworkExtension())->load([], $container); $this->assertTrue($container->has('disallow_search_engine_index_response_listener'), 'DisallowRobotsIndexingListener should be registered'); $definition = $container->getDefinition('disallow_search_engine_index_response_listener'); $this->assertTrue($definition->hasTag('kernel.event_subscriber'), 'DisallowRobotsIndexingListener should have the correct tag'); $container = $this->createContainer(['kernel.debug' => true]); - (new FrameworkExtension())->load([['annotations' => false, 'http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' => ['log' => true], 'disallow_search_engine_index' => false]], $container); + (new FrameworkExtension())->load([['disallow_search_engine_index' => false]], $container); $this->assertFalse( $container->has('disallow_search_engine_index_response_listener'), 'DisallowRobotsIndexingListener should not be registered when explicitly disabled' ); $container = $this->createContainer(['kernel.debug' => false]); - (new FrameworkExtension())->load([['annotations' => false, 'http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' => ['log' => true]]], $container); + (new FrameworkExtension())->load([], $container); $this->assertFalse($container->has('disallow_search_engine_index_response_listener'), 'DisallowRobotsIndexingListener should NOT be registered'); } @@ -2257,9 +2266,7 @@ public static function provideMailer(): iterable ]; } - /** - * @dataProvider provideMailer - */ + #[DataProvider('provideMailer')] public function testMailer(string $configFile, array $expectedTransports, array $expectedRecipients, array $expectedAllowedRecipients) { $container = $this->createContainerFromFile($configFile); diff --git a/Tests/DependencyInjection/PhpFrameworkExtensionTest.php b/Tests/DependencyInjection/PhpFrameworkExtensionTest.php index c4f67c2f1..eff5faa87 100644 --- a/Tests/DependencyInjection/PhpFrameworkExtensionTest.php +++ b/Tests/DependencyInjection/PhpFrameworkExtensionTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -38,10 +39,6 @@ public function testAssetsCannotHavePathAndUrl() $this->expectException(\LogicException::class); $this->createContainerFromClosure(function ($container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'assets' => [ 'base_urls' => 'http://cdn.example.com', 'base_path' => '/foo', @@ -55,10 +52,6 @@ public function testAssetPackageCannotHavePathAndUrl() $this->expectException(\LogicException::class); $this->createContainerFromClosure(function ($container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'assets' => [ 'packages' => [ 'impossible' => [ @@ -74,7 +67,7 @@ public function testAssetPackageCannotHavePathAndUrl() public function testWorkflowValidationPlacesIsArray() { $this->expectException(InvalidConfigurationException::class); - $this->expectExceptionMessage('The "places" option must be an array in workflow configuration.'); + $this->expectExceptionMessage('The "places" option must be an array or a "FQCN::glob" pattern in workflow configuration.'); $this->createContainerFromClosure(function ($container) { $container->loadFromExtension('framework', [ 'workflows' => [ @@ -107,10 +100,6 @@ public function testWorkflowValidationStateMachine() $this->expectExceptionMessage('A transition from a place/state must have an unique name. Multiple transitions named "a_to_b" from place/state "a" were found on StateMachine "article".'); $this->createContainerFromClosure(function (ContainerBuilder $container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'article' => [ 'type' => 'state_machine', @@ -135,19 +124,13 @@ public function testWorkflowValidationStateMachine() }); } - /** - * @dataProvider provideWorkflowValidationCustomTests - */ + #[DataProvider('provideWorkflowValidationCustomTests')] public function testWorkflowValidationCustomBroken(string $class, string $message) { $this->expectException(InvalidConfigurationException::class); $this->expectExceptionMessage($message); $this->createContainerFromClosure(function ($container) use ($class) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'article' => [ 'type' => 'state_machine', @@ -186,10 +169,6 @@ public function testWorkflowDefaultMarkingStoreDefinition() { $container = $this->createContainerFromClosure(function ($container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'workflows' => [ 'workflow_a' => [ 'type' => 'state_machine', @@ -247,10 +226,6 @@ public function testRateLimiterLockFactoryWithLockDisabled() try { $this->createContainerFromClosure(function (ContainerBuilder $container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'lock' => false, 'rate_limiter' => [ 'with_lock' => ['policy' => 'fixed_window', 'limit' => 10, 'interval' => '1 hour', 'lock_factory' => 'lock.factory'], @@ -268,10 +243,6 @@ public function testRateLimiterAutoLockFactoryWithLockEnabled() { $container = $this->createContainerFromClosure(function (ContainerBuilder $container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'lock' => true, 'rate_limiter' => [ 'with_lock' => ['policy' => 'fixed_window', 'limit' => 10, 'interval' => '1 hour'], @@ -287,11 +258,7 @@ public function testRateLimiterAutoLockFactoryWithLockDisabled() { $container = $this->createContainerFromClosure(function (ContainerBuilder $container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, 'lock' => false, - 'php_errors' => ['log' => true], 'rate_limiter' => [ 'without_lock' => ['policy' => 'fixed_window', 'limit' => 10, 'interval' => '1 hour'], ], @@ -308,11 +275,7 @@ public function testRateLimiterDisableLockFactory() { $container = $this->createContainerFromClosure(function (ContainerBuilder $container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, 'lock' => true, - 'php_errors' => ['log' => true], 'rate_limiter' => [ 'without_lock' => ['policy' => 'fixed_window', 'limit' => 10, 'interval' => '1 hour', 'lock_factory' => null], ], @@ -329,10 +292,6 @@ public function testRateLimiterIsTagged() { $container = $this->createContainerFromClosure(function (ContainerBuilder $container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'lock' => true, 'rate_limiter' => [ 'first' => ['policy' => 'fixed_window', 'limit' => 10, 'interval' => '1 hour'], @@ -353,10 +312,6 @@ public function testRateLimiterCompoundPolicy() $container = $this->createContainerFromClosure(function (ContainerBuilder $container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'lock' => true, 'rate_limiter' => [ 'first' => ['policy' => 'fixed_window', 'limit' => 10, 'interval' => '1 hour'], @@ -400,10 +355,6 @@ public function testRateLimiterCompoundPolicyNoLimiters() $this->expectException(\LogicException::class); $this->createContainerFromClosure(function ($container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'rate_limiter' => [ 'compound' => ['policy' => 'compound'], ], @@ -420,10 +371,6 @@ public function testRateLimiterCompoundPolicyInvalidLimiters() $this->expectException(\LogicException::class); $this->createContainerFromClosure(function ($container) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'rate_limiter' => [ 'compound' => ['policy' => 'compound', 'limiters' => ['invalid1', 'invalid2']], ], @@ -431,19 +378,13 @@ public function testRateLimiterCompoundPolicyInvalidLimiters() }); } - /** - * @dataProvider emailValidationModeProvider - */ + #[DataProvider('emailValidationModeProvider')] public function testValidatorEmailValidationMode(string $mode) { $this->expectNotToPerformAssertions(); $this->createContainerFromClosure(function (ContainerBuilder $container) use ($mode) { $container->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'validation' => [ 'email_validation_mode' => $mode, ], @@ -456,7 +397,6 @@ public static function emailValidationModeProvider() foreach (Email::VALIDATION_MODES as $mode) { yield [$mode]; } - yield ['loose']; } } diff --git a/Tests/DependencyInjection/XmlFrameworkExtensionTest.php b/Tests/DependencyInjection/XmlFrameworkExtensionTest.php index 1b2eb668a..ff900d617 100644 --- a/Tests/DependencyInjection/XmlFrameworkExtensionTest.php +++ b/Tests/DependencyInjection/XmlFrameworkExtensionTest.php @@ -59,4 +59,9 @@ public function testAssetMapper() $definition = $container->getDefinition('asset_mapper.compiler.css_asset_url_compiler'); $this->assertSame('strict', $definition->getArgument(0)); } + + public function testWorkflowEnumPlaces() + { + $this->markTestSkipped('XML configuration does not allow to reference enums.'); + } } diff --git a/Tests/Fixtures/Descriptor/empty_route_collection.json b/Tests/Fixtures/Descriptor/empty_route_collection.json new file mode 100644 index 000000000..7dd438752 --- /dev/null +++ b/Tests/Fixtures/Descriptor/empty_route_collection.json @@ -0,0 +1,2 @@ +[] + diff --git a/Tests/Fixtures/Descriptor/empty_route_collection.md b/Tests/Fixtures/Descriptor/empty_route_collection.md new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/Fixtures/Descriptor/empty_route_collection.txt b/Tests/Fixtures/Descriptor/empty_route_collection.txt new file mode 100644 index 000000000..de24cefb8 --- /dev/null +++ b/Tests/Fixtures/Descriptor/empty_route_collection.txt @@ -0,0 +1,4 @@ + ------ -------- ------ +  Name   Method   Path  + ------ -------- ------ + diff --git a/Tests/Fixtures/Descriptor/empty_route_collection.xml b/Tests/Fixtures/Descriptor/empty_route_collection.xml new file mode 100644 index 000000000..ea7517e16 --- /dev/null +++ b/Tests/Fixtures/Descriptor/empty_route_collection.xml @@ -0,0 +1,3 @@ + + + diff --git a/Tests/Fixtures/Descriptor/route_1.txt b/Tests/Fixtures/Descriptor/route_1.txt index 9814273b7..bb70cea61 100644 --- a/Tests/Fixtures/Descriptor/route_1.txt +++ b/Tests/Fixtures/Descriptor/route_1.txt @@ -7,7 +7,7 @@ | Host | localhost | | Host Regex | #HOST_REGEX# | | Scheme | http|https | -| Method | GET|HEAD | +| Method | GET|HEAD | | Requirements | name: [a-z]+ | | Class | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub | | Defaults | name: Joseph | diff --git a/Tests/Fixtures/Descriptor/route_1_link.txt b/Tests/Fixtures/Descriptor/route_1_link.txt index ad7a4c8c8..827873de5 100644 --- a/Tests/Fixtures/Descriptor/route_1_link.txt +++ b/Tests/Fixtures/Descriptor/route_1_link.txt @@ -7,10 +7,10 @@ | Host | localhost | | Host Regex | #HOST_REGEX# | | Scheme | http|https | -| Method | GET|HEAD | +| Method | GET|HEAD | | Requirements | name: [a-z]+ | | Class | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub | -| Defaults | _controller: ]8;;myeditor://open?file=[:file:]&line=58\Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\MyController::__invoke()]8;;\ | +| Defaults | _controller: ]8;;myeditor://open?file=[:file:]&line=59\Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\MyController::__invoke()]8;;\ | | | name: Joseph | | Options | compiler_class: Symfony\Component\Routing\RouteCompiler | | | opt1: val1 | diff --git a/Tests/Fixtures/Descriptor/route_2.txt b/Tests/Fixtures/Descriptor/route_2.txt index 533409d40..7bdbb83a0 100644 --- a/Tests/Fixtures/Descriptor/route_2.txt +++ b/Tests/Fixtures/Descriptor/route_2.txt @@ -7,7 +7,7 @@ | Host | localhost | | Host Regex | #HOST_REGEX# | | Scheme | http|https | -| Method | PUT|POST | +| Method | PUT|POST | | Requirements | NO CUSTOM | | Class | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub | | Defaults | NONE | diff --git a/Tests/Fixtures/Descriptor/route_2_link.txt b/Tests/Fixtures/Descriptor/route_2_link.txt index 8e3fe4ca7..25941f651 100644 --- a/Tests/Fixtures/Descriptor/route_2_link.txt +++ b/Tests/Fixtures/Descriptor/route_2_link.txt @@ -7,10 +7,10 @@ | Host | localhost | | Host Regex | #HOST_REGEX# | | Scheme | http|https | -| Method | PUT|POST | +| Method | PUT|POST | | Requirements | NO CUSTOM | | Class | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub | -| Defaults | _controller: ]8;;myeditor://open?file=[:file:]&line=58\Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\MyController::__invoke()]8;;\ | +| Defaults | _controller: ]8;;myeditor://open?file=[:file:]&line=59\Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\MyController::__invoke()]8;;\ | | Options | compiler_class: Symfony\Component\Routing\RouteCompiler | | | opt1: val1 | | | opt2: val2 | diff --git a/Tests/Fixtures/Descriptor/route_collection_1.json b/Tests/Fixtures/Descriptor/route_collection_1.json index 200108a16..b5d584c95 100644 --- a/Tests/Fixtures/Descriptor/route_collection_1.json +++ b/Tests/Fixtures/Descriptor/route_collection_1.json @@ -37,3 +37,4 @@ "condition": "context.getMethod() in ['GET', 'HEAD', 'POST']" } } + diff --git a/Tests/Fixtures/Descriptor/route_collection_1.md b/Tests/Fixtures/Descriptor/route_collection_1.md index 432001f02..64b38953b 100644 --- a/Tests/Fixtures/Descriptor/route_collection_1.md +++ b/Tests/Fixtures/Descriptor/route_collection_1.md @@ -34,5 +34,4 @@ route_2 - `compiler_class`: Symfony\Component\Routing\RouteCompiler - `opt1`: val1 - `opt2`: val2 -- Condition: context.getMethod() in ['GET', 'HEAD', 'POST'] - +- Condition: context.getMethod() in ['GET', 'HEAD', 'POST'] \ No newline at end of file diff --git a/Tests/Fixtures/Descriptor/route_collection_1.txt b/Tests/Fixtures/Descriptor/route_collection_1.txt index 9d0656232..b787a2d4b 100644 --- a/Tests/Fixtures/Descriptor/route_collection_1.txt +++ b/Tests/Fixtures/Descriptor/route_collection_1.txt @@ -1,7 +1,7 @@ --------- ---------- ------------ ----------- ---------------  Name   Method   Scheme   Host   Path  --------- ---------- ------------ ----------- --------------- - route_1 GET|HEAD http|https localhost /hello/{name} - route_2 PUT|POST http|https localhost /name/add + route_1 GET|HEAD http|https localhost /hello/{name} + route_2 PUT|POST http|https localhost /name/add --------- ---------- ------------ ----------- --------------- diff --git a/Tests/Fixtures/Descriptor/route_collection_1.xml b/Tests/Fixtures/Descriptor/route_collection_1.xml index 6a07e0596..c36826d86 100644 --- a/Tests/Fixtures/Descriptor/route_collection_1.xml +++ b/Tests/Fixtures/Descriptor/route_collection_1.xml @@ -34,3 +34,4 @@ context.getMethod() in ['GET', 'HEAD', 'POST'] + diff --git a/Tests/Fixtures/Descriptor/route_collection_2.txt b/Tests/Fixtures/Descriptor/route_collection_2.txt index a9f9ee21b..e511a2857 100644 --- a/Tests/Fixtures/Descriptor/route_collection_2.txt +++ b/Tests/Fixtures/Descriptor/route_collection_2.txt @@ -1,7 +1,7 @@ --------- ---------- ------------ ----------- ---------------  Name   Method   Scheme   Host   Path  --------- ---------- ------------ ----------- --------------- - route_1 GET|HEAD http|https localhost /hello/{name} - route_3 ANY http|https localhost /other/route + route_1 GET|HEAD http|https localhost /hello/{name} + route_3 ANY http|https localhost /other/route --------- ---------- ------------ ----------- --------------- diff --git a/Tests/Fixtures/Descriptor/route_collection_3.txt b/Tests/Fixtures/Descriptor/route_collection_3.txt index 8822b3c40..1d89756d2 100644 --- a/Tests/Fixtures/Descriptor/route_collection_3.txt +++ b/Tests/Fixtures/Descriptor/route_collection_3.txt @@ -1,6 +1,6 @@ --------- ---------- ------------ ----------- -----------  Name   Method   Scheme   Host   Path  --------- ---------- ------------ ----------- ----------- - route_2 PUT|POST http|https localhost /name/add + route_2 PUT|POST http|https localhost /name/add --------- ---------- ------------ ----------- ----------- diff --git a/Tests/Fixtures/Descriptor/route_with_generic_host.json b/Tests/Fixtures/Descriptor/route_with_generic_host.json new file mode 100644 index 000000000..bc002e61d --- /dev/null +++ b/Tests/Fixtures/Descriptor/route_with_generic_host.json @@ -0,0 +1,18 @@ +{ + "some_route": { + "path": "\/some-route", + "pathRegex": "#PATH_REGEX#", + "host": "ANY", + "hostRegex": "", + "scheme": "https", + "method": "ANY", + "class": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\RouteStub", + "defaults": { + "_controller": "Controller" + }, + "requirements": "NO CUSTOM", + "options": { + "compiler_class": "Symfony\\Component\\Routing\\RouteCompiler" + } + } +} diff --git a/Tests/Fixtures/Descriptor/route_with_generic_host.md b/Tests/Fixtures/Descriptor/route_with_generic_host.md new file mode 100644 index 000000000..41466a164 --- /dev/null +++ b/Tests/Fixtures/Descriptor/route_with_generic_host.md @@ -0,0 +1,15 @@ +some_route +---------- + +- Path: /some-route +- Path Regex: #PATH_REGEX# +- Host: ANY +- Host Regex: +- Scheme: https +- Method: ANY +- Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub +- Defaults: + - `_controller`: Controller +- Requirements: NO CUSTOM +- Options: + - `compiler_class`: Symfony\Component\Routing\RouteCompiler \ No newline at end of file diff --git a/Tests/Fixtures/Descriptor/route_with_generic_host.txt b/Tests/Fixtures/Descriptor/route_with_generic_host.txt new file mode 100644 index 000000000..6c34fc464 --- /dev/null +++ b/Tests/Fixtures/Descriptor/route_with_generic_host.txt @@ -0,0 +1,6 @@ + ------------ -------- -------- ------------- +  Name   Method   Scheme   Path  + ------------ -------- -------- ------------- + some_route ANY https /some-route + ------------ -------- -------- ------------- + diff --git a/Tests/Fixtures/Descriptor/route_with_generic_host.xml b/Tests/Fixtures/Descriptor/route_with_generic_host.xml new file mode 100644 index 000000000..de9930fc5 --- /dev/null +++ b/Tests/Fixtures/Descriptor/route_with_generic_host.xml @@ -0,0 +1,14 @@ + + + + /some-route + https + + Controller + + + + + + + diff --git a/Tests/Fixtures/Descriptor/route_with_generic_scheme.json b/Tests/Fixtures/Descriptor/route_with_generic_scheme.json new file mode 100644 index 000000000..811c07773 --- /dev/null +++ b/Tests/Fixtures/Descriptor/route_with_generic_scheme.json @@ -0,0 +1,18 @@ +{ + "some_route_with_host": { + "path": "\/some-route", + "pathRegex": "#PATH_REGEX#", + "host": "symfony.com", + "hostRegex": "#HOST_REGEX#", + "scheme": "ANY", + "method": "ANY", + "class": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Console\\Descriptor\\RouteStub", + "defaults": { + "_controller": "strpos" + }, + "requirements": "NO CUSTOM", + "options": { + "compiler_class": "Symfony\\Component\\Routing\\RouteCompiler" + } + } +} diff --git a/Tests/Fixtures/Descriptor/route_with_generic_scheme.md b/Tests/Fixtures/Descriptor/route_with_generic_scheme.md new file mode 100644 index 000000000..8a8bad6ea --- /dev/null +++ b/Tests/Fixtures/Descriptor/route_with_generic_scheme.md @@ -0,0 +1,15 @@ +some_route_with_host +-------------------- + +- Path: /some-route +- Path Regex: #PATH_REGEX# +- Host: symfony.com +- Host Regex: #HOST_REGEX# +- Scheme: ANY +- Method: ANY +- Class: Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub +- Defaults: + - `_controller`: strpos +- Requirements: NO CUSTOM +- Options: + - `compiler_class`: Symfony\Component\Routing\RouteCompiler diff --git a/Tests/Fixtures/Descriptor/route_with_generic_scheme.txt b/Tests/Fixtures/Descriptor/route_with_generic_scheme.txt new file mode 100644 index 000000000..cb83e325a --- /dev/null +++ b/Tests/Fixtures/Descriptor/route_with_generic_scheme.txt @@ -0,0 +1,6 @@ + ---------------------- -------- ------------- ------------- +  Name   Method   Host   Path  + ---------------------- -------- ------------- ------------- + some_route_with_host ANY symfony.com /some-route + ---------------------- -------- ------------- ------------- + diff --git a/Tests/Fixtures/Descriptor/route_with_generic_scheme.xml b/Tests/Fixtures/Descriptor/route_with_generic_scheme.xml new file mode 100644 index 000000000..fe7d8da8d --- /dev/null +++ b/Tests/Fixtures/Descriptor/route_with_generic_scheme.xml @@ -0,0 +1,13 @@ + + + + /some-route + symfony.com + + strpos + + + + + + diff --git a/Tests/Functional/AbstractAttributeRoutingTestCase.php b/Tests/Functional/AbstractAttributeRoutingTestCase.php index 5166c8dda..842d7268f 100644 --- a/Tests/Functional/AbstractAttributeRoutingTestCase.php +++ b/Tests/Functional/AbstractAttributeRoutingTestCase.php @@ -11,13 +11,12 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Component\HttpFoundation\Request; abstract class AbstractAttributeRoutingTestCase extends AbstractWebTestCase { - /** - * @dataProvider getRoutes - */ + #[DataProvider('getRoutes')] public function testAnnotatedController(string $path, string $expectedValue) { $client = $this->createClient(['test_case' => $this->getTestCaseApp(), 'root_config' => 'config.yml']); diff --git a/Tests/Functional/ApiAttributesTest.php b/Tests/Functional/ApiAttributesTest.php index 4848976ae..79c8a704b 100644 --- a/Tests/Functional/ApiAttributesTest.php +++ b/Tests/Functional/ApiAttributesTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Component\DomCrawler\Crawler; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -21,9 +22,7 @@ class ApiAttributesTest extends AbstractWebTestCase { - /** - * @dataProvider mapQueryStringProvider - */ + #[DataProvider('mapQueryStringProvider')] public function testMapQueryString(string $uri, array $query, string $expectedResponse, int $expectedStatusCode) { $client = self::createClient(['test_case' => 'ApiAttributesTest']); @@ -146,24 +145,24 @@ public static function mapQueryStringProvider(): iterable ]; $expectedResponse = <<<'JSON' - { - "type": "https:\/\/symfony.com\/errors\/validation", - "title": "Validation Failed", - "status": 404, - "detail": "filter: This value should be of type Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Filter.", - "violations": [ - { - "parameters": { - "hint": "Failed to create object because the class misses the \"filter\" property.", - "{{ type }}": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Filter" - }, - "propertyPath": "filter", - "template": "This value should be of type {{ type }}.", - "title": "This value should be of type Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Filter." - } - ] - } - JSON; + { + "type": "https:\/\/symfony.com\/errors\/validation", + "title": "Validation Failed", + "status": 404, + "detail": "filter: This value should be of type Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Filter.", + "violations": [ + { + "parameters": { + "hint": "Failed to create object because the class misses the \"filter\" property.", + "{{ type }}": "Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Filter" + }, + "propertyPath": "filter", + "template": "This value should be of type {{ type }}.", + "title": "This value should be of type Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Filter." + } + ] + } + JSON; yield 'empty query string mapping non-nullable attribute without default value' => [ 'uri' => '/map-query-string-to-non-nullable-attribute-without-default-value.json', @@ -214,9 +213,7 @@ public static function mapQueryStringProvider(): iterable ]; } - /** - * @dataProvider mapRequestPayloadProvider - */ + #[DataProvider('mapRequestPayloadProvider')] public function testMapRequestPayload(string $uri, string $format, array $parameters, ?string $content, callable $responseAssertion, int $expectedStatusCode) { $client = self::createClient(['test_case' => 'ApiAttributesTest']); @@ -603,7 +600,7 @@ public static function mapRequestPayloadProvider(): iterable self::assertIsArray($json['violations'] ?? null); self::assertCount(1, $json['violations']); self::assertSame('approved', $json['violations'][0]['propertyPath'] ?? null); -}, + }, 'expectedStatusCode' => 422, ]; @@ -947,11 +944,11 @@ public function __invoke(#[MapRequestPayload] ?RequestBody $body, Request $reque return new Response( << - {$body->comment} - {$body->approved} - - XML + + {$body->comment} + {$body->approved} + + XML ); } } @@ -966,11 +963,11 @@ public function __invoke(Request $request, #[MapRequestPayload] RequestBody $bod return new Response( << - {$body->comment} - {$body->approved} - - XML + + {$body->comment} + {$body->approved} + + XML ); } } @@ -985,11 +982,11 @@ public function __invoke(Request $request, #[MapRequestPayload] RequestBody $bod return new Response( << - {$body->comment} - {$body->approved} - - XML + + {$body->comment} + {$body->approved} + + XML ); } } diff --git a/Tests/Functional/BundlePathsTest.php b/Tests/Functional/BundlePathsTest.php index a06803434..45663f0bf 100644 --- a/Tests/Functional/BundlePathsTest.php +++ b/Tests/Functional/BundlePathsTest.php @@ -28,7 +28,7 @@ public function testBundlePublicDir() $fs = new Filesystem(); $fs->remove($projectDir); $fs->mkdir($projectDir.'/public'); - $command = (new Application($kernel))->add(new AssetsInstallCommand($fs, $projectDir)); + $command = (new Application($kernel))->addCommand(new AssetsInstallCommand($fs, $projectDir)); $exitCode = (new CommandTester($command))->execute(['target' => $projectDir.'/public']); $this->assertSame(0, $exitCode); diff --git a/Tests/Functional/CachePoolClearCommandTest.php b/Tests/Functional/CachePoolClearCommandTest.php index dbd78645d..53e8b5c48 100644 --- a/Tests/Functional/CachePoolClearCommandTest.php +++ b/Tests/Functional/CachePoolClearCommandTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\Group; use Symfony\Bundle\FrameworkBundle\Command\CachePoolClearCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Cache\Adapter\FilesystemAdapter; @@ -19,9 +20,7 @@ use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\Finder\SplFileInfo; -/** - * @group functional - */ +#[Group('functional')] class CachePoolClearCommandTest extends AbstractWebTestCase { protected function setUp(): void @@ -146,7 +145,7 @@ public function testExcludedPool() private function createCommandTester(?array $poolNames = null) { $application = new Application(static::$kernel); - $application->add(new CachePoolClearCommand(static::getContainer()->get('cache.global_clearer'), $poolNames)); + $application->addCommand(new CachePoolClearCommand(static::getContainer()->get('cache.global_clearer'), $poolNames)); return new CommandTester($application->find('cache:pool:clear')); } diff --git a/Tests/Functional/CachePoolListCommandTest.php b/Tests/Functional/CachePoolListCommandTest.php index 8e9061845..6dcbc4294 100644 --- a/Tests/Functional/CachePoolListCommandTest.php +++ b/Tests/Functional/CachePoolListCommandTest.php @@ -11,13 +11,12 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\Group; use Symfony\Bundle\FrameworkBundle\Command\CachePoolListCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; -/** - * @group functional - */ +#[Group('functional')] class CachePoolListCommandTest extends AbstractWebTestCase { protected function setUp(): void @@ -46,7 +45,7 @@ public function testEmptyList() private function createCommandTester(array $poolNames) { $application = new Application(static::$kernel); - $application->add(new CachePoolListCommand($poolNames)); + $application->addCommand(new CachePoolListCommand($poolNames)); return new CommandTester($application->find('cache:pool:list')); } diff --git a/Tests/Functional/CachePoolsTest.php b/Tests/Functional/CachePoolsTest.php index 23f4a116e..64829949a 100644 --- a/Tests/Functional/CachePoolsTest.php +++ b/Tests/Functional/CachePoolsTest.php @@ -11,6 +11,9 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +use PHPUnit\Framework\Error\Warning; use Symfony\Component\Cache\Adapter\AdapterInterface; use Symfony\Component\Cache\Adapter\RedisAdapter; use Symfony\Component\Cache\Adapter\TagAwareAdapter; @@ -24,18 +27,15 @@ public function testCachePools() $this->doTestCachePools([], AdapterInterface::class); } - /** - * @requires extension redis - * - * @group integration - */ + #[RequiresPhpExtension('redis')] + #[Group('integration')] public function testRedisCachePools() { $this->skipIfRedisUnavailable(); try { $this->doTestCachePools(['root_config' => 'redis_config.yml', 'environment' => 'redis_cache'], RedisAdapter::class); - } catch (\PHPUnit\Framework\Error\Warning $e) { + } catch (Warning $e) { if (!str_starts_with($e->getMessage(), 'unable to connect to')) { throw $e; } @@ -48,18 +48,15 @@ public function testRedisCachePools() } } - /** - * @requires extension redis - * - * @group integration - */ + #[RequiresPhpExtension('redis')] + #[Group('integration')] public function testRedisCustomCachePools() { $this->skipIfRedisUnavailable(); try { $this->doTestCachePools(['root_config' => 'redis_custom_config.yml', 'environment' => 'custom_redis_cache'], RedisAdapter::class); - } catch (\PHPUnit\Framework\Error\Warning $e) { + } catch (Warning $e) { if (!str_starts_with($e->getMessage(), 'unable to connect to')) { throw $e; } diff --git a/Tests/Functional/ConfigDebugCommandTest.php b/Tests/Functional/ConfigDebugCommandTest.php index 2c47121c1..ea4ee0788 100644 --- a/Tests/Functional/ConfigDebugCommandTest.php +++ b/Tests/Functional/ConfigDebugCommandTest.php @@ -11,6 +11,9 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\TestWith; use Symfony\Bundle\FrameworkBundle\Command\ConfigDebugCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Exception\InvalidArgumentException; @@ -19,15 +22,11 @@ use Symfony\Component\Console\Tester\CommandCompletionTester; use Symfony\Component\Console\Tester\CommandTester; -/** - * @group functional - */ +#[Group('functional')] class ConfigDebugCommandTest extends AbstractWebTestCase { - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testShowList(bool $debug) { $tester = $this->createCommandTester($debug); @@ -44,10 +43,8 @@ public function testShowList(bool $debug) $this->assertStringContainsString(' test_dump', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpKernelExtension(bool $debug) { $tester = $this->createCommandTester($debug); @@ -58,10 +55,8 @@ public function testDumpKernelExtension(bool $debug) $this->assertStringContainsString(' foo: bar', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpBundleName(bool $debug) { $tester = $this->createCommandTester($debug); @@ -71,10 +66,8 @@ public function testDumpBundleName(bool $debug) $this->assertStringContainsString('custom: foo', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpBundleOption(bool $debug) { $tester = $this->createCommandTester($debug); @@ -84,10 +77,8 @@ public function testDumpBundleOption(bool $debug) $this->assertStringContainsString('foo', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpWithoutTitleIsValidJson(bool $debug) { $tester = $this->createCommandTester($debug); @@ -97,10 +88,8 @@ public function testDumpWithoutTitleIsValidJson(bool $debug) $this->assertJson($tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpWithUnsupportedFormat(bool $debug) { $tester = $this->createCommandTester($debug); @@ -114,10 +103,8 @@ public function testDumpWithUnsupportedFormat(bool $debug) ]); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testParametersValuesAreResolved(bool $debug) { $tester = $this->createCommandTester($debug); @@ -128,10 +115,8 @@ public function testParametersValuesAreResolved(bool $debug) $this->assertStringContainsString('secret: test', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testParametersValuesAreFullyResolved(bool $debug) { $tester = $this->createCommandTester($debug); @@ -144,10 +129,8 @@ public function testParametersValuesAreFullyResolved(bool $debug) $this->assertStringContainsString('ide: '.($debug ? ($_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? 'null') : 'null'), $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDefaultParameterValueIsResolvedIfConfigIsExisting(bool $debug) { $tester = $this->createCommandTester($debug); @@ -158,10 +141,8 @@ public function testDefaultParameterValueIsResolvedIfConfigIsExisting(bool $debu $this->assertStringContainsString(\sprintf("dsn: 'file:%s/profiler'", $kernelCacheDir), $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpExtensionConfigWithoutBundle(bool $debug) { $tester = $this->createCommandTester($debug); @@ -171,10 +152,8 @@ public function testDumpExtensionConfigWithoutBundle(bool $debug) $this->assertStringContainsString('enabled: true', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpUndefinedBundleOption(bool $debug) { $tester = $this->createCommandTester($debug); @@ -183,10 +162,8 @@ public function testDumpUndefinedBundleOption(bool $debug) $this->assertStringContainsString('Unable to find configuration for "test.foo"', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpWithPrefixedEnv(bool $debug) { $tester = $this->createCommandTester($debug); @@ -195,10 +172,8 @@ public function testDumpWithPrefixedEnv(bool $debug) $this->assertStringContainsString("cookie_httponly: '%env(bool:COOKIE_HTTPONLY)%'", $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpFallsBackToDefaultConfigAndResolvesParameterValue(bool $debug) { $tester = $this->createCommandTester($debug); @@ -208,10 +183,8 @@ public function testDumpFallsBackToDefaultConfigAndResolvesParameterValue(bool $ $this->assertStringContainsString('foo: bar', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpFallsBackToDefaultConfigAndResolvesEnvPlaceholder(bool $debug) { $tester = $this->createCommandTester($debug); @@ -221,10 +194,8 @@ public function testDumpFallsBackToDefaultConfigAndResolvesEnvPlaceholder(bool $ $this->assertStringContainsString("baz: '%env(BAZ)%'", $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpThrowsExceptionWhenDefaultConfigFallbackIsImpossible(bool $debug) { $this->expectException(\LogicException::class); @@ -234,14 +205,12 @@ public function testDumpThrowsExceptionWhenDefaultConfigFallbackIsImpossible(boo $tester->execute(['name' => 'ExtensionWithoutConfigTestBundle']); } - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(bool $debug, array $input, array $expectedSuggestions) { $application = $this->createApplication($debug); - $application->add(new ConfigDebugCommand()); + $application->addCommand(new ConfigDebugCommand()); $tester = new CommandCompletionTester($application->get('debug:config')); $suggestions = $tester->complete($input); diff --git a/Tests/Functional/ConfigDumpReferenceCommandTest.php b/Tests/Functional/ConfigDumpReferenceCommandTest.php index 8f5930faa..377a530e9 100644 --- a/Tests/Functional/ConfigDumpReferenceCommandTest.php +++ b/Tests/Functional/ConfigDumpReferenceCommandTest.php @@ -11,6 +11,9 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\TestWith; use Symfony\Bundle\FrameworkBundle\Command\ConfigDumpReferenceCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Input\ArrayInput; @@ -18,15 +21,11 @@ use Symfony\Component\Console\Tester\CommandCompletionTester; use Symfony\Component\Console\Tester\CommandTester; -/** - * @group functional - */ +#[Group('functional')] class ConfigDumpReferenceCommandTest extends AbstractWebTestCase { - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testShowList(bool $debug) { $tester = $this->createCommandTester($debug); @@ -43,10 +42,8 @@ public function testShowList(bool $debug) $this->assertStringContainsString(' test_dump', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpKernelExtension(bool $debug) { $tester = $this->createCommandTester($debug); @@ -57,10 +54,8 @@ public function testDumpKernelExtension(bool $debug) $this->assertStringContainsString(' bar', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpBundleName(bool $debug) { $tester = $this->createCommandTester($debug); @@ -71,10 +66,8 @@ public function testDumpBundleName(bool $debug) $this->assertStringContainsString(' custom:', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpExtensionConfigWithoutBundle(bool $debug) { $tester = $this->createCommandTester($debug); @@ -84,10 +77,8 @@ public function testDumpExtensionConfigWithoutBundle(bool $debug) $this->assertStringContainsString('enabled: true', $tester->getDisplay()); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpAtPath(bool $debug) { $tester = $this->createCommandTester($debug); @@ -98,20 +89,19 @@ public function testDumpAtPath(bool $debug) $this->assertSame(0, $ret, 'Returns 0 in case of success'); $this->assertSame(<<<'EOL' -# Default configuration for extension with alias: "test" at path "array" -array: - child1: ~ - child2: ~ + # Default configuration for extension with alias: "test" at path "array" + array: + child1: ~ + child2: ~ -EOL - , $tester->getDisplay(true)); + EOL, + $tester->getDisplay(true) + ); } - /** - * @testWith [true] - * [false] - */ + #[TestWith([true])] + #[TestWith([false])] public function testDumpAtPathXml(bool $debug) { $tester = $this->createCommandTester($debug); @@ -125,14 +115,12 @@ public function testDumpAtPathXml(bool $debug) $this->assertStringContainsString('[ERROR] The "path" option is only available for the "yaml" format.', $tester->getDisplay()); } - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(bool $debug, array $input, array $expectedSuggestions) { $application = $this->createApplication($debug); - $application->add(new ConfigDumpReferenceCommand()); + $application->addCommand(new ConfigDumpReferenceCommand()); $tester = new CommandCompletionTester($application->get('config:dump-reference')); $suggestions = $tester->complete($input); $this->assertSame($expectedSuggestions, $suggestions); diff --git a/Tests/Functional/ContainerDebugCommandTest.php b/Tests/Functional/ContainerDebugCommandTest.php index d21d4d113..e1e7ce084 100644 --- a/Tests/Functional/ContainerDebugCommandTest.php +++ b/Tests/Functional/ContainerDebugCommandTest.php @@ -11,6 +11,8 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\BackslashClass; use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\ContainerExcluded; @@ -18,9 +20,7 @@ use Symfony\Component\Console\Tester\CommandCompletionTester; use Symfony\Component\HttpKernel\HttpKernelInterface; -/** - * @group functional - */ +#[Group('functional')] class ContainerDebugCommandTest extends AbstractWebTestCase { public function testDumpContainerIfNotExists() @@ -113,9 +113,7 @@ public function testExcludedService() $this->assertStringNotContainsString(ContainerExcluded::class, $tester->getDisplay()); } - /** - * @dataProvider provideIgnoreBackslashWhenFindingService - */ + #[DataProvider('provideIgnoreBackslashWhenFindingService')] public function testIgnoreBackslashWhenFindingService(string $validServiceId) { static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']); @@ -168,25 +166,26 @@ public function testDescribeEnvVars() $this->assertStringMatchesFormat(<<<'TXT' -Symfony Container Environment Variables -======================================= + Symfony Container Environment Variables + ======================================= - --------- ----------------- ------------%w - Name Default value Real value%w - --------- ----------------- ------------%w - JSON "[1, "2.5", 3]" n/a%w - REAL n/a "value"%w - UNKNOWN n/a n/a%w - --------- ----------------- ------------%w + --------- ----------------- ------------%w + Name Default value Real value%w + --------- ----------------- ------------%w + JSON "[1, "2.5", 3]" n/a%w + REAL n/a "value"%w + UNKNOWN n/a n/a%w + --------- ----------------- ------------%w - // Note real values might be different between web and CLI.%w + // Note real values might be different between web and CLI.%w - [WARNING] The following variables are missing:%w + [WARNING] The following variables are missing:%w - * UNKNOWN + * UNKNOWN -TXT - , $tester->getDisplay(true)); + TXT, + $tester->getDisplay(true) + ); putenv('REAL'); } @@ -214,10 +213,10 @@ public function testGetDeprecation() file_put_contents($path, serialize([[ 'type' => 16384, 'message' => 'The "Symfony\Bundle\FrameworkBundle\Controller\Controller" class is deprecated since Symfony 4.2, use Symfony\Bundle\FrameworkBundle\Controller\AbstractController instead.', - 'file' => '/home/hamza/projet/contrib/sf/vendor/symfony/framework-bundle/Controller/Controller.php', + 'file' => '/home/hamza/project/contrib/sf/vendor/symfony/framework-bundle/Controller/Controller.php', 'line' => 17, 'trace' => [[ - 'file' => '/home/hamza/projet/contrib/sf/src/Controller/DefaultController.php', + 'file' => '/home/hamza/project/contrib/sf/src/Controller/DefaultController.php', 'line' => 9, 'function' => 'spl_autoload_call', ]], @@ -233,7 +232,7 @@ public function testGetDeprecation() $tester->assertCommandIsSuccessful(); $this->assertStringContainsString('Symfony\Bundle\FrameworkBundle\Controller\Controller', $tester->getDisplay()); - $this->assertStringContainsString('/home/hamza/projet/contrib/sf/vendor/symfony/framework-bundle/Controller/Controller.php', $tester->getDisplay()); + $this->assertStringContainsString('/home/hamza/project/contrib/sf/vendor/symfony/framework-bundle/Controller/Controller.php', $tester->getDisplay()); } public function testGetDeprecationNone() @@ -282,9 +281,7 @@ public static function provideIgnoreBackslashWhenFindingService(): array ]; } - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions, array $notExpectedSuggestions = []) { static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml', 'debug' => true]); diff --git a/Tests/Functional/ContainerLintCommandTest.php b/Tests/Functional/ContainerLintCommandTest.php index f0b6b4bd5..81b957751 100644 --- a/Tests/Functional/ContainerLintCommandTest.php +++ b/Tests/Functional/ContainerLintCommandTest.php @@ -11,19 +11,17 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; -/** - * @group functional - */ +#[Group('functional')] class ContainerLintCommandTest extends AbstractWebTestCase { private Application $application; - /** - * @dataProvider containerLintProvider - */ + #[DataProvider('containerLintProvider')] public function testLintContainer(string $configFile, bool $resolveEnvVars, int $expectedExitCode, string $expectedOutput) { $kernel = static::createKernel([ @@ -40,13 +38,12 @@ public function testLintContainer(string $configFile, bool $resolveEnvVars, int $this->assertStringContainsString($expectedOutput, $tester->getDisplay()); } - public static function containerLintProvider(): array + public static function containerLintProvider(): iterable { - return [ - ['escaped_percent.yml', false, 0, 'The container was linted successfully'], - ['missing_env_var.yml', false, 0, 'The container was linted successfully'], - ['missing_env_var.yml', true, 1, 'Environment variable not found: "BAR"'], - ]; + yield ['escaped_percent.yml', false, 0, 'The container was linted successfully']; + yield ['escaped_percent.yml', true, 0, 'The container was linted successfully']; + yield ['missing_env_var.yml', false, 0, 'The container was linted successfully']; + yield ['missing_env_var.yml', true, 1, 'Environment variable not found: "BAR"']; } private function createCommandTester(): CommandTester diff --git a/Tests/Functional/DebugAutowiringCommandTest.php b/Tests/Functional/DebugAutowiringCommandTest.php index ca11e3fae..de94a1e71 100644 --- a/Tests/Functional/DebugAutowiringCommandTest.php +++ b/Tests/Functional/DebugAutowiringCommandTest.php @@ -11,6 +11,8 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; use Psr\Log\LoggerInterface; use Symfony\Bundle\FrameworkBundle\Command\DebugAutowiringCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; @@ -20,9 +22,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\Routing\RouterInterface; -/** - * @group functional - */ +#[Group('functional')] class DebugAutowiringCommandTest extends AbstractWebTestCase { public function testBasicFunctionality() @@ -116,13 +116,11 @@ public function testNotConfusedByClassAliases() $this->assertStringContainsString(ClassAliasExampleClass::class, $tester->getDisplay()); } - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions) { $kernel = static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']); - $command = (new Application($kernel))->add(new DebugAutowiringCommand()); + $command = (new Application($kernel))->addCommand(new DebugAutowiringCommand()); $tester = new CommandCompletionTester($command); diff --git a/Tests/Functional/FragmentTest.php b/Tests/Functional/FragmentTest.php index 48d5c327a..b8cff1f48 100644 --- a/Tests/Functional/FragmentTest.php +++ b/Tests/Functional/FragmentTest.php @@ -11,11 +11,11 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; + class FragmentTest extends AbstractWebTestCase { - /** - * @dataProvider getConfigs - */ + #[DataProvider('getConfigs')] public function testFragment($insulate) { $client = $this->createClient(['test_case' => 'Fragment', 'root_config' => 'config.yml', 'debug' => true]); @@ -26,15 +26,16 @@ public function testFragment($insulate) $client->request('GET', '/fragment_home'); $this->assertEquals(<<getResponse()->getContent()); + bar txt + -- + html + -- + es + -- + fr + TXT, + $client->getResponse()->getContent() + ); } public static function getConfigs() diff --git a/Tests/Functional/MailerTest.php b/Tests/Functional/MailerTest.php index 1ba71d74f..4193e3ff7 100644 --- a/Tests/Functional/MailerTest.php +++ b/Tests/Functional/MailerTest.php @@ -99,6 +99,7 @@ public function testMailerAssertions() $this->assertEmailHtmlBodyContains($email, 'Foo'); $this->assertEmailHtmlBodyNotContains($email, 'Bar'); $this->assertEmailAttachmentCount($email, 1); + $this->assertEmailAddressNotContains($email, 'To', 'thomas@symfony.com'); $email = $this->getMailerMessage($second); $this->assertEmailSubjectContains($email, 'Foo'); @@ -106,5 +107,7 @@ public function testMailerAssertions() $this->assertEmailAddressContains($email, 'To', 'fabien@symfony.com'); $this->assertEmailAddressContains($email, 'To', 'thomas@symfony.com'); $this->assertEmailAddressContains($email, 'Reply-To', 'me@symfony.com'); + $this->assertEmailAddressNotContains($email, 'To', 'helene@symfony.com'); + $this->assertEmailAddressNotContains($email, 'Reply-To', 'helene@symfony.com'); } } diff --git a/Tests/Functional/NotificationTest.php b/Tests/Functional/NotificationTest.php index 03b947a0f..7511591cb 100644 --- a/Tests/Functional/NotificationTest.php +++ b/Tests/Functional/NotificationTest.php @@ -11,11 +11,12 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\RequiresMethod; +use Symfony\Bundle\MercureBundle\MercureBundle; + final class NotificationTest extends AbstractWebTestCase { - /** - * @requires function \Symfony\Bundle\MercureBundle\MercureBundle::build - */ + #[RequiresMethod(MercureBundle::class, 'build')] public function testNotifierAssertion() { $client = $this->createClient(['test_case' => 'Notifier', 'root_config' => 'config.yml', 'debug' => true]); diff --git a/Tests/Functional/ProfilerTest.php b/Tests/Functional/ProfilerTest.php index d78259795..b5853dd1a 100644 --- a/Tests/Functional/ProfilerTest.php +++ b/Tests/Functional/ProfilerTest.php @@ -11,11 +11,11 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; + class ProfilerTest extends AbstractWebTestCase { - /** - * @dataProvider getConfigs - */ + #[DataProvider('getConfigs')] public function testProfilerIsDisabled($insulate) { $client = $this->createClient(['test_case' => 'Profiler', 'root_config' => 'config.yml']); @@ -36,9 +36,7 @@ public function testProfilerIsDisabled($insulate) $this->assertNull($client->getProfile()); } - /** - * @dataProvider getConfigs - */ + #[DataProvider('getConfigs')] public function testProfilerCollectParameter($insulate) { $client = $this->createClient(['test_case' => 'ProfilerCollectParameter', 'root_config' => 'config.yml']); diff --git a/Tests/Functional/PropertyInfoTest.php b/Tests/Functional/PropertyInfoTest.php index 18cd61b08..041400a0c 100644 --- a/Tests/Functional/PropertyInfoTest.php +++ b/Tests/Functional/PropertyInfoTest.php @@ -11,7 +11,6 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; -use Symfony\Component\PropertyInfo\Type as LegacyType; use Symfony\Component\TypeInfo\Type; class PropertyInfoTest extends AbstractWebTestCase @@ -22,28 +21,8 @@ public function testPhpDocPriority() $propertyInfo = static::getContainer()->get('property_info'); - if (!method_exists($propertyInfo, 'getType')) { - $this->markTestSkipped(); - } - $this->assertEquals(Type::list(Type::int()), $propertyInfo->getType(Dummy::class, 'codes')); } - - /** - * @group legacy - */ - public function testPhpDocPriorityLegacy() - { - static::bootKernel(['test_case' => 'Serializer']); - - $propertyInfo = static::getContainer()->get('property_info'); - - if (!method_exists($propertyInfo, 'getTypes')) { - $this->markTestSkipped(); - } - - $this->assertEquals([new LegacyType('array', false, null, true, new LegacyType('int'), new LegacyType('int'))], $propertyInfo->getTypes(Dummy::class, 'codes')); - } } class Dummy diff --git a/Tests/Functional/RouterDebugCommandTest.php b/Tests/Functional/RouterDebugCommandTest.php index 614078804..910e3b6f7 100644 --- a/Tests/Functional/RouterDebugCommandTest.php +++ b/Tests/Functional/RouterDebugCommandTest.php @@ -11,13 +11,14 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\TestWith; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandCompletionTester; use Symfony\Component\Console\Tester\CommandTester; -/** - * @group functional - */ +#[Group('functional')] class RouterDebugCommandTest extends AbstractWebTestCase { private Application $application; @@ -89,21 +90,17 @@ public function testSearchWithThrow() $tester->execute(['name' => 'gerard'], ['interactive' => true]); } - /** - * @dataProvider provideCompletionSuggestions - */ + #[DataProvider('provideCompletionSuggestions')] public function testComplete(array $input, array $expectedSuggestions) { $tester = new CommandCompletionTester($this->application->get('debug:router')); $this->assertSame($expectedSuggestions, $tester->complete($input)); } - /** - * @testWith ["txt"] - * ["xml"] - * ["json"] - * ["md"] - */ + #[TestWith(['txt'])] + #[TestWith(['xml'])] + #[TestWith(['json'])] + #[TestWith(['md'])] public function testShowAliases(string $format) { $tester = $this->createCommandTester(); diff --git a/Tests/Functional/RoutingConditionServiceTest.php b/Tests/Functional/RoutingConditionServiceTest.php index 4f4caa6eb..f1f4f14cf 100644 --- a/Tests/Functional/RoutingConditionServiceTest.php +++ b/Tests/Functional/RoutingConditionServiceTest.php @@ -11,11 +11,11 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; + class RoutingConditionServiceTest extends AbstractWebTestCase { - /** - * @dataProvider provideRoutes - */ + #[DataProvider('provideRoutes')] public function testCondition(int $code, string $path) { $client = static::createClient(['test_case' => 'RoutingConditionService']); diff --git a/Tests/Functional/SecurityTest.php b/Tests/Functional/SecurityTest.php index c26fa717d..ab06b5f6c 100644 --- a/Tests/Functional/SecurityTest.php +++ b/Tests/Functional/SecurityTest.php @@ -11,13 +11,12 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Component\Security\Core\User\InMemoryUser; class SecurityTest extends AbstractWebTestCase { - /** - * @dataProvider getUsers - */ + #[DataProvider('getUsers')] public function testLoginUser(string $username, array $roles, ?string $firewallContext) { $user = new InMemoryUser($username, 'the-password', $roles); diff --git a/Tests/Functional/SessionTest.php b/Tests/Functional/SessionTest.php index 4c1b92ccf..00eb952f0 100644 --- a/Tests/Functional/SessionTest.php +++ b/Tests/Functional/SessionTest.php @@ -11,13 +11,14 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\DataProvider; + class SessionTest extends AbstractWebTestCase { /** * Tests session attributes persist. - * - * @dataProvider getConfigs */ + #[DataProvider('getConfigs')] public function testWelcome($config, $insulate) { $client = $this->createClient(['test_case' => 'Session', 'root_config' => $config]); @@ -44,13 +45,26 @@ public function testWelcome($config, $insulate) // prove cleared session $crawler = $client->request('GET', '/session'); $this->assertStringContainsString('You are new here and gave no name.', $crawler->text()); + + // prepare session programatically + $session = $client->getSession(); + $session->set('name', 'drak'); + $session->save(); + + // ensure session can be saved multiple times without being reset + $session = $client->getSession(); + $session->set('foo', 'bar'); + $session->save(); + + // prove remembered name from programatically prepared session + $crawler = $client->request('GET', '/session'); + $this->assertStringContainsString('Welcome back drak, nice to meet you.', $crawler->text()); } /** * Tests flash messages work in practice. - * - * @dataProvider getConfigs */ + #[DataProvider('getConfigs')] public function testFlash($config, $insulate) { $client = $this->createClient(['test_case' => 'Session', 'root_config' => $config]); @@ -72,9 +86,8 @@ public function testFlash($config, $insulate) /** * See if two separate insulated clients can run without * polluting each other's session data. - * - * @dataProvider getConfigs */ + #[DataProvider('getConfigs')] public function testTwoClients($config, $insulate) { // start first client @@ -128,9 +141,7 @@ public function testTwoClients($config, $insulate) $this->assertStringContainsString('Welcome back client2, nice to meet you.', $crawler2->text()); } - /** - * @dataProvider getConfigs - */ + #[DataProvider('getConfigs')] public function testCorrectCacheControlHeadersForCacheableAction($config, $insulate) { $client = $this->createClient(['test_case' => 'Session', 'root_config' => $config]); diff --git a/Tests/Functional/SluggerLocaleAwareTest.php b/Tests/Functional/SluggerLocaleAwareTest.php index 769012461..d09f969b0 100644 --- a/Tests/Functional/SluggerLocaleAwareTest.php +++ b/Tests/Functional/SluggerLocaleAwareTest.php @@ -11,16 +11,14 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\Group; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Slugger\SlugConstructArgService; -/** - * @group functional - */ +#[Group('functional')] class SluggerLocaleAwareTest extends AbstractWebTestCase { - /** - * @requires extension intl - */ + #[RequiresPhpExtension('intl')] public function testLocalizedSlugger() { $kernel = static::createKernel(['test_case' => 'Slugger', 'root_config' => 'config.yml']); diff --git a/Tests/Functional/TestServiceContainerTest.php b/Tests/Functional/TestServiceContainerTest.php index fe7093081..8b8898ad8 100644 --- a/Tests/Functional/TestServiceContainerTest.php +++ b/Tests/Functional/TestServiceContainerTest.php @@ -11,6 +11,8 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\Depends; +use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; use Symfony\Bundle\FrameworkBundle\Test\TestContainer; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestServiceContainer\NonPublicService; use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestServiceContainer\PrivateService; @@ -68,17 +70,13 @@ public function testSetDecoratedService() $this->assertSame($service, $container->get('decorated')->inner); } - /** - * @doesNotPerformAssertions - */ + #[DoesNotPerformAssertions] public function testBootKernel() { static::bootKernel(['test_case' => 'TestServiceContainer']); } - /** - * @depends testBootKernel - */ + #[Depends('testBootKernel')] public function testKernelIsNotInitialized() { self::assertNull(self::$class); diff --git a/Tests/Functional/TranslationDebugCommandTest.php b/Tests/Functional/TranslationDebugCommandTest.php index 5e396440c..1d7e2952b 100644 --- a/Tests/Functional/TranslationDebugCommandTest.php +++ b/Tests/Functional/TranslationDebugCommandTest.php @@ -11,13 +11,12 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; +use PHPUnit\Framework\Attributes\Group; use Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; -/** - * @group functional - */ +#[Group('functional')] class TranslationDebugCommandTest extends AbstractWebTestCase { private Application $application; diff --git a/Tests/Functional/TypeInfoTest.php b/Tests/Functional/TypeInfoTest.php index 6acdb9c81..dcda93a33 100644 --- a/Tests/Functional/TypeInfoTest.php +++ b/Tests/Functional/TypeInfoTest.php @@ -13,6 +13,7 @@ use PHPStan\PhpDocParser\Parser\PhpDocParser; use Symfony\Bundle\FrameworkBundle\Tests\Functional\app\TypeInfo\Dummy; +use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\TypeInfo\Type; class TypeInfoTest extends AbstractWebTestCase @@ -28,5 +29,10 @@ public function testComponent() } $this->assertEquals(Type::int(), static::getContainer()->get('type_info.resolver')->resolve('int')); + + if (Kernel::VERSION_ID >= 70400) { + $this->assertEquals(Type::int(), static::getContainer()->get('type_info.resolver')->resolve(new \ReflectionProperty(Dummy::class, 'customAlias'))); + $this->assertEquals(Type::int(), static::getContainer()->get('type_info.resolver')->resolve('CustomAlias')); + } } } diff --git a/Tests/Functional/app/ApiAttributesTest/config.yml b/Tests/Functional/app/ApiAttributesTest/config.yml index 00bdd8ab9..8b218d48c 100644 --- a/Tests/Functional/app/ApiAttributesTest/config.yml +++ b/Tests/Functional/app/ApiAttributesTest/config.yml @@ -5,6 +5,4 @@ framework: serializer: enabled: true validation: true - property_info: - enabled: true - with_constructor_extractor: true + property_info: { enabled: true } diff --git a/Tests/Functional/app/ContainerDump/config.yml b/Tests/Functional/app/ContainerDump/config.yml index 48bff3240..3efa5f950 100644 --- a/Tests/Functional/app/ContainerDump/config.yml +++ b/Tests/Functional/app/ContainerDump/config.yml @@ -15,8 +15,6 @@ framework: translator: true validation: true serializer: true - property_info: - enabled: true - with_constructor_extractor: true + property_info: true csrf_protection: true form: true diff --git a/Tests/Functional/app/Serializer/config.yml b/Tests/Functional/app/Serializer/config.yml index 3c0c35417..2f20dab9e 100644 --- a/Tests/Functional/app/Serializer/config.yml +++ b/Tests/Functional/app/Serializer/config.yml @@ -10,9 +10,7 @@ framework: max_depth_handler: Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serializer\MaxDepthHandler default_context: enable_max_depth: true - property_info: - enabled: true - with_constructor_extractor: true + property_info: { enabled: true } services: serializer.alias: diff --git a/Tests/Functional/app/TypeInfo/Dummy.php b/Tests/Functional/app/TypeInfo/Dummy.php index 0f517df51..b91635ad8 100644 --- a/Tests/Functional/app/TypeInfo/Dummy.php +++ b/Tests/Functional/app/TypeInfo/Dummy.php @@ -18,4 +18,9 @@ class Dummy { public string $name; + + /** + * @var CustomAlias + */ + public mixed $customAlias; } diff --git a/Tests/Functional/app/TypeInfo/config.yml b/Tests/Functional/app/TypeInfo/config.yml index 35c7bb4c4..925f10724 100644 --- a/Tests/Functional/app/TypeInfo/config.yml +++ b/Tests/Functional/app/TypeInfo/config.yml @@ -3,7 +3,9 @@ imports: framework: http_method_override: false - type_info: true + type_info: + aliases: + CustomAlias: int services: type_info.resolver.alias: diff --git a/Tests/Functional/app/config/framework.yml b/Tests/Functional/app/config/framework.yml index ac051614b..7c0a1b2bc 100644 --- a/Tests/Functional/app/config/framework.yml +++ b/Tests/Functional/app/config/framework.yml @@ -1,10 +1,7 @@ framework: - annotations: false - http_method_override: false - handle_all_throwables: true secret: test - router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml", utf8: true } - validation: { enabled: true, enable_attributes: true, email_validation_mode: html5 } + router: { resource: "%kernel.project_dir%/%kernel.test_case%/routing.yml" } + validation: { enabled: true, enable_attributes: true } csrf_protection: true form: enabled: true @@ -16,8 +13,6 @@ framework: storage_factory_id: session.storage.factory.mock_file cookie_secure: auto cookie_samesite: lax - php_errors: - log: true profiler: collect_serializer_data: true diff --git a/Tests/Functional/app/templates/fragment.html.twig b/Tests/Functional/app/templates/fragment.html.twig index 6576e325a..0cac31dcf 100644 --- a/Tests/Functional/app/templates/fragment.html.twig +++ b/Tests/Functional/app/templates/fragment.html.twig @@ -1,7 +1,7 @@ -{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::inlinedAction', {'options': {'bar': bar, 'eleven': 11}})) }} +{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::inlinedAction', {options: {bar: bar, eleven: 11}})) }} -- -{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::customformatAction', {'_format': 'html'})) }} +{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::customformatAction', {_format: 'html'})) }} -- -{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::customlocaleAction', {'_locale': 'es'})) }} +{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::customlocaleAction', {_locale: 'es'})) }} -- {{ app.request.setLocale('fr') }}{{ render(controller('Symfony\\Bundle\\FrameworkBundle\\Tests\\Functional\\Bundle\\TestBundle\\Controller\\FragmentController::forwardlocaleAction')) -}} diff --git a/Tests/Kernel/ConcreteMicroKernel.php b/Tests/Kernel/ConcreteMicroKernel.php index eac061e3b..a084e21c7 100644 --- a/Tests/Kernel/ConcreteMicroKernel.php +++ b/Tests/Kernel/ConcreteMicroKernel.php @@ -75,12 +75,7 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load { $c->register('logger', NullLogger::class); $c->loadFromExtension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], 'secret' => '$ecret', - 'router' => ['utf8' => true], ]); $c->setParameter('halloween', 'Have a great day!'); diff --git a/Tests/Kernel/MicroKernelTraitTest.php b/Tests/Kernel/MicroKernelTraitTest.php index 159dd21eb..f936e2c5a 100644 --- a/Tests/Kernel/MicroKernelTraitTest.php +++ b/Tests/Kernel/MicroKernelTraitTest.php @@ -122,13 +122,7 @@ public function helloAction(): Response protected function configureContainer(ContainerConfigurator $c): void { - $c->extension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'router' => ['utf8' => true], - ]); + $c->extension('framework', []); $c->services()->set('logger', NullLogger::class); } diff --git a/Tests/Kernel/flex-style/src/FlexStyleMicroKernel.php b/Tests/Kernel/flex-style/src/FlexStyleMicroKernel.php index 5fa641c7f..a6af4b52e 100644 --- a/Tests/Kernel/flex-style/src/FlexStyleMicroKernel.php +++ b/Tests/Kernel/flex-style/src/FlexStyleMicroKernel.php @@ -100,12 +100,6 @@ protected function configureContainer(ContainerConfigurator $c): void ->factory([$this, 'createHalloween']) ->arg('$halloween', '%halloween%'); - $c->extension('framework', [ - 'annotations' => false, - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'php_errors' => ['log' => true], - 'router' => ['utf8' => true], - ]); + $c->extension('framework', []); } } diff --git a/Tests/Routing/AttributeRouteControllerLoaderTest.php b/Tests/Routing/AttributeRouteControllerLoaderTest.php new file mode 100644 index 000000000..3f879f78e --- /dev/null +++ b/Tests/Routing/AttributeRouteControllerLoaderTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Tests\Routing; + +use PHPUnit\Framework\TestCase; +use Symfony\Bundle\FrameworkBundle\Routing\AttributeRouteControllerLoader; +use Symfony\Bundle\FrameworkBundle\Tests\Routing\Fixtures\InvokableController; +use Symfony\Bundle\FrameworkBundle\Tests\Routing\Fixtures\MethodActionControllers; + +class AttributeRouteControllerLoaderTest extends TestCase +{ + public function testConfigureRouteSetsControllerForInvokable() + { + $loader = new AttributeRouteControllerLoader(); + $collection = $loader->load(InvokableController::class); + + $route = $collection->get('lol'); + $this->assertSame(InvokableController::class, $route->getDefault('_controller')); + } + + public function testConfigureRouteSetsControllerForMethod() + { + $loader = new AttributeRouteControllerLoader(); + $collection = $loader->load(MethodActionControllers::class); + + $put = $collection->get('put'); + $post = $collection->get('post'); + + $this->assertSame(MethodActionControllers::class.'::put', $put->getDefault('_controller')); + $this->assertSame(MethodActionControllers::class.'::post', $post->getDefault('_controller')); + } +} diff --git a/Tests/Routing/Fixtures/InvokableController.php b/Tests/Routing/Fixtures/InvokableController.php new file mode 100644 index 000000000..d9276f09a --- /dev/null +++ b/Tests/Routing/Fixtures/InvokableController.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Tests\Routing\Fixtures; + +use Symfony\Component\Routing\Attribute\Route; + +#[Route(path: '/here', name: 'lol', methods: ['GET', 'POST'], schemes: ['https'])] +class InvokableController +{ + public function __invoke() + { + } +} diff --git a/Tests/Routing/Fixtures/MethodActionControllers.php b/Tests/Routing/Fixtures/MethodActionControllers.php new file mode 100644 index 000000000..f0adec88a --- /dev/null +++ b/Tests/Routing/Fixtures/MethodActionControllers.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Tests\Routing\Fixtures; + +use Symfony\Component\Routing\Attribute\Route; + +#[Route('/the/path')] +class MethodActionControllers +{ + #[Route(name: 'post', methods: ['POST'])] + public function post() + { + } + + #[Route(name: 'put', methods: ['PUT'], priority: 10)] + public function put() + { + } +} diff --git a/Tests/Routing/RouterTest.php b/Tests/Routing/RouterTest.php index d2c021563..f46522a97 100644 --- a/Tests/Routing/RouterTest.php +++ b/Tests/Routing/RouterTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Routing; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Symfony\Bundle\FrameworkBundle\Routing\Router; @@ -438,9 +439,7 @@ public function testExceptionOnNonStringParameterWithSfContainer() $router->getRouteCollection(); } - /** - * @dataProvider getNonStringValues - */ + #[DataProvider('getNonStringValues')] public function testDefaultValuesAsNonStrings($value) { $routes = new RouteCollection(); @@ -455,9 +454,7 @@ public function testDefaultValuesAsNonStrings($value) $this->assertSame($value, $route->getDefault('foo')); } - /** - * @dataProvider getNonStringValues - */ + #[DataProvider('getNonStringValues')] public function testDefaultValuesAsNonStringsWithSfContainer($value) { $routes = new RouteCollection(); @@ -525,9 +522,7 @@ public static function getNonStringValues() return [[null], [false], [true], [new \stdClass()], [['foo', 'bar']], [[[]]]]; } - /** - * @dataProvider getContainerParameterForRoute - */ + #[DataProvider('getContainerParameterForRoute')] public function testCacheValidityWithContainerParameters($parameter) { $cacheDir = tempnam(sys_get_temp_dir(), 'sf_router_'); diff --git a/Tests/Secrets/SodiumVaultTest.php b/Tests/Secrets/SodiumVaultTest.php index f91f4bced..6d050386b 100644 --- a/Tests/Secrets/SodiumVaultTest.php +++ b/Tests/Secrets/SodiumVaultTest.php @@ -11,14 +11,13 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Secrets; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Secrets\SodiumVault; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\String\LazyString; -/** - * @requires extension sodium - */ +#[RequiresPhpExtension('sodium')] class SodiumVaultTest extends TestCase { private string $secretsDir; diff --git a/Tests/Test/WebTestCaseTest.php b/Tests/Test/WebTestCaseTest.php index 84f2ef0ef..a058d3628 100644 --- a/Tests/Test/WebTestCaseTest.php +++ b/Tests/Test/WebTestCaseTest.php @@ -12,13 +12,16 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Test; use PHPUnit\Framework\AssertionFailedError; +use PHPUnit\Framework\Attributes\RequiresMethod; use PHPUnit\Framework\ExpectationFailedException; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Bundle\FrameworkBundle\Test\WebTestAssertionsTrait; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\BrowserKit\Cookie; use Symfony\Component\BrowserKit\CookieJar; +use Symfony\Component\BrowserKit\History; use Symfony\Component\DomCrawler\Crawler; use Symfony\Component\HttpFoundation\Cookie as HttpFoundationCookie; use Symfony\Component\HttpFoundation\Request; @@ -190,6 +193,42 @@ public function testAssertBrowserCookieValueSame() $this->getClientTester()->assertBrowserCookieValueSame('foo', 'babar', false, '/path'); } + #[RequiresMethod(History::class, 'isFirstPage')] + public function testAssertBrowserHistoryIsOnFirstPage() + { + $this->createHistoryTester('isFirstPage', true)->assertBrowserHistoryIsOnFirstPage(); + $this->expectException(AssertionFailedError::class); + $this->expectExceptionMessage('Failed asserting that the Browser history is on the first page.'); + $this->createHistoryTester('isFirstPage', false)->assertBrowserHistoryIsOnFirstPage(); + } + + #[RequiresMethod(History::class, 'isFirstPage')] + public function testAssertBrowserHistoryIsNotOnFirstPage() + { + $this->createHistoryTester('isFirstPage', false)->assertBrowserHistoryIsNotOnFirstPage(); + $this->expectException(AssertionFailedError::class); + $this->expectExceptionMessage('Failed asserting that the Browser history is not on the first page.'); + $this->createHistoryTester('isFirstPage', true)->assertBrowserHistoryIsNotOnFirstPage(); + } + + #[RequiresMethod(History::class, 'isLastPage')] + public function testAssertBrowserHistoryIsOnLastPage() + { + $this->createHistoryTester('isLastPage', true)->assertBrowserHistoryIsOnLastPage(); + $this->expectException(AssertionFailedError::class); + $this->expectExceptionMessage('Failed asserting that the Browser history is on the last page.'); + $this->createHistoryTester('isLastPage', false)->assertBrowserHistoryIsOnLastPage(); + } + + #[RequiresMethod(History::class, 'isLastPage')] + public function testAssertBrowserHistoryIsNotOnLastPage() + { + $this->createHistoryTester('isLastPage', false)->assertBrowserHistoryIsNotOnLastPage(); + $this->expectException(AssertionFailedError::class); + $this->expectExceptionMessage('Failed asserting that the Browser history is not on the last page.'); + $this->createHistoryTester('isLastPage', true)->assertBrowserHistoryIsNotOnLastPage(); + } + public function testAssertSelectorExists() { $this->getCrawlerTester(new Crawler('

'))->assertSelectorExists('body > h1'); @@ -386,6 +425,19 @@ private function getRequestTester(): WebTestCase return $this->getTester($client); } + private function createHistoryTester(string $method, bool $returnValue): WebTestCase + { + /** @var KernelBrowser&MockObject $client */ + $client = $this->createMock(KernelBrowser::class); + /** @var History&MockObject $history */ + $history = $this->createMock(History::class); + + $history->method($method)->willReturn($returnValue); + $client->method('getHistory')->willReturn($history); + + return $this->getTester($client); + } + private function getTester(KernelBrowser $client): WebTestCase { $tester = new class(method_exists($this, 'name') ? $this->name() : $this->getName()) extends WebTestCase { diff --git a/Tests/Translation/TranslatorTest.php b/Tests/Translation/TranslatorTest.php index e481a965e..d5f5d88eb 100644 --- a/Tests/Translation/TranslatorTest.php +++ b/Tests/Translation/TranslatorTest.php @@ -11,6 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Translation; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Translation\Translator; use Symfony\Component\Config\Resource\DirectoryResource; @@ -130,7 +131,7 @@ public function testInvalidOptions() new Translator(new Container(), new MessageFormatter(), 'en', [], ['foo' => 'bar']); } - /** @dataProvider getDebugModeAndCacheDirCombinations */ + #[DataProvider('getDebugModeAndCacheDirCombinations')] public function testResourceFilesOptionLoadsBeforeOtherAddedResources($debug, $enableCache) { $someCatalogue = $this->getCatalogue('some_locale', []); diff --git a/Translation/Translator.php b/Translation/Translator.php index 84aa0c7fd..b595266a9 100644 --- a/Translation/Translator.php +++ b/Translation/Translator.php @@ -21,10 +21,8 @@ /** * @author Fabien Potencier - * - * @final since Symfony 7.1 */ -class Translator extends BaseTranslator implements WarmableInterface +final class Translator extends BaseTranslator implements WarmableInterface { protected array $options = [ 'cache_dir' => null, diff --git a/composer.json b/composer.json index a00bac1c3..bb053e248 100644 --- a/composer.json +++ b/composer.json @@ -16,100 +16,79 @@ } ], "require": { - "php": ">=8.2", + "php": ">=8.4", "composer-runtime-api": ">=2.1", "ext-xml": "*", - "symfony/cache": "^6.4|^7.0", - "symfony/config": "^7.3", - "symfony/dependency-injection": "^7.2", + "symfony/cache": "^7.4|^8.0", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/error-handler": "^7.3", - "symfony/event-dispatcher": "^6.4|^7.0", - "symfony/http-foundation": "^7.3", - "symfony/http-kernel": "^7.2", - "symfony/polyfill-mbstring": "~1.0", - "symfony/filesystem": "^7.1", - "symfony/finder": "^6.4|^7.0", - "symfony/routing": "^6.4|^7.0" + "symfony/error-handler": "^7.4|^8.0", + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/filesystem": "^7.4|^8.0", + "symfony/finder": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php85": "^1.32", + "symfony/routing": "^7.4|^8.0" }, "require-dev": { "doctrine/persistence": "^1.3|^2|^3", "dragonmantank/cron-expression": "^3.1", - "seld/jsonlint": "^1.10", - "symfony/asset": "^6.4|^7.0", - "symfony/asset-mapper": "^6.4|^7.0", - "symfony/browser-kit": "^6.4|^7.0", - "symfony/console": "^6.4|^7.0", - "symfony/clock": "^6.4|^7.0", - "symfony/css-selector": "^6.4|^7.0", - "symfony/dom-crawler": "^6.4|^7.0", - "symfony/dotenv": "^6.4|^7.0", - "symfony/polyfill-intl-icu": "~1.0", - "symfony/form": "^6.4|^7.0", - "symfony/expression-language": "^6.4|^7.0", - "symfony/html-sanitizer": "^6.4|^7.0", - "symfony/http-client": "^6.4|^7.0", - "symfony/lock": "^6.4|^7.0", - "symfony/mailer": "^6.4|^7.0", - "symfony/messenger": "^6.4|^7.0", - "symfony/mime": "^6.4|^7.0", - "symfony/notifier": "^6.4|^7.0", - "symfony/object-mapper": "^v7.3.0-beta2", - "symfony/process": "^6.4|^7.0", - "symfony/rate-limiter": "^6.4|^7.0", - "symfony/scheduler": "^6.4.4|^7.0.4", - "symfony/security-bundle": "^6.4|^7.0", - "symfony/semaphore": "^6.4|^7.0", - "symfony/serializer": "^7.2.5", - "symfony/stopwatch": "^6.4|^7.0", - "symfony/string": "^6.4|^7.0", - "symfony/translation": "^7.3", - "symfony/twig-bundle": "^6.4|^7.0", - "symfony/type-info": "^7.1.8", - "symfony/validator": "^6.4|^7.0", - "symfony/workflow": "^7.3", - "symfony/yaml": "^6.4|^7.0", - "symfony/property-info": "^6.4|^7.0", - "symfony/json-streamer": "7.3.*", - "symfony/uid": "^6.4|^7.0", - "symfony/web-link": "^6.4|^7.0", - "symfony/webhook": "^7.2", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", - "twig/twig": "^3.12" + "seld/jsonlint": "^1.10", + "symfony/asset": "^7.4|^8.0", + "symfony/asset-mapper": "^7.4|^8.0", + "symfony/browser-kit": "^7.4|^8.0", + "symfony/clock": "^7.4|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/css-selector": "^7.4|^8.0", + "symfony/dom-crawler": "^7.4|^8.0", + "symfony/dotenv": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/form": "^7.4|^8.0", + "symfony/html-sanitizer": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/json-streamer": "^7.4|^8.0", + "symfony/lock": "^7.4|^8.0", + "symfony/mailer": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/notifier": "^7.4|^8.0", + "symfony/object-mapper": "^7.4|^8.0", + "symfony/polyfill-intl-icu": "^1.0", + "symfony/process": "^7.4|^8.0", + "symfony/property-info": "^7.4|^8.0", + "symfony/rate-limiter": "^7.4|^8.0", + "symfony/runtime": "^7.4|^8.0", + "symfony/scheduler": "^7.4|^8.0", + "symfony/security-bundle": "^7.4|^8.0", + "symfony/semaphore": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/stopwatch": "^7.4|^8.0", + "symfony/string": "^7.4|^8.0", + "symfony/translation": "^7.4|^8.0", + "symfony/twig-bundle": "^7.4|^8.0", + "symfony/type-info": "^7.4|^8.0", + "symfony/uid": "^7.4|^8.0", + "symfony/validator": "^7.4|^8.0", + "symfony/workflow": "^7.4|^8.0", + "symfony/web-link": "^7.4|^8.0", + "symfony/webhook": "^7.4|^8.0", + "symfony/yaml": "^7.4|^8.0" }, "conflict": { "doctrine/persistence": "<1.3", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", - "symfony/asset": "<6.4", - "symfony/asset-mapper": "<6.4", - "symfony/clock": "<6.4", - "symfony/console": "<6.4", - "symfony/dotenv": "<6.4", - "symfony/dom-crawler": "<6.4", - "symfony/http-client": "<6.4", - "symfony/form": "<6.4", - "symfony/json-streamer": ">=7.4", - "symfony/lock": "<6.4", - "symfony/mailer": "<6.4", - "symfony/messenger": "<6.4", - "symfony/mime": "<6.4", - "symfony/object-mapper": ">=7.4", - "symfony/property-info": "<6.4", - "symfony/property-access": "<6.4", - "symfony/runtime": "<6.4.13|>=7.0,<7.1.6", - "symfony/scheduler": "<6.4.4|>=7.0.0,<7.0.4", - "symfony/security-csrf": "<7.2", - "symfony/security-core": "<6.4", - "symfony/serializer": "<7.2.5", - "symfony/stopwatch": "<6.4", - "symfony/translation": "<7.3", - "symfony/twig-bridge": "<6.4", - "symfony/twig-bundle": "<6.4", - "symfony/validator": "<6.4", - "symfony/web-profiler-bundle": "<6.4", - "symfony/webhook": "<7.2", - "symfony/workflow": "<7.3.0-beta2" + "symfony/console": "<7.4", + "symfony/security-csrf": "<7.4", + "symfony/serializer": "<7.4", + "symfony/messenger": "<7.4", + "symfony/translation": "<7.4", + "symfony/webhook": "<7.4", + "symfony/workflow": "<7.4" }, "autoload": { "psr-4": { "Symfony\\Bundle\\FrameworkBundle\\": "" }, @@ -117,5 +96,10 @@ "/Tests/" ] }, - "minimum-stability": "dev" + "minimum-stability": "dev", + "config": { + "allow-plugins": { + "symfony/runtime": false + } + } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d00ee0f1e..90e1a751e 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,10 +1,11 @@ @@ -20,7 +21,7 @@ - + ./ @@ -29,5 +30,9 @@ ./Tests ./vendor - + + + + +