chore(deps): update dependency phan/phan to v6#159
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
chore(deps): update dependency phan/phan to v6#159renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
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 contains the following updates:
^5.4→^6.0Release Notes
phan/phan (phan/phan)
v6.0.5Compare Source
Deprecations:
override_return_typesconfig flag in favor oftrack_all_inferred_types, which subsumes its behavior and also accumulates concrete types on interface-typed properties (#5476)Bug fixes:
json_decode()false positives by improving return type inference for various flag combinations (#5503)@inheritDocfalse positives (#5504)ArrayShapeType::withStaticResolvedInContextto prevent infinite recursion on self-referential array shapes (#5508)v6.0.4Compare Source
json_decode($data, flags: JSON_OBJECT_AS_ARRAY)) (#5502)v6.0.3Compare Source
New features:
AnalyzeCallableArgumentCapabilityplugin interface that automatically fires for every callable-typed argument across the codebase, eliminating boilerplate for callable analysis plugins (#5483, #5499)CaseMismatchPluginfor detecting casing inconsistencies in class, function, method, and namespace references (#5480)--analyze-until-convergenceflag and improve--analyze-twiceto only re-analyze files whose inferred types changed (#5488, #5495)track_all_inferred_typesconfig flag to accumulate concrete types on interface-typed properties across assignments (#5476)--from-checkstyleoption totool/add_suppressions.phpto accept Phan checkstyle XML output (#5482)@inheritDocis used with nothing to inherit (#5404, #5498)Bug fixes:
PhanTypeMismatchArgumentwhen passingpositive-intornegative-intto afloatparameter (#5467)AnalyzeFunctionCallCapabilityandReturnTypeOverrideCapabilityplugin closures — args are now normalized to declaration order (#5483, #5499)isset()/empty()type narrowing for static properties (self::$prop) (#5471, #5472)PhanCoalescingNeverUndefinedfor static properties (#5473)class-string<T>template resolution dropping literal string types (#5474)PhanTypeExpectedObjectPropAccessfor template types (#5479, #5485)mixedin dim access (#5478)expressionHasClassReferenceto recurse into nested arrays during large-array trimming (#5470)stdClassshape type narrowing losing dynamic property types in branches (#5486)target_php_versioninstead ofPHP_VERSION_IDfor template stub selection (#5489, #5492)PhanInfiniteRecursionfalse positive when throwing expressions in non-call contexts (#5490, #5493)PhanUnreferencedUseFunctionfor functions used in hook bodies,PhanReadOnlyPHPDocPropertyfor backed properties with hooks, andPhanTypeInvalidPropertyDefaultRealfor virtual properties (#5491, #5494)try/catch/finallyblocks when finally is present (#5496, #5497)Miscellaneous:
RedisArraystub definitions (#5481)v6.0.2: Phan 6.0.2Compare Source
New features:
m/PR review followup from #5443 phan/phan#5460))
0and''— inferpositive-int/negative-intfor ordering comparisons, andnon-zero-int/non-empty-stringfor inequality comparisons (#5452)
Phan-Agents.mdguidance document for coding agents (#5461)Bug fixes:
PhanRedundantValueComparisonwhen real type resolution returns no types (#5422)PhanPossiblyUndeclaredMethod/PhanPossiblyNonClassMethodCallfrom wider union type assignments to typed properties ([#5440](https://github.com/wrong assumptions on static class members phan/phan#5440))
PhanRedundantCondition/PhanCoalescingNeverNullforisset()and??onArrayAccessobjects ([#5441](#5441))
InvalidFQSENExceptioncrash on method calls onnon-empty-mixedtyped variables (#5442)PhanTypePossiblyInvalidDimOffsetwarnings when accessing keys onmixed-typed variables with inferred array shapes ([#5444](https://github.com/Array element incorrectly inferred as possibly-unset when using ternary phan/phan#5444))
PhanTypePossiblyInvalidDimOffsetwhenarray<string,mixed>orarray<int,mixed>is in the union type ([#5455](https://github.com/phan/phan/issues/5455))
get_class()return type to erase template parameters fromclass-string<>(#5454)PhanUnreferencedUseNormalwhen class references (A::class,A::CONST) appear in large arrays subject to literal array summarization (#5462)proc_openno longer passes file descriptors (#5464)Miscellaneous:
felixfbecker/advanced-json-rpcwithdanog/advanced-json-rpc, allowsabre/event6.0 (#5450)v6.0.1: Phan 6.0.1Compare Source
New features:
&before the method name in@methodannotations, to declare that the method returns by reference (#5430)PhanTypeComparisonObjectOrderingissue type to detect when ordering operators (<,<=,>,>=,<=>) are used to compare an object with anon-object value, which throws TypeError in PHP 8.0+
Bug fixes:
array_mapwith ternary expression as array argument (#5424)value-of<T>andkey-of<T>not evaluating to the expected types (#5421)ifstatement vs?:ternary expression (#5408)arraynot being treated as array-like (#5433)Miscellaneous:
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 - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ 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.