- Renamed
ClienttoAbstractBrowser - Marked
Responsefinal. - Deprecated
Response::buildHeader() - Deprecated
Response::getStatus(), useResponse::getStatusCode()instead
- The
psr/simple-cachedependency has been removed - runcomposer require psr/simple-cacheif you need it. - Deprecated all PSR-16 adapters, use
Psr16CacheorSymfony\Contracts\Cache\CacheInterfaceimplementations instead. - Deprecated
SimpleCacheAdapter, usePsr16Adapterinstead.
- Deprecated using environment variables with
cannotBeEmpty()if the value is validated withvalidate()
- The signature of the
EventDispatcherInterface::dispatch()method should be updated todispatch($event, string $eventName = null), not doing so is deprecated
- Using the
formatoption ofDateTypeandDateTimeTypewhen thehtml5option is enabled is deprecated. - Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated and will lead to an exception in 5.0.
- Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons is deprecated and will lead to an exception in 5.0.
- Using the
date_format,date_widget, andtime_widgetoptions of theDateTimeTypewhen thewidgetoption is set tosingle_textis deprecated.
- Not passing the project directory to the constructor of the
AssetsInstallCommandis deprecated. This argument will be mandatory in 5.0. - Deprecated the "Psr\SimpleCache\CacheInterface" / "cache.app.simple" service, use "Symfony\Contracts\Cache\CacheInterface" / "cache.app" instead.
- The
generate()method of theUrlGeneratorclass can return an empty string instead of null.
- The
MimeTypeGuesserInterfaceandExtensionGuesserInterfaceinterfaces have been deprecated, useSymfony\Component\Mime\MimeTypesInterfaceinstead. - The
MimeTypeandMimeTypeExtensionGuesserclasses have been deprecated, useSymfony\Component\Mime\MimeTypesinstead. - The
FileBinaryMimeTypeGuesserclass has been deprecated, useSymfony\Component\Mime\FileBinaryMimeTypeGuesserinstead. - The
FileinfoMimeTypeGuesserclass has been deprecated, useSymfony\Component\Mime\FileinfoMimeTypeGuesserinstead.
- Renamed
ClienttoHttpKernelBrowser - Renamed
FilterControllerArgumentsEventtoControllerArgumentsEvent - Renamed
FilterControllerEventtoControllerEvent - Renamed
FilterResponseEventtoResponseEvent - Renamed
GetResponseEventtoRequestEvent - Renamed
GetResponseForControllerResultEventtoViewEvent - Renamed
GetResponseForExceptionEventtoExceptionEvent - Renamed
PostResponseEventtoTerminateEvent
Amqptransport does not throw\AMQPExceptionanymore, catchTransportExceptioninstead.- Deprecated the
LoggingMiddlewareclass, pass a logger toSendMessageMiddlewareinstead.
- The
generator_base_class,generator_cache_class,matcher_base_class, andmatcher_cache_classrouter options have been deprecated. - Implementing
SerializableforRouteandCompiledRouteis deprecated; if you serialize them, please ensure your unserialization logic can recover from a failure related to an updated serialization format
-
The
RoleandSwitchUserRoleclasses are deprecated and will be removed in 5.0. Use strings for roles instead. -
The
RoleHierarchyInterfaceis deprecated and will be removed in 5.0. -
The
getReachableRoles()method of theRoleHierarchyclass is deprecated and will be removed in 5.0. Use thegetReachableRoleNames()method instead. -
The
getRoles()method of theTokenInterfaceis deprecated. Tokens must implement thegetRoleNames()method instead and return roles as strings. -
The
ListenerInterfaceis deprecated, turn your listeners into callables instead. -
The
Firewall::handleRequest()method is deprecated, useFirewall::callListeners()instead. -
The
AbstractToken::serialize(),AbstractToken::unserialize(),AuthenticationException::serialize()andAuthenticationException::unserialize()methods are now final, usegetState()andsetState()instead.Before:
public function serialize() { return [$this->myLocalVar, parent::serialize()]; } public function unserialize($serialized) { [$this->myLocalVar, $parentSerialized] = unserialize($serialized); parent::unserialize($parentSerialized); }
After:
protected function getState(): array { return [$this->myLocalVar, parent::getState()]; } protected function setState(array $data) { [$this->myLocalVar, $parentData] = $data; parent::setState($parentData); }
- Using a mapping inside a multi-line string is deprecated and will throw a
ParseExceptionin 5.0.
-
MarkingStoreInterface::setMarking()will have a third argument in Symfony 5.0.Before:
class MyMarkingStore implements MarkingStoreInterface { public function setMarking($subject, Marking $marking) { } }
After:
class MyMarkingStore implements MarkingStoreInterface { public function setMarking($subject, Marking $marking , array $context = []) { } }