Open
Conversation
Contributor
Author
|
automergeComment |
c4883b8 to
702f079
Compare
07dc643 to
19adc6e
Compare
f0930dd to
79cda5a
Compare
5fce0b8 to
4ebd3bd
Compare
4ebd3bd to
2c4252f
Compare
0d1f9b5 to
3a1748c
Compare
33854f5 to
1eee7fa
Compare
| datasource | package | from | to | | ---------- | --------------------------------- | ------- | ------- | | packagist | carthage-software/mago | 1.4.1 | 1.9.1 | | packagist | ergebnis/composer-normalize | 2.49.0 | 2.50.0 | | packagist | phpstan/phpstan | 2.1.38 | 2.1.39 | | packagist | phpstan/phpstan-deprecation-rules | 2.0.3 | 2.0.4 | | packagist | phpstan/phpstan-phpunit | 2.0.12 | 2.0.16 | | packagist | phpstan/phpstan-strict-rules | 2.0.8 | 2.0.10 | | packagist | phpstan/phpstan-symfony | 2.0.12 | 2.0.14 | | packagist | phpunit/phpunit | 11.5.50 | 11.5.55 |
1eee7fa to
3dbf7e0
Compare
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:
^1.4.1→^1.9.1^2.49.0→^2.50.0^2.1.38→^2.1.39^2.0.3→^2.0.4^2.0.12→^2.0.16^2.0.8→^2.0.10^2.0.12→^2.0.14^11.5.50→^11.5.55Release Notes
carthage-software/mago (carthage-software/mago)
v1.9.1: Mago 1.9.1Compare Source
Mago 1.9.1
Patch release with several analyzer and formatter bug fixes, plus support for
@psalm-mutation-freeannotations.✨ Features
Codex (Type System)
@psalm-mutation-freeand@psalm-external-mutation-freeannotations: The codex scanner now recognizes these Psalm annotations and maps them to Mago's internal mutation-free flags, improving interoperability with Psalm-annotated codebases (#1157)🐛 Bug Fixes
Analyzer
@pure,@mutation-free, or@external-mutation-free, since these functions are guaranteed not to mutate the object's state (#1157)instanceofnarrowing on sealed class hierarchies: When narrowing a generic type (e.g.,Result<T>) withinstanceofagainst a sealed inheritor (e.g.,Success<T>), the type parameters from the parent type are now correctly carried over to the narrowed type, preventing unexpectednevertype results (#1156)@varannotations andinstanceofRHS: The analyzer now reportsnon-existent-class-likeerrors for undefined types used in@vardocblock annotations and on the right-hand side ofinstanceofexpressions, matching the existing behavior for parameter types, return types, and property types (#1007)undefined-string-array-indexerrors when accessing keys on union types containing both sealed and unsealed array variants (e.g.,array{foo: int, ...}|array{foo: int}). The unsealed variant's generic parameters are now properly considered when determining whether a key might exist (#1154)undefined-string-array-indexerror is now reported only once instead of once per union variantFormatter
// @​phpstan-ignore method.unused) on method signatures with multiline parameter lists were incorrectly moved to the next line (#1153)Prelude (Type Stubs)
DateTimeImmutableandDateTimeZonemethods annotated as mutation-free: Methods onDateTimeImmutableandDateTimeZonethat do not modify state are now annotated with@mutation-free, preventing false positive property narrowing invalidations when calling these methods (#1157)ReflectionClass::getReflectionConstants()return type: Added missing return type information (#1152)Documentation
space_after_colon_in_enum_backing_typesetting: Removed a reference to a non-existent formatter setting from the configuration reference documentation (#1151)🙏 Thank You
Contributors
A huge thank you to everyone who contributed code to this release:
Issue Reporters
Thank you to everyone who reported issues that shaped this release:
Full Changelog: carthage-software/mago@1.9.0...1.9.1
v1.9.0: Mago 1.9.0Compare Source
Mago 1.9.0
This release brings PHP 8.5 deprecation detection, new return type providers for
sprintf()andarray_map(), generator type inference, several new formatter options, and a large number of bug fixes across the analyzer, formatter, linter, and type system.✨ Features
Analyzer
sprintf()andPsl\Str\format(): The analyzer now resolves return types forsprintf()calls with constant format strings, producing precise literal string types when all arguments are known at analysis time (#1073)array_map()preserving array shapes: When callingarray_map()with a typed callback on a keyed array, the analyzer now preserves the array shape in the return type instead of widening toarray<key, value>(#1144)yieldbut no explicit return type annotation now have theirGenerator<K, V, S, R>type inferred from the yielded keys, values, and return statements (#1150)Linter
deprecated-cast: Detects deprecated non-canonical type casts ((integer),(boolean),(double), and(binary)) and suggests their canonical replacementsdeprecated-shell-execute-string: Detects usage of the backtick shell execute syntax (`ls -l`), which is deprecated in PHP 8.5, and suggests usingshell_exec()insteaddeprecated-switch-semicolon: Detects use of semicolons (;) as case separators in switch statements, deprecated in PHP 8.5, and suggests using colons (:) insteadmago-ignore/mago-expectdiagnostics: When an ignore or expect pragma does not match any issue, the diagnostic now highlights the specific issue code that was not matched, making it easier to identify stale or incorrect pragmas (#1123)Formatter
method-chain-semicolon-on-next-linesetting: New option to place the semicolon on its own line when a method chain breaks across multiple lines, equivalent to PHP-CS-Fixer'smultiline_whitespace_before_semicolons: new_line_for_chained_calls. Disabled by default, enabled in the Laravel/Pint preset (#1105)null_pipe_lastvariant fornull-type-hintsetting: New option that converts?TtoT|nulland reorders union types to placenulllast, providing PER-CS 3.0 compliance for null type positioning (#1133, #1134)/**in single-line doc blocks: The formatter now ensures a space is present after the opening/**in single-line doc blocks (e.g.,/**@​var int _/becomes/\*\* @​var int _/) (#1077)CLI
analyze --list-codes: New flag that outputs all analyzer issue codes as a JSON array of strings, useful for tooling integration (#1146)lint --list-rules --jsonnow includes severity: The JSON output of--list-rulesnow includes alevelfield (Error,Warning,Help, orNote) for each rule, matching the information shown in the human-readable table (#1142)🐛 Bug Fixes
Analyzer
redundant-nullsafe-operatorfrom producing code-breaking false positives when the nullsafe operator is legitimately needed (#1131)paradoxical-condition/impossible-conditionerrors when narrowing numeric types withis_numeric()checks on multiple variables (#1130)invalid-callableerrors on functions likeClosure::bind()(#1127)null-argumentpositives (#1126)array<K, T>instead oflist<T>, since named arguments can produce string keys (#1138)Formatter
// @​phpstan-ignore method.unused) on method signatures were incorrectly moved to the opening brace line when usingmethod-brace-style = "always-next-line"(#1124)<?= ?>) and single-expression echo statements within HTML templates (#1149)!(/* comment */ $x)) would oscillate between different positions on each format pass (#1135)method-chain-semicolon-on-next-linesetting now correctly applies only when the method chain is the direct expression of the statement, not when a chain appears nested inside another expression (e.g., as a function argument)Linter
no-trailing-spacefixer panic on CRLF files: Fixed a panic when the fixer encountered multibyte characters on lines with CRLF line endings (#1137)Lexer
"{$arr[Foo\BAR]}") (#1128)Prelude (Type Stubs)
parse_str()@param-outtype: Fixed the output parameter type annotation forparse_str()(#1140)Closure::bind()stubs: Added proper stub definitions to prevent falseinvalid-callableerrors (#1127)Composer
🏗️ Internal
IssueCode::all()method for listing all analyzer codesRuleEntrystruct for serializing linter rules with metadata and severity level🙏 Thank You
Contributors
A huge thank you to everyone who contributed code to this release:
Issue Reporters
Thank you to everyone who reported issues and requested features that shaped this release:
Full Changelog: carthage-software/mago@1.8.0...1.9.0
v1.8.0: Mago 1.8.0Compare Source
Mago 1.8.0
This release delivers major improvements to the incremental analysis engine for watch mode, new type narrowing capabilities, return type providers for
filter_var()/filter_input(), and a large number of bug fixes across the analyzer, linter, formatter, and type system.✨ Features
Analyzer
is_a()andis_subclass_of()type narrowing: The analyzer now narrows types after calls tois_a()andis_subclass_of(), including support forclass-stringparameters (#1102)filter_var()andfilter_input(): These functions now return precise types based on the filter and flags arguments (e.g.,FILTER_VALIDATE_INTreturnsint|false,FILTER_VALIDATE_EMAILwithFILTER_NULL_ON_FAILUREreturnsstring|null) (#1117)array{valid: true, result: string}|array{valid: false, errorCode: string}), the analyzer now correctly filters out incompatible variants based on the narrowed key type, instead of blindly overwriting all variants. This also works for object property narrowing on union types (#1093)Linter
no-issetarray access ignore option: Theno-issetrule now supports anallow-array-accessoption, allowing you to flagisset($var)while still permittingisset($array['key'])for array offset checks (#1097, #1120) by @dotdashSemantics
function() { ... }()as error, requiring parentheses around the closure for immediate invocation (#1118)⚡ Performance
Incremental Analysis Engine
The watch mode (
mago analyze --watch) received a complete overhaul of its incremental analysis pipeline:extend_refandremove_entriesoperations allow fine-grained metadata updates without rebuilding the entire codebasenon-existent-class-likeerrors in watch mode🐛 Bug Fixes
Analyzer
require-extends/require-implementsresolution: Members from@require-extendsand@require-implementstypes are now correctly resolved (#1064, #1070)\true,\false, and\nullare now correctly recognized (#1099, #1100) by @kzmshxget_substituted_methodfunction is now correctly applied to the child method when checking method signature compatibility, fixing false positives with generic abstract method inheritanceIteratorIterator) are now preserved during method resolution, fixing incorrect return types (#1106)for ($i = 0; $i < 10; $i++)) are now properly extracted from the AST for type narrowing (#1089)redundant-type-comparisonwhen using count checks or string narrowing in||conditions (#1112)HasAtLeastCountassertions no longer incorrectly set an exactknown_counton lists with unknown count, preventing falseunreachable-codereports (#1104)@vardocblock type: The analyzer now prefers@vardocblock types over inferred types for class constants, fixing cases where properly typed array values stayed asmixed(#1090, #1094)Codex (Type System)
neveras bottom type:neveris now correctly treated as a subtype of all types inextends_or_implementschecks (#1107, #1109) by @kzmshx@psalm-type/@phpstan-typealias names are now pre-registered before parsing, so aliases can reference each other regardless of declaration order (#1116)impossible-conditionfalse positives when comparingstrtolower()/strtoupper()results with literals containing non-alphabetic characters (spaces, digits, etc.) (#1086)Linter
no-redundant-usewhole-word matching: Docblock reference checking now uses whole-word matching instead of substring matching, souse Config;is correctly flagged as unused even whenConfigUsageappears in a docblock (#1078)inline-variable-returnwith by-reference assignment: The fixer no longer inlines assignments of by-reference expressions, which would produce invalid PHP (#1114)prefer-early-continuewith non-block body: Fixed the fixer for cases where the loop body is a single statement without braces (#1085) by @chrisopperwall-qzFormatter
$foo(...)) are no longer incorrectly treated as breaking expressions, fixing misformatted output (#1091)Prelude (Type Stubs)
explode()return type: Corrected to properly returnlist<string>instead ofnon-empty-list<string>when the separator could be empty (#1095)array_slice()return type: Now correctly preserves string keys in the return type (#1096)ldap_sasl_bind()stubs: Updated all arguments except the first to be nullable (#1098)bin2hex()stubs: Improved type definition (#1101) by @veewee🏗️ Internal
IncrementalAnalysisServiceencapsulating the full incremental analysis pipeline for watch mode and LSPCodebaseDiff::between()for metadata comparison andmark_safe_symbols()for incremental analysis🙏 Thank You
Contributors
A huge thank you to everyone who contributed code to this release:
Issue Reporters
Thank you to everyone who reported issues and requested features that shaped this release:
Full Changelog: carthage-software/mago@1.7.0...1.8.0
v1.7.0: Mago 1.7.0Compare Source
Mago 1.7.0
This release introduces new type system features, improved type inference for built-in functions, a new linter rule, and numerous bug fixes for the analyzer, formatter, and type system. A significant internal effort also went into reducing dependencies and binary size.
✨ Features
Type System
uppercase-stringandnon-empty-uppercase-stringtypes: Full support for these PHPDoc types in type syntax, codex, and analyzer. This resolves cascading errors when these types were previously unrecognized (#1057)Analyzer
Return type providers for
min()andmax(): These functions now return precise types based on their arguments (#1074)array_filter()callback parameter type inference: The analyzer now respects themodeargument (ARRAY_FILTER_USE_KEY,ARRAY_FILTER_USE_BOTH) when inferring closure parameter types, fixing incorrectmixedinference for callback parameters (#1031)Switch statement fallthrough analysis: The analyzer now correctly recognizes that non-terminating code paths in a
caseblock fall through to the next case. Acasewith a conditionalreturnfollowed by a case that always returns is no longer flagged asmissing-return-statement(#1081)Linter
no-redundant-issetrule: New rule that detects redundant arguments inisset()calls. For example, inisset($a, $a['key'], $a['key']['nested']), the first two checks are redundant becauseisseton a nested access implicitly checks all parent accesses (#769)CLI
--ignore-baselineflag: New flag forlintandanalyzecommands that temporarily ignores the baseline file, useful for reviewing and fixing baselined issues (#1076)⚡ Performance
reqwest,openssl,num_cpus,strum_macros,derivative,strsim,bitflags,async-walkdir), replacing them with standard library equivalents or manual implementations.reqwest/opensslwere replaced withureq/rustlsfor a significantly smaller and faster-compiling binary🐛 Bug Fixes
Analyzer
[$this, 'method']) and string callbacks ('ClassName::method') are now correctly tracked as used (#1069, #1044)Codex
@psalm-require-extendssupport in traits: Methods, properties, and class constants inherited from required parent classes via@psalm-require-extendsor@phpstan-require-extendsare now properly resolved in traits, eliminating falsenon-existent-property,non-existent-class-constant, andunknown-referrors (#1064, #1068, #1070)invalid-return-typeerrors (#1061)PHP_INT_SIZE,PHP_INT_MAX, andPHP_FLOAT_DIGnow use platform-aware range/union types instead of host-specific literal values.PHP_INT_SIZE > 4is no longer flagged as a redundant comparison (#1084)Formatter
align-assignment-likeis enabled, the alignment context from consecutive variable assignments no longer leaks into nested array key-value pairs (#1082)Linter
prefer-first-class-callablewith reference captures: Skip suggesting first-class callable syntax when the callee variable is captured by reference in a closure'suseclause, as the two forms have different semantics (#1067, #1063) by @kzmshxPrelude (Type Stubs)
array_walkgenerics: Fixed generic templates forarray_walkto properly infer callback parameter types (#1066, #1045) by @ddanielouarray_splicetype precision: Improved type definitions forarray_spliceto preservelist<T>types and correctly handle non-array replacement arguments (#1072, #1080)usort,uasort,uksort, etc.) to preserve non-empty array types (#1083)🏗️ Internal
reqwest+opensslwithureq+rustlsin self-update modulenum_cpuswithstd::thread::available_parallelism()bitflagswith manual bit flag implementationsderivative,strum_macros,strsim, andasync-walkdirdependencies🙏 Thank You
Contributors
A huge thank you to everyone who contributed code to this release:
Issue Reporters
Thank you to everyone who reported issues and requested features that shaped this release:
Full Changelog: carthage-software/mago@1.6.0...1.7.0
v1.6.0: Mago 1.6.0Compare Source
Mago 1.6.0
This release brings new analyzer checks for class design enforcement, new linter rules for file organization, path-scoped ignore/exclusion support, formatter fixes, and numerous bug fixes across the board.
✨ Features
Analyzer
class-must-be-finalcheck: New opt-inenforce-class-finalitysetting that reports classes not declaredfinal,abstract, or annotated with@api/@psalm-apiwhen they have no children (#1054)missing-api-or-internalcheck: New opt-inrequire-api-or-internalsetting that requires abstract classes, interfaces, and traits to have@apior@internalannotations, forcing projects to declare extensibility intent (#1055)Path-scoped ignore entries: The
ignoreoption now supports scoping ignored codes to specific paths (#1037, #1043)Literal types for enum properties: Enum
nameandvalueproperties now return literal types instead of genericstring/int, enabling more precise type inference (#1035, #952) by @veeweeSeverity level in code-count format: The
code-countreporting format now includes the severity level for each issue code (#987)Linter
file-namerule: New rule that enforces file names match the class/interface/enum/trait they contain (#1049)single-class-per-filerule: New rule that enforces each file contains at most one class-like declarationPer-rule path exclusions: Linter rules now support path-based exclusions, allowing you to disable specific rules for specific directories (#1037)
no-issetandreadable-literalenabled by default: These rules are now enabled out of the boxRemoved deprecated rules: The deprecated
constant-type,no-boolean-literal-comparison,parameter-type,property-type, andreturn-typelinter rules have been removed — their functionality has been moved to the analyzerFormatter
inline-empty-function-bracesandinline-empty-method-bracesnow default totrue, matching the PER Coding Style specification (#1053)CLI
--onlyrules: The--onlyflag now accepts multiple comma-separated rules (#1046)⚡ Performance
foldhashreplacesahash: Switched tofoldhashfor faster hashing across the codebaseArc<T>replacesBox<T>in codex: Improves cloning performance for shared metadata🐛 Bug Fixes
Analyzer
switchstatements no longer incorrectly narrow variable types, preventing false redundant null-check warnings (#1038)@vardocblocks: Imported type aliases are now correctly expanded in@vardocblock annotations (#1029, #1030)extends/implements(#1040)FORCE_COLORsupport: TheFORCE_COLORenvironment variable is now respected in reporting output (#1042)Linter
readable-literalfalse positive on floats: Fixed the rule triggering on float literals like123.45where neither side of the decimal benefits from separators, producing a no-op suggestionFormatter
Prelude (Type Stubs)
array_walkgenerics: Added generic templates toarray_walkfor proper type inference (#1045)curl_multi_execsignature: Corrected the signature ofcurl_multi_exec(#1033)setcookieduplicate: Removed duplicate definition forsetcookiethat only accepted the old syntax (#1032)Documentation
🔒 Security & CI
attydependency🏗️ Internal
timefrom 0.3.46 to 0.3.47 (#1039) by @dependabot🙏 Thank You
Contributors
A huge thank you to everyone who contributed code to this release:
Issue Reporters
Thank you to everyone who reported issues and requested features that shaped this release:
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
Renovate Bot