[Conductor] Update dev - #112
Merged
Merged
Conversation
Conductor executed the following commands: composer update rector/rector:2.6.1 phpstan/phpstan:2.2.8 --with-all-dependencies --minimal-changes
Contributor
Author
composer.lockDev Package changes
Settings · Docs · Powered by Private Packagist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was automatically generated by Conductor.
The PR contains the changes generated by running the following command:
Changelog
rector/rector (Source: GitHub Releases))
2.6.1
Bugfix 🐛
composer-basedcommand on a lazy-initialized property, e.g. PHPStanUnionType::$normalized(#8280)Composer-based sets keep growing: Twig, nette/utils and the rest of Symfony 📦
Follow-up release to 2.6.0. The composer-based rollout continues - Twig and nette/utils join, and every remaining Symfony rule now declares the package version its target API was added in.
The new Twig composer-based set replaces the
twig112→twig127→ ... →twig30chain with a single set, where every rule checks the installedtwig/twigversion:final class SomeTwigUse { - public function run(Twig_Environment $twigEnvironment) + public function run(\Twig\Environment $twigEnvironment) { - return new Twig_SimpleFilter('some_filter', 'strlen'); + return new \Twig\TwigFilter('some_filter', 'strlen'); } }Package bonding (composer-based rollout) 📦
nette/utilsrules to the installed package version;nette-utils4.phpbecomescomposer-based.phpand is loaded as a single set (#8275)LoadValidatorMetadataToAttributeRectorin the composer-based set - the last interface-bonded rule left outside it (#997)ContainerInterfaceServiceToServiceContainerRectortosymfony/dependency-injection>=6.0 (#999)AddGetReferenceTypeRectortodoctrine/data-fixtures>=1.6 and the annotation-to-attribute sets to their package constraints (#497)RemoveExpectAnyFromMockRectorto PHPUnit 11+ (#756) ** landed in 2.6.0, missing from its release notes
The per-version sets are not touched - every rule stays registered where it was.
Set changes 📈
ConsistentImplodeRectorfrom the coding style level - the swappedimplode($array, $glue)signature was removed in PHP 8.0, so the rule belongs to thephp80set only, where it already is (#8273)DoctrineSetList::COMPOSER_BASEDconstant, remove the emptyDOCTRINE_BUNDLE_210set (#499)Bugfixes 🐛
AddParamArrayDocblockFromAssignsParamToParamReferenceRector(#8271)returninConsoleExecuteReturnIntRectoron a trailing comment (#992), plus a fixture for a block comment with a commented-out return (#993)(int)cast on amatchreturn inConsoleExecuteReturnIntRector- amatchof int constants is aUnionType, so theinstanceof IntegerTypecheck missed it (#998)public function execute(InputInterface $input, OutputInterface $output): int { - return (int) match ($input->getArgument('type')) { + return match ($input->getArgument('type')) { 'a' => 0, default => 1, }; }Deprecations 💀
Deprecated rules still run, but print a warning and will be removed in a future major release.
These are coding standard preferences or opinionated rewrites - a coding standard tool is the better place for them.
rector-src
WrapEncapsedVariableInCurlyBracesRector- also removed from the coding style level (#8272)function run($world) { - echo "Hello $world!"; + echo "Hello {$world}!"; }The actual PHP 8.2 deprecation,
${var}, is covered byVariableInStringInterpolationFixerRectorin thephp82set.CountArrayToEmptyArrayComparisonRector- also removed from the coding style level (#8274)ArraySpreadInsteadOfArrayMergeRector- the spread result is harder to read, and...mid-array looks dangerous in review (#8277)UnusedForeachValueToArrayKeysRector- also removed from the code quality level (#8278)rector-doctrine
GetRepositoryServiceLocatorToRepositoryServiceInjectionRector- it resolved the repository class by running a regular expression over the entity file contents (#498)Renames 🔄
ReplaceServiceArgumentRector→ContainerInterfaceServiceToServiceContainerRector, no longer configurable (#999)Both sets configured it with the same 2 values, for a single Symfony 6.0 BC break - the
Psr\Container\ContainerInterfaceandSymfony\...\DependencyInjection\ContainerInterfacealiases of theservice_containerservice were removed. Now hardcoded, and theReplaceServiceArgumentvalue object is gone.2.6.0
Composer-based sets - let Rector handle upgrade from
composer.json🥳The main theme of this release: rules that turn themselves on based on the package versions you actually have installed.
Instead of picking a Symfony or PHPUnit set by version number and guessing what applies, register the composer-based set once. Every rule inside checks
composer.json/installed.jsonand only runs if the installed package version matches its constraint.We're working on full coverage. At the moment, PHPUnit and Symfony rules are already migrated to this approach. Not only rules, but also rule configuration can be bound to a package version:
To see what is active and why, there is a new command:
And to run only those rules in a single process:
New features 🥳
ruleWithConfigurationComposerVersionBound()(#8244)composer-basedcommand (#8246)--composer-basedprocess filter (#8248)withComposerBased()(#8255)withComposerBased()(#8259)composer.json(#8264)New rules 🎉
rector-src
RemoveTestsOverriddenPrivateMethodParameterRector(#8254)rector-phpunit
AddIntersectionParamToMockObjectParamRector(#755)ExpectsParamToMockObjectRector— for private test method params (#753)MockObjectArgCreateStubToCreateMockRector(#741)AssertContainsOnlyMethodCallRector(#738)rector-symfony
LoadValidatorMetadataToAttributeRector(#988)Bugfixes 🐛
RecastingRemovalRectoron array dim fetch value (#8262)RemoveDefaultValueFromAssignedPropertyRectoron early return in constructor-called method (#8261)RemoveDefaultValueFromAssignedPropertyRector(#8240)createStub()in tests (#8257)--onlyrule name with shell-eaten backslashes (#8267)composer.jsonconstraint over outdatedinstalled.jsonversion (#8242)InstalledPackageResolvercwd fallback lost by promoted property (#8237)preConditionandpostConditionattribute mapping (#746)DataProviderAnnotationToAttributeRector(#751, #752)Set changes 📈
ExplicitPublicClassMethodRectorto PHP 5.3, plus one each to code quality and dead code (#8266)MinMaxToClampRectorfrom coding style level (#8270)SymfonySetList::COMPOSER_BASED(#982)PHPUnitSetProvider(#748)Deprecations 💀
Deprecated rules still run, but print a w and will be removed in a future major release.
These were deprecated as not part of any set, risky, opinionated or excluded by most users. Goal is to make Rector useful more to masses and every day user by having valuable and reliable rules.
rector-src
EncapsedStringsToSprintfRector(#8265)SimplifyRegexPatternRector(#8263)BinaryOpStandaloneAssignsToDirectRector(#8269)NullableCompareToNullRector(#8268)NestedTernaryToMatchRector(#8241)AddReturnDocblockFromMethodCallDocblockRector(#8239)withPhp53Sets()...withPhp74Sets()— usewithPhpLevel()instead (#8253)cacheMetaExtension()— reports a warning when used (#8251)rector-doctrine
YamlToAttributeDoctrineMappingRector(#492)DoctrineSetList::YAML_TO_ANNOTATIONSset (#493)rector-symfony
TemplateAnnotationToThisRenderRector(#989)ReturnDirectJsonResponseRector(#987)AutowireAttributeRector(#981)rector-phpunit
WillReturnCallbackFallbackToThrowRector(#740)ReplaceTestFunctionPrefixWithAttributeRector(#739)Removals 💀
strict-booleansset, deprecated since 2025-10 (#8243)junitoutput format (#8250)DoctrineDocBlockResolver, deprecated since 2025-05 (#491)StringExtensionToConfigBuilderRector, deprecated since 2025-10 (#978)AssertPropertyExistsRector(#742)Package bonding (composer-based rollout)
AddViolationToBuildViolationRectortosymfony/validator2.5 (#983), addAuthorizationCheckerIsGrantedExtractorRectorto the composer-based set (#985), bondRedirectToRouteRectortosymfony/framework-bundle2.6 (#991)phpunit/phpunit>=11.0 (#750), bond annotation-to-attribute rules tophpunit/phpunit>=10.0 (#744, #745), move composer version bound rules to composer-based set (#747)phpstan/phpstan (Source: GitHub Releases)
2.2.8
Bugfixes 🐛
??=with falseyisset()instead of!== null(#6145), #15021, thanks @VincentLanglet and @staabm!ArrayType::isCallable(): askStringType::isSuperTypeOf()about the item type instead of onlyisString()(#6166), #13114SpecifiedTypes::unionWith()instead of keeping only the left one (#6173), #15039GatheringNodeCallbacklayers inVirtualAssignNodeCallbackinstead of wrapping them (#6172), #15038Performance 🏎️
UnionTypecomparisons from an identity-keyedFiniteTypeSetinstead of scanning every member (#6116), #15008, #14978, thanks @staabm and @SanderMuller!Function signature fixes 🤖
ReflectionObject,RecursiveFilterIterator,ParentIterator,RecursiveCachingIteratorandRecursiveRegexIteratorgeneric in stubs (#6165), #15032Internals 🔍
ParametersAcceptorSelector::applyIntrinsicArgOverrides()(#6149)#[InstanceofDeprecated]message of EnumCaseObjectType (#6159), thanks @staabm!@internalon hasAcceptorTemplateOrLateResolvableParameterType (#6161)@varitems against the native offset type (#6164)Task options
If you close the PR, the task will be skipped and Conductor will schedule the next task. Clicking the "Skip" button in the UI has the same effect. Conductor won't attempt to update the dependency to this exact version again but it will schedule updates to newer versions.
Powered by Private Packagist