Update dependency phan/phan to v6.0.0 #708
Merged
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 contains the following updates:
6.0.0-beta→6.0.0Release Notes
phan/phan (phan/phan)
v6.0.0: Phan 6.0.0Compare Source
Phan NEWS
Jan 16 2026, Phan 6.0.0
Bug fixes:
PhanUnreferencedClosurebeing emitted too aggressively for closure function parameters (#5389)matchexpression type narrowing when multiple conditional expressions are used (#5398)PhanTypeMismatchArgumentSuperTypefalse positives on closure parameters (#5402)count()- only narrow closed array shapes with optional keys (#5406)IS_PROMOTED_PROPERTYflag detection for constructor property promotion (#5411, #5416)matchdetection with literal bool edge cases (#5388)Improvements:
Method::cloneWithTemplateParameterTypeMapto avoid unnecessary cloningCallableParamPluginfor functions with no parametersFullyQualifiedClassElement::makeusing object IDscomposer-patchespackage location for PHP 8.5 compatibility (#5387)Nov 20 2025, Phan 6.0.0-beta
Breaking changes:
-iCLI option is now an alias of--incrementalinstead of--ignore-undeclaredPhanPluginCanUsePHP71Voidissue toPhanPluginCanUseVoidReturnTypeallow_method_param_type_wideningconfig option (contravariance is now always allowed)backward_compatibility_checksconfig option, along with its respective--backward-compatibility-checksand-bCLI flagsNew features (Analysis):
ast_trim_max_elements_per_level(default 256) andast_trim_max_total_elements(default 512).max_union_type_set_size(default 1024), preventing runaway growth from deeply nested array merges while keeping type inference useful.--ast-trim-max-elements-per-level,--ast-trim-max-total-elements,--max-union-type-set-size) for easy experimentation without editing config files.|>) with full type inference through piped call chains(void)cast support for suppressing NoDiscard warningsnew MyClass()->method())@param,@var, and@return@param,@var, and@returnannotations before analysis, allowing nested array/generic syntax to be laid out
across several lines without being misinterpreted.
@phan-param,@phan-var,@phan-return,@phan-real-return,@phan-property*,@phan-assert,@phan-type,@phan-implements,@phan-extends,@phan-inherits,@phan-use(#4252)PHPDocRedundantPluginnow flags redundant@varannotations on typedproperties, matching its existing coverage for functions and methods.
PreferNamespaceUsePluginnow handles union types!in_array()checks (#5185)$var2 =& $var1) now have their literal types erasedarray_filter()recognizes null-stripping callbacks and keeps element types non-null (#5100)array_chunk()return type inference based onpreserve_keysparameter (#5165)constant()return type inference from Phan's constant table for non-dynamic constants (#5157)foreachiterator type inference honoring explicit iterator generics (#5108)self::CASE->value+=,-=, etc.)@vardocblocks on typed propertiesNew features (CLI):
.phan/config.php--subdirectory-onlyflag for analyzing specific modules with better performance-n/--no-config-fileimplicitly limits analysis to just the files providedon the command line (e.g.
phan -n test1.php test2.php) avoiding analysis ofthe rest of the project when you only want quick ad-hoc checks.
will be analyzed on subsequent runs. Significantly speeds up re-analysis.
--incremental/-ioption that enables incremental analysis.--force-full-analysisflag to force a full re-analysis of all files, ignoring the incremental analysis manifest.--no-incremental/-Noption that disables incremental analysis (useful if it was enabled in config.php).Performance improvements:
New features (Tools):
tool/add_suppressions.phpto assist in adding@suppressor@phan-suppressannotations to filestool/SuppressionsToolImplementation.mdfor technical detailsBug fixes:
Type Inference & Analysis:
!empty()condition on arrays (#5295)PhanAccessReadOnlyPropertyMultipleTimesfailing to account for mutually exclusive branches (#5285)declareblocks causing Phan to lose track of declared variables (#5284)PhanTemplateTypeConstraintViolationwhen type can't be resolved (#5282)is_objectand!is_arraychecks with mixed types (#5277)is_null()and!is_null()(#5277)PhanPossiblyUndeclaredVariablewith function calls and following usage (#5269)PhanTypeMismatchGeneratorYieldKeyfalse positive when yield has no key (#5258)PhanAccessOwnConstructorincorrectly warning on valid usage ofself::__construct(#5257)isset()andempty()warning on undefined properties (now only warns on direct access and unset) (#5273)array_combinesignature being too strict for null values (#5219)get_class()to return more specific class-string types (#5274)getIterator()returning Iterator with explicit generics (#5108)@require-extends/@require-implements(and their Psalm aliases) to ensure consuming classes satisfy those requirementsPhanPossiblyInfiniteRecursionSameParamsfalse positive for instance methods that guard recursion with property state (#5371)PhanTypeMismatchDeclaredConstantfalse positives for enum cases whose values are strings/ints (#5378)Tooling:
--save-baselinenow store suppressions per symbol (class/method/function) instead of line numbers and normalize anonymous class/closure names, so suppressions remain stable when code moves or hashes change (#5381/#5383)Plugins:
PhanSuspiciousValueComparisonmessage when all literal possibilities exhausted (#5276)PhanCommentAbstractOnInheritance(#5265)Other Fixes:
?->(#5112)%operator (#5189)define()(#5156)EmptyFQSENExceptionwith--analyze-twice(#5086)PhanTypeMismatchDeclaredReturnwith template types (#5181)isset()on readonly properties in@phan-side-effect-freeclasses (#5180)PhanParamTooFewUnpackwith array_map (#5114)parent::/static::(#5109)PHPDoc & Attributes:
__calland__callStaticfrom automatic inheritance (#5124)Plugin Fixes:
array{}|non-empty-array<K,V>(#5187)Loop & Control Flow:
!isset()variable tracking: Possibly-undefined flag preservation now works correctly (#5172)empty(): Proper static property handling (#5148)AST Compatibility:
clonebeing incorrectly treated as a function call in AST version 110+ (it's now AST_CALL instead of AST_CLONE)Configuration
📅 Schedule: Branch creation - "before 4pm every weekday except before 9am every weekday" in timezone America/New_York, Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.