- The request method is dropped from POST to GET when the response status code is 301.
- The component is deprecated and will be removed in 4.0. Use Composer instead.
-
Input::getOption()no longer returns the default value for options with value optional explicitly passed empty.For:
protected function configure() { $this // ... ->setName('command') ->addOption('foo', null, InputOption::VALUE_OPTIONAL, '', 'default') ; } protected function execute(InputInterface $input, OutputInterface $output) { var_dump($input->getOption('foo')); }
Before:
$ php console.php command "default" $ php console.php command --foo "default" $ php console.php command --foo "" "default" $ php console.php command --foo= "default"
After:
$ php console.php command "default" $ php console.php command --foo NULL $ php console.php command --foo "" "" $ php console.php command --foo= ""
-
The
console.exceptionevent and the relatedConsoleExceptionEventclass have been deprecated in favor of theconsole.errorevent and theConsoleErrorEventclass. The deprecated event and class will be removed in 4.0. -
The
SymfonyQuestionHelper::askdefault validation has been deprecated and will be removed in 4.0. Apply validation usingQuestion::setValidatorinstead.
- The
ContextErrorExceptionclass is deprecated.\ErrorExceptionwill be used instead in 4.0.
-
Autowiring services based on the types they implement is deprecated and won't be supported in version 4.0. Rename (or alias) your services to their FQCN id to make them autowirable.
-
[BC BREAK] The
NullDumperclass has been made final -
[BC BREAK]
_defaultsand_instanceofare now reserved service names in Yaml configurations. Please rename any services with that names. -
[BC BREAK] non-numeric keys in methods and constructors arguments have never been supported and are now forbidden. Please remove them if you happen to have one.
-
Service names that start with an underscore are deprecated in Yaml files and will be reserved in 4.0. Please rename any services with such names.
-
Autowiring-types have been deprecated, use aliases instead.
Before:
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false"> <autowiring-type>Doctrine\Common\Annotations\Reader</autowiring-type> </service>
After:
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false" /> <service id="Doctrine\Common\Annotations\Reader" alias="annotations.reader" public="false" />
-
The
ReferenceandAliasclasses do not make service identifiers lowercase anymore. -
Case insensitivity of service identifiers is deprecated and will be removed in 4.0.
-
Using the
PhpDumperwith an uncompiledContainerBuilderis deprecated and will not be supported anymore in 4.0. -
Extending the containers generated by
PhpDumperis deprecated and won't be supported in 4.0. -
The
DefinitionDecoratorclass is deprecated and will be removed in 4.0, use theChildDefinitionclass instead. -
The
strictattribute in service arguments has been deprecated and will be removed in 4.0. The attribute is ignored since 3.0, so you can simply remove it.
- The
ContainerAwareEventDispatcherclass has been deprecated. UseEventDispatcherwith closure factories instead.
- The
ExceptionInterfacehas been deprecated and will be removed in 4.0.
-
Using the "choices" option in
CountryType,CurrencyType,LanguageType,LocaleType, andTimezoneTypewithout overriding thechoice_loaderoption has been deprecated and will be ignored in 4.0.Before:
$builder->add('custom_locales', LocaleType::class, array( 'choices' => $availableLocales, ));
After:
$builder->add('custom_locales', LocaleType::class, array( 'choices' => $availableLocales, 'choice_loader' => null, )); // or $builder->add('custom_locales', LocaleType::class, array( 'choice_loader' => new CallbackChoiceLoader(function () { return $this->getAvailableLocales(); }), ));
-
[BC BREAK] The "framework.trusted_proxies" configuration option and the corresponding "kernel.trusted_proxies" parameter have been removed. Use the Request::setTrustedProxies() method in your front controller instead.
-
Not defining the
typeoption of theframework.workflows.*configuration entries is deprecated. The default value will bestate_machinein Symfony 4.0. -
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CompilerDebugDumpPasshas been deprecated. -
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPasshas been deprecated. UseSymfony\Component\Console\DependencyInjection\AddConsoleCommandPassinstead. -
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPassclass has been deprecated and will be removed in 4.0. Use theSymfony\Component\Serializer\DependencyInjection\SerializerPassclass instead. -
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\FormPassclass has been deprecated and will be removed in 4.0. Use theSymfony\Component\Form\DependencyInjection\FormPassclass instead. -
The
Symfony\Bundle\FrameworkBundle\EventListener\SessionListenerclass has been deprecated and will be removed in 4.0. Use theSymfony\Component\HttpKernel\EventListener\SessionListenerclass instead. -
The
Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListenerclass has been deprecated and will be removed in 4.0. Use theSymfony\Component\HttpKernel\EventListener\TestSessionListenerclass instead. -
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ConfigCachePassclass has been deprecated and will be removed in 4.0. UseSymfony\Component\Config\DependencyInjection\ConfigCachePassclass instead. -
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\PropertyInfoPassclass has been deprecated and will be removed in 4.0. Use theSymfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPassclass instead. -
Class parameters related to routing have been deprecated and will be removed in 4.0.
- router.options.generator_class
- router.options.generator_base_class
- router.options.generator_dumper_class
- router.options.matcher_class
- router.options.matcher_base_class
- router.options.matcher_dumper_class
- router.options.matcher.cache_class
- router.options.generator.cache_class
-
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ControllerArgumentValueResolverPassclass has been deprecated and will be removed in 4.0. Use theSymfony\Component\HttpKernel\DependencyInjection\ControllerArgumentValueResolverPassclass instead. -
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\RoutingResolverPassclass has been deprecated and will be removed in 4.0. Use theSymfony\Component\Routing\DependencyInjection\RoutingResolverPassclass instead. -
The
server:run,server:start,server:stopandserver:statusconsole commands have been moved to a dedicated bundle. Requiresymfony/web-server-bundlein your composer.json and registerSymfony\Bundle\WebServerBundle\WebServerBundlein your AppKernel to use them. -
The
Symfony\Bundle\FrameworkBundle\Translation\Translatorconstructor now takes the default locale as 3rd argument. Not passing it will trigger an error in 4.0. -
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddValidatorInitializersPassclass has been deprecated and will be removed in 4.0. Use theSymfony\Component\Validator\DependencyInjection\AddValidatorInitializersPassclass instead. -
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConstraintValidatorsPassclass has been deprecated and will be removed in 4.0. Use theSymfony\Component\Validator\DependencyInjection\AddConstraintValidatorsPassclass instead. -
The
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ValidateWorkflowsPassclass has been deprecated and will be removed in 4.0. Use theSymfony\Component\Workflow\DependencyInjection\ValidateWorkflowsPassclass instead. -
The
Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactoryclass has been deprecated and will be removed in 4.0. UseSymfony\Component\Validator\ContainerConstraintValidatorFactoryinstead.
-
[BC BREAK] The
Request::setTrustedProxies()method takes a new$trustedHeaderSetargument. See http://symfony.com/doc/current/components/http_foundation/trusting_proxies.html for more info. -
The
Request::setTrustedHeaderName()andRequest::getTrustedHeaderName()methods are deprecated, use the RFC7239Forwardedheader, or theX-Forwarded-*headers instead.
-
Deprecated the
kernel.root_dirparameter. Use the newkernel.project_dirparameter instead. -
Deprecated the
Kernel::getRootDir()method. Use the newKernel::getProjectDir()method instead. -
The
Extension::addClassesToCompile()andExtension::getClassesToCompile()methods have been deprecated and will be removed in 4.0. -
The
Psr6CacheClearer::addPool()method has been deprecated. Pass an array of pools indexed by name to the constructor instead. -
The
LazyLoadingFragmentHandler::addRendererService()method has been deprecated and will be removed in 4.0. -
The
X-Status-Codeheader method of setting a custom status code in the response when handling exceptions has been removed. There is now a newGetResponseForExceptionEvent::allowCustomResponseCode()method instead, which will tell the Kernel to use the response code set on the event's response object. -
The
Kernel::getEnvParameters()method has been deprecated and will be removed in 4.0. -
The
SYMFONY__environment variables have been deprecated and they will be no longer processed automatically by Symfony in 4.0. Use the%env()%syntax to get the value of any environment variable from configuration files instead.
-
The
ProcessUtils::escapeArgument()method has been deprecated, use a command line array or give env vars to theProcess::start/run()method instead. -
Not inheriting environment variables is deprecated.
-
Configuring
proc_open()options is deprecated. -
Configuring Windows and sigchild compatibility is deprecated - they will be always enabled in 4.0.
-
Extending
Process::run(),Process::mustRun()andProcess::restart()is deprecated and won't be supported in 4.0.
- [BC BREAK] The
ProxyDumperclass has been made final
-
The
RoleInterfacehas been deprecated. Extend theSymfony\Component\Security\Core\Role\Roleclass in your custom role implementations instead. -
The
LogoutUrlGenerator::registerListener()method will expect a 6thstring $context = nullargument in 4.0. Define the argument when overriding this method. -
The
AccessDecisionManager::setVoters()method has been deprecated. Pass the voters to the constructor instead.
-
The
FirewallContext::getContext()method has been deprecated and will be removed in 4.0. Use thegetListeners()and/orgetExceptionListener()method instead. -
The
FirewallMap::$mapand$containerproperties have been deprecated and will be removed in 4.0. -
The
UserPasswordEncoderCommandcommand expects to be registered as a service and its constructor arguments fully provided. Registering by convention the command or commands extending it is deprecated and will not be allowed anymore in 4.0. -
UserPasswordEncoderCommand::getContainer()is deprecated, and this class won't extendContainerAwareCommandnor implementContainerAwareInterfaceanymore in 4.0. -
[BC BREAK] Keys of the
usersnode forin_memoryuser provider are no longer normalized.
- Extending
ChainDecoder,ChainEncoder,ArrayDenormalizeris deprecated and won't be supported in 4.0.
- The
TwigRendererEngine::setEnvironment()method has been deprecated and will be removed in 4.0. Pass the Twig Environment as second argument of the constructor instead.
- The
ContainerAwareRuntimeLoaderclass has been deprecated and will be removed in 4.0. Use the TwigTwig_ContainerRuntimeLoaderclass instead.
- Deprecated class name support in
WorkflowRegistry::add()as second parameter. Wrap the class name in an instance of ClassInstanceSupportStrategy instead.
-
Starting an unquoted string with a question mark followed by a space is deprecated and will throw a
ParseExceptionin Symfony 4.0. -
Deprecated support for implicitly parsing non-string mapping keys as strings. Mapping keys that are no strings will lead to a
ParseExceptionin Symfony 4.0. Use quotes to opt-in for keys to be parsed as strings.Before:
$yaml = <<<YAML null: null key true: boolean true 2.0: float key YAML; Yaml::parse($yaml);
After:
$yaml = <<<YAML "null": null key "true": boolean true "2.0": float key YAML; Yaml::parse($yaml);
-
Omitting the key of a mapping is deprecated and will throw a
ParseExceptionin Symfony 4.0. -
The constructor arguments
$offset,$totalNumberOfLinesand$skippedLineNumbersof theParserclass are deprecated and will be removed in 4.0