Upgrading friendsofphp/php-cs-fixer 1 to 2
Breakingv1.13.3 → v2.19.3Breaking31Security1Platform7Deprecated13New258Changed213Fixed580Other756
BreakingUpgrade verdict
30 breaking changes and 7 platform requirement changes and a security fix.
In plain terms
- The old fixer name no longer exists; use the new fixer name in your configuration instead.
- A method that was not used anywhere has been deleted.
- Deletes the old ConfigurationResolver class.
- Fixer::getLevelAsString is no longer static.
Must act Top 5 of 51 that need code or config changes
friendsofphp/php-cs-fixer publishes an official migration guide for version 2. It covers more than the release notes do.
UPGRADE ↗PHP requirement changed in v2.17.0: ^5.3.6 || >=7.0 <7.2 → ^5.6 || ^7.0 || ^8.0.
What you must change
Breaking30
PhpdocTrimAfterDescriptionFixer is replaced by PhpdocTrimConsecutiveBlankLineSeparationFixer.
PhpdocTrimAfterDescriptionFixerPhpdocTrimConsecutiveBlankLineSeparationFixerRemoves the unused Token::isStructureAlternativeEnd method.
Token.isStructureAlternativeEnd()Deletes the old ConfigurationResolver class.
ConfigurationResolverFixer::getLevelAsString is no longer static.
Fixer::getLevelAsStringRenames PhpdocShortDescriptionFixer to PhpdocSummaryFixer.
PhpdocShortDescriptionFixerPhpdocSummaryFixerRemoves non-default Config and Finder classes.
ConfigFinderRenames namespace Symfony\CS to PhpCsFixer.
Symfony\CSPhpCsFixerRenames fixers.
Renames the --config-file CLI argument.
--config-fileRenames not_operators_with_space to not_operator_with_space.
not_operators_with_spacenot_operator_with_spaceRenames PhpdocNoSimplifiedNullReturnFixer back to PhpdocNoEmptyReturnFixer.
PhpdocNoSimplifiedNullReturnFixerPhpdocNoEmptyReturnFixerRemoves ConfigInterface::getDir, ConfigInterface::setDir, Finder::setDir and the whole FinderInterface.
ConfigInterface::getDirConfigInterface::setDirFinder::setDirFinderInterfaceRemoves ConfigAwareInterface.
ConfigAwareInterfaceRemoves the overcomplete NoDuplicateSemicolonsFixer.
NoDuplicateSemicolonsFixerRenames no_whitespace_in_blank_lines to no_whitespace_in_blank_line.
no_whitespace_in_blank_linesno_whitespace_in_blank_lineUnifies the Phpdoc*Fixer rename fixers.
Phpdoc*FixerRemoves the unused Tokens::isMethodNameIsMagic method.
Tokens::isMethodNameIsMagic()Renames the phpdoc_params rule to phpdoc_align.
phpdoc_paramsphpdoc_alignRemoves Token::$line.
Token::$lineRemoves Token::getLine.
Token::getLineFileCacheManager removes code for backward compatibility support.
FileCacheManagerAdds a short diff output format, which breaks backward compatibility; this PR was reverted in v2.2.3, which should be used instead.
Makes fixers final.
FixerInterface::configure now always overrides configuration instead of patching it.
FixerInterface::configureMerges the conflicting ShortArraySyntaxFixer and LongArraySyntaxFixer.
ShortArraySyntaxFixerLongArraySyntaxFixerUnifies the Concat*Fixer fixers.
Concat*FixerSplits Tokens into Tokens and TokensAnalyzer.
TokensTokensAnalyzerChanges the FixerInterface.
FixerInterfaceRequires all Transformer classes to be named with the Transformer suffix.
Makes internal classes final.
Security1
Disallows unserializing classes that have a destructor.
Platform7
Relaxes composer requirements so installation is not blocked under PHP 8, though PHP 8 support is not yet ready.
Requires PHP 7.1.
Requires PHP 7.0.
Adds official support for PHP 7.3.
Adds official support for PHP 7.3.
Requires PHP 5.6 or newer.
Adds support for PHP 7.2.
Deprecations to plan for
Deprecated13
Deprecates version 2.
Deprecates a parameter of Token::toJson().
Token::toJson()Deprecates FinalStaticAccessFixer.
FinalStaticAccessFixerDeprecates Config::create().
Config::create()Deprecates the target option of PhpUnitDedicateAssertInternalTypeFixer.
PhpUnitDedicateAssertInternalTypeFixertargetRaises deprecation warnings when deprecated aliases are used.
Deprecates the last parameter of Tokens::findBlockEnd.
Tokens::findBlockEndRenames no_extra_consecutive_blank_lines to no_extra_blank_lines with a BC layer.
no_extra_consecutive_blank_linesno_extra_blank_linesDeprecates use_yoda_style in IsNullFixer.
use_yoda_styleIsNullFixerUpdates deprecations in ConfigurableFixerInterface and ConfigurationDefinitionFixerInterface.
ConfigurableFixerInterfaceConfigurationDefinitionFixerInterfaceAdds missing deprecations for Token.
TokenDeprecates input option values other than "yes" or "no".
Deprecates IntegrationCase::shouldCheckPriority as priority checking is now automated.
AbstractIntegrationTestCaseIntegrationCase::shouldCheckPriority