Conversation
Agent-Logs-Url: https://github.com/voku/phpstan-rules/sessions/5951ab3e-044b-4a15-90ff-bc38c39a629d Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/phpstan-rules/sessions/5951ab3e-044b-4a15-90ff-bc38c39a629d Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/phpstan-rules/sessions/5951ab3e-044b-4a15-90ff-bc38c39a629d Co-authored-by: voku <264695+voku@users.noreply.github.com>
Coverage Report for CI Build 24215948743Coverage increased (+0.1%) to 94.219%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
PHPStan 2.x deprecates direct
instanceofchecks on type classes in favour of dedicated predicate methods, producing 49 level-8 errors. CI PHP job logs had no PHP warnings or notices.Changes
IfConditionHelper— Replace allinstanceof ConstantStringType,instanceof ConstantScalarType,instanceof IntegerType,instanceof NullType,instanceof ObjectType,instanceof IntersectionTypechecks with the supported API (->isString(),->isNull(),->isObject(),->getConstantStrings(),->getConstantScalarTypes(),->getArrays(), etc.). Add private helpersextractSingleConstantStringType()andextractSingleConstantScalarType()to safely unwrap single-value constant types without widening rule behaviour. Replaceinstanceof BooleanAndNode / BooleanOrNodewithget_class()string comparison to satisfyphpstanApi.instanceofAssumption.ExtendedBinaryOpRule/ExtendedAssignOpRule— Replace deprecatedinstanceof StringType/instanceof ArrayTypeguards with->isString()->yes()/->isArray()->yes(). Remove now-redundantproperty_existsguards (the node type is statically known fromgetNodeType()).WrongCastRule— Replaceinstanceof StringType,instanceof IntegerType, and runtimeis_a()(flagged asphpstanApi.runtimeReflection) with->isString()->yes(),->isInteger()->yes(), andClassReflection::isSubclassOf().Example