Repository navigation
Conversation
The merge of 2.x only updated files that already existed in the 3.x layout, so the files added on 2.x after the move to src/ and tests/ were left out or kept at their old place: - AssetMapperLocator and AssetMapperLoaderFactory, with their tests and documentation (the bundle class and the service config already referenced them). The factory gets the typed 3.x signatures. - doc/events.rst, still listed in the documentation index. - the console used by the lint:container CI step, moved from Tests/Functional/app/bin to tests/Functional/app/bin.
2.x converted the service definitions from XML to PHP, and the merge took the 2.x files, dropping what 3.x had changed in imagine.xml: - the mime type and extension guessers use symfony/mime MimeTypes again instead of the HttpFoundation guessers removed in Symfony 5 - remove the deprecated paste and watermark filter loaders using %kernel.root_dir% - remove the prototype of the CacheResolver removed in 3.x
The merged workflow tested Symfony 7.0, which composer.json no longer allows, kept a minimum-stability step whose matrix value was removed, and lost the step adding symfony/asset-mapper. Take the 2.x workflow, without the enqueue step (Enqueue support is removed in 3.x), with the 3.x branch trigger and the console path in tests/.
- drop the "?? ''" on $acl, which is a non-nullable string in 3.x - call expectExceptionMessageMatches(), the BC helper of 2.x does not exist in 3.x
phpstan-symfony 1.x reports every call on the generic NodeBuilder and ExprBuilder types of symfony/config 7.4 as a call on an unknown class. These errors are gone with phpstan 2 and phpstan-symfony 2.
The mb_str_functions fixer, run on PHP 8.4 or later, replaced these calls with mb_ltrim() and mb_rtrim(), which only exist since PHP 8.4. On older PHP versions they come from symfony/polyfill-mbstring, but only from recent versions of it: with the lowest dependencies (1.17.0 in CI), every call is an "undefined function" error on PHP 8.1. The characters trimmed are ASCII, so the byte functions give the same result.
It has no effect since PHP 8.1, the minimum version of the bundle, and the PHP 8.5 jobs fail on the self deprecation notice it triggers.
|
thanks. i would like to fix the ltrim/rtrim to use the mb_ versions, instead of reverting that. can we raise the lowest version we allow, if we require the polyfill directly in the requirement, otherwise with a conflict for the too low version? the cs fixer test seems to have a problem with shivammathur/setup-php downloading the php-cs-fixer. it has no version in the url: |
…ring 1.31 Revert 10ff537: polyfill-mbstring defines mb_ltrim() and mb_rtrim() since 1.31.0, so requiring it directly makes the lowest dependencies resolve a version that has them, instead of 1.17.0.
|
Done: the About php-cs-fixer: the |
|
thanks a lot! i merged on the cli to squash the mb_ltrim/rtrim thing rather than have the removal and the revert. |
Follow-up to #1653 (comment): fixes the drift of the 2.x merge on
2-to-3, one commit per kind of problem.src/andtests/were left out: the AssetMapper locator and loader factory (already referenced by the bundle class and the service config, which caused the 57 test errors), their tests and docs,doc/events.rst(still in the index), and the console used bylint:container. I compared every file of 2.x at the merge point with the 3.x tree: the other missing files were removed on purpose in 3.x (Enqueue, Templating, CacheResolver, legacy Twig mode...).imagine.xmlwere gone: the guessers based onsymfony/mime, and the removal of the deprecatedpaste/watermarkloaders and of theCacheResolverprototype.mb_ltrim()/mb_rtrim(). The "cs fixer" commit, run withmb_str_functionson PHP 8.4+, replaced 21ltrim()/rtrim()calls with functions that only exist since PHP 8.4. Recentsymfony/polyfill-mbstringversions define them, but not the one installed with the lowest dependencies (1.17.0): the "PHP 8.1 + lowest" job failed with 87 "undefined functionmb_rtrim()" errors, so I reverted them. The CS job runs on 8.3, where the fixer leavesltrim()alone.setAccessible()inAbstractTesttriggers a self deprecation on PHP 8.5, which fails the build withmax[self]=0. It has no effect since 8.1, so I removed it.composer.jsonanymore), kept aminimum-stabilitystep whose matrix value was removed, and lost the asset-mapper step. I took the 2.x workflow, without the enqueue step, with the 3.x trigger and the console path intests/.$acl ?? ''on a non-nullable parameter, and a call to the 2.x-onlyexpectExceptionMessageMatchesBC().NodeBuilder/ExprBuilderof symfony/config 7.4. I ignored them with a comment rather than moving to PHPStan 2 here: PHPStan 2 + phpstan-symfony 2 do not report them, but report other level 6 findings unrelated to the merge. Happy to do that move in a separate PR if you want, or drop the last commit.Checked locally: 948 tests green on PHP 8.5 (with
symfony/asset-mapperinstalled, only the 6 imagick tests skipped),lint:containerOK, PHPStan clean on PHP 8.2 like the CI job. Not checked locally: the PHPUnit jobs on PHP 8.1 to 8.4 (missing extensions here); the first CI run is what showed the two points above. The php-cs-fixer job failed becausesetup-phpcould not download the tool (empty release tag), unrelated to the changes.