This release is mainly a Symfony 8.0 update with a mix of new DX features and a long list of framework and component fixes. It also raises the minimum PHP requirement for Symfony 8 to PHP 8.4.
What's new
UrlGenerator::generate()now accepts a special_querykey for query-string parameters. This lets you pass query parameters separately from route parameters when names would otherwise collide, such as generating/admin/stats?siteCode=uswhile still filling the route placeholder with a different value (#60508).- Console commands get better support for invokable command classes. Standalone commands can now be added directly to an
Application,CommandTesterunderstands them, and#[AsCommand]can carry usage examples without forcing you to implementconfigure()just for that (#60394, #60823, #60767). VarDumpercan now accept more default casters throughAbstractCloner::addDefaultCasters(), making it easier to extend dump output in a supported way (#60480).MailerAssertionsTraitgainsassertEmailAddressNotContains(), a negative assertion that complements the existing email content helpers (#60740).ClockMocknow includesstrtotime(), so date-dependent tests can mock that function too (#60424).FrameworkBundleadds aControllerHelperservice that exposes the helpers fromAbstractControllerwithout requiring inheritance.#[Target]also gets better support for custom services without the extra suffix in the target name (#60857, #60874).- Symfony 8 now requires PHP 8.4 or newer (#60639).
Breaking changes
- Symfony 8 drops support for PHP versions below 8.4. Upgrade your runtime before moving to this tag (#60639).
- Callable firewall listeners are now deprecated and should be replaced with
FirewallListenerInterfaceimplementations (#60614). - Several deprecated APIs were removed in Symfony 8, including
Application::add(),#[TaggedIterator]/#[TaggedLocator],ContainerBuilder::getAutoconfiguredAttributes(),AdvancedNameConverterInterface, andImportMapConfigReader::splitPackageNameAndFilePath()(#60776, #60845, #60844, #60870, #60878). Routingnow throws when_queryis not an array, so query parameters must be passed as an array value (#60863).Formchanges the default protocol forUrlTypetonull(#60922).
Fixes
- Fixes several
DependencyInjectionissues around tagged iterators/locators, inline services, and service locator indexes (#63812, #63823, #60691, #60826). - Fixes
Serializeredge cases around nested arrays, mixed-typed constructor parameters,can*()support, discriminator handling, promotedselftypes, andTraceableSerializerinarray_map()callables (#63817, #63782, #63787, #60511, #60627, #60809). - Fixes
Cachebehavior for Relay 0.21.0,Psr16Cache::getMultiple(), chain adapter expiry propagation, and tag-aware save failures (#63818, #63747, #63655, #63736). - Fixes
HttpClientevent stream handling and push response cleanup (#63692, #63726). - Fixes
HttpKernelhandling for#[Autowire]references, router locale reset, uploaded file mapping, andMapUploadedFilevalidation metadata (#63724, #63676, #60816, #60483). - Fixes
Consoletable rendering, ASCII formatter performance regression, andCommandTestersupport for invokable commands (#60042, #63749, #60823). - Fixes
Dotenvdeferred expansion issues with self-references, escaped dollars, and preloading warnings (#63674, #63620, #63766). - Fixes
MessengerRedis duplicate pending messages and worker memory-limit parsing for float values (#63643, #60759). - Fixes
JsonPathfilter evaluation and improves RFC compliance coverage (#60504, #60699). - Fixes
Intllocale validation and inconsistent region-code data (#60888, #60711). - Fixes
Formcollection reindexing andNumberToLocalizedStringTransformerempty-string handling (#59910, #60676, #60638). - Fixes
SecurityBundleprofiler status display and thesecurity.http_utilsdecoration path (#63722, #60803). - Fixes
WebProfilerBundletoolbar behavior with AJAX requests and pending-request accounting (#60607, #63679). - Fixes
VarExporterhydration of initialized readonly properties (#63635).
Other notable changes
- Symfony 8 removes support for
amphp/http-client < 5and renames the Amp v5 classes used by the bridge (#60712). - Symfony 8 removes the legacy lazy-object traits from
VarExporterin favor of native lazy objects (#60716). - Symfony 8 removes deprecated
PropertyInfocode and requiresPropertyInfo 8.0+in the Doctrine bridge (#60726, #60736). - The container dump used by debug and lint commands now uses
php-serializealongside the XML dump (#60597). Securityalso deprecates the internal rate-limiter factory alias (#60893).
Contributors
@javiereguiluz @nicolas-grekas @mtarld @pcescon @lyrixx @kira0269 @mp3000mp @wazum @pavelwitassek @sn3mdev @LachlanArthur @sakozoko @valtzu @audain-dg @shyim @rfcdt @eyupcanakman @mpdude @guillaumeVDP @andyexeter @SeverinGloeckle @nicolas-grekas @eyupcanakman @santysisi @IndraGunawan @xabbuh @LachlanArthur @ro0NL @alexandre-daubois @BenMorel @MatTheCat @ruudk @cquintana92 @Valmonzo @jprivet-dev @HypeMC @weitzman @lyrixx @OrestisZag @rdavaillaud @llupa @OskarStark