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
10c3a5e to
169b07e
Compare
169b07e to
e104551
Compare
| datasource | package | from | to | | ---------- | --------------------------------- | ------- | ------- | | packagist | carthage-software/mago | 1.4.1 | 1.12.1 | | packagist | ergebnis/composer-normalize | 2.49.0 | 2.50.0 | | packagist | phpstan/phpstan | 2.1.38 | 2.1.40 | | 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 |
e104551 to
98b548d
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.12.1^2.49.0→^2.50.0^2.1.38→^2.1.40^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.12.1: Mago 1.12.1Compare Source
Mago 1.12.1
This is a patch release with bug fixes for the analyzer and formatter.
🐛 Bug Fixes
Analyzer
duplicate-array-keywith spread operator: Fixed a false positive where explicit keys following a spread expression (e.g.,[...self::DEFAULTS, 'title' => 'Override']) were incorrectly flagged as duplicate keys. Overriding spread keys with explicit entries is a common PHP pattern and is no longer reported (#1215)Formatter
($a === 'b') === $cwas flattened into the invalid$a === 'b' === $c). PHP declares comparison operators as non-associative, so chaining them without parentheses is a parse error (#1216)newkeyword, aligning with the PER-CS specification (#1115, #1210)🏗️ Internal
.rustfmt.toml(#1212)🙏 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.12.0...1.12.1
v1.12.0: Mago 1.12.0Compare Source
Mago 1.12.0
This release adds clickable file paths in terminal output via OSC 8 hyperlinks, a
--fail-on-remainingflag for CI workflows using--fix, improved--stagedhandling for partially staged files, and several bug fixes in the analyzer, linter, and configuration system.✨ Features
Reporting
editor-urlinmago.tomlor theMAGO_EDITOR_URLenvironment variable with%file%,%line%, and%column%placeholders. Supported inrich,medium,short, andemacsreporting formats. Hyperlinks are automatically disabled when output is piped or when--colors=neveris used (#1188)CLI
--fail-on-remainingflag forlintandanalyze: When using--fix, Mago now exits with code0even if some issues could not be auto-fixed. The new--fail-on-remainingflag restores a non-zero exit code when unfixed issues remain, making it easy to enforce that all issues are resolved in CI pipelines (#1208)--staged --fixhandling: When using--stagedwith--fix, Mago now detects partially staged files and only processes the staged content. Fixed files are automatically re-staged so that fixes are included in the commit without accidentally staging unstaged changes (#1199)🐛 Bug Fixes
Analyzer
object,iterable) when subtracting generic type parameters in negated assertion contexts, which could produce falseredundant-conditiondiagnostics (#1207)===) with other typed variables. Previously, the left-hand variable could remain typed asmixedafter comparison with a more precisely typed value (#1206)Linter
array-styleandstr-starts-withwhen multiple fixes applied to nearby code (#877)Configuration
XDG_CONFIG_HOMEis not set, Mago now correctly falls back to$HOME/.configbefore checking$HOME, matching the XDG Base Directory Specification. Previously, only$HOMEwas checked, causing global configuration files in~/.config/mago.tomlto be ignored (#1211)📖 Documentation
$XDG_CONFIG_HOME,~/.config,~(#1211)editor-urlconfiguration option with URL templates for VS Code, Cursor, Windsurf, PhpStorm/IntelliJ, Zed, Sublime Text, Emacs, and Atom (#1188)🙏 Thank You
Issue Reporters
Thank you to everyone who reported issues and requested features that shaped this release:
Full Changelog: carthage-software/mago@1.11.0...1.12.0
v1.11.0: Mago 1.11.0Compare Source
Mago 1.11.0
This release adds a
--stagedflag for seamless pre-commit hook integration, a newimprecise-typeanalyzer diagnostic for barearray/iterabletype hints, support for class-like constants in array shape keys, and several bug fixes across the analyzer, formatter, and Composer installer.✨ Features
CLI
--stagedflag forlintandanalyze: New--stagedflag restricts linting and analysis to files currently staged in Git, making pre-commit hook setup straightforward. When combined with--fix, changed files are automatically re-staged so that fixes are included in the commit (#1199)Analyzer
imprecise-typediagnostic for barearray/iterabletype hints: The analyzer now warns when parameters, returns, or properties use barearrayoriterabletype hints without a corresponding docblock annotation specifying the element types. This encourages more precise type documentation across your codebase (#1191)Type System
array{MyClass::FOO: string, MyEnum::Bar: int}), enabling more precise type definitions for constant-keyed arrays (#1190)🐛 Bug Fixes
Codex
class-string<T>generics: Fixed a bug where type aliases (e.g.,@psalm-type,@phpstan-type) used as the generic parameter inclass-string<T>annotations were not resolved, causing false positives (#1202)@inheritDocacross intermediate classes: Fixed falseincompatible-parameter-typepositives when a child class inherited docblock types from a grandparent through an intermediate class that didn't redeclare the method (#1189)Analyzer
#[Override]error for trait methods: When#[Override]is used on a trait method that doesn't override any parent, the diagnostic now suggests adding a@require-implementsannotation to the trait if the method is intended to override an interface method (#1192)Formatter
($a ?: $b)->method()or($a ? $b : $c)->prop, which would change the runtime semantics (#1198)Prelude (Type Stubs)
@pureannotations removed: Removed incorrect@pureannotations fromdebug_zval_dump(),error_log(),phpinfo(), andphp_sapi_name()which could mask side-effect analysis (#1195)Composer
.ziparchives for Windows MSVC targets instead of requesting non-existent.tar.gzfiles, which caused 404 errors when invokingvendor/bin/mago(#1196)Mago\Internalnamespace. Unsupported architecture targets have been removed and ARM v5/v6 detection has been added, with clear error messages when a platform has no pre-built binary📖 Documentation
MAGO_environment variable prefix: Documented that all environment variables starting withMAGO_are reserved for configuration. UnrecognizedMAGO_-prefixed variables (e.g., from CI tools) cause configuration errors. The docs now explain how to diagnose and resolve this (#844)--stagedwith--fixto automatically fix and re-stage files in pre-commit hooks🙏 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.10.0...1.11.0
v1.10.0: Mago 1.10.0Compare Source
Mago 1.10.0
This release introduces wildcard pragma suppression (
@mago-ignore all), auto-fix for unused pragmas, a new just-in-time binary download for Composer, and a large number of bug fixes across the analyzer, linter, formatter, and type system.✨ Features
Collector (Pragma System)
@mago-ignore all/@mago-expect allwildcard pragmas: You can now useallas the issue code in suppress pragmas to suppress all issues within a category (e.g.,@mago-ignore lint:all) or across all categories (e.g.,@mago-ignore all). This is especially useful for legacy code where listing individual codes is impractical (#1034)mago lint --fixormago analyze --fix, unused@mago-ignoreand unfulfilled@mago-expectdirectives are now automatically stripped. The fixer handles three cases: removing a single code from a comma-separated list, removing a directive line from a multi-line comment, or deleting the entire comment when all pragmas are unused (#1187)Linter
check-functionsoption forprefer-first-class-callable: The rule now supports acheck-functionsconfig option (default:false). When disabled, the rule only suggests first-class callable conversion for method and static method calls, avoiding false positives with internal PHP functions that throwArgumentCountErroron extra arguments (#1147, #1160)exclude-setters-and-constructorsoption forno-boolean-flag-parameter: The rule now supports excluding setter methods and constructors from boolean flag parameter detection, reducing noise for legitimate boolean setter patterns (#1155)Composer
CLI
configoutput: Themago config --show formattercommand now displays all resolved formatter settings flattened alongsideexcludes, matching the TOML configuration structure. The--schemaoutput has also been updated to reflect the flat structure. Previously, only{"excludes": []}was shown (#1180)🐛 Bug Fixes
Analyzer
redundant-conditionforis_float()onint|floatunion: Theint ⊂ floatcontainment rule is now guarded by assertion context, preventing incorrectredundant-conditionandredundant-type-comparisondiagnostics whenis_float()oris_double()is called onint|floatvariables (#1186)undefined-string-array-indexerrors when writing to (not reading from) unknown array keys withallow-possibly-undefined-array-keysset tofalse(#1168, #1171)catch-type-not-throwablediagnostic now shows class names in their original casing instead of all-lowercase (#1185)invalid_dependenciesduring class-like metadata re-population, and the incremental analysis service properly tracks per-file issues (#1176, #1178)missing-magic-methodwith trait@property/@method: Real inherited properties and methods from parent classes now correctly override trait pseudo@propertyand@methodannotations, preventing false positives when a trait declares magic accessors that shadow real parent members (#1184)@mixinon parent classes are now correctly inherited by child classes during method and property resolution (#1169)Linter
prefer-arrow-functiondisabled inside constant expressions: Arrow function suggestions are no longer emitted inside constant expressions (e.g., class constant initializers) where closures are the only valid syntax (#1166)Formatter
method-chain-semicolon-on-next-linedisabled by default: The Pint preset now correctly defaults this setting tofalse, matching Pint's actual behavior (#1164)Syntax
yieldexpression detected insidereturnstatement: The parser now correctly identifiesyieldexpressions when used as a return value (e.g.,return yield $value), preventing incorrect diagnostics on generator functions (#1167)Prelude (Type Stubs)
dir()second argument marked as optional: The second parameter ofdir()is now correctly annotated as optional, fixing falsetoo-few-argumentserrors when callingdir()with a single argument (#1163)Reporter
Atom (Case Folding)
strtolower()behavior. This could cause mago to fail to detect errors resulting from case differences in non-ASCII class names (#1161)Playground
file-namerule disabled by default: Thefile-namelint rule is now disabled in the Mago playground to reduce noise for single-file examples (#1162)🙏 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.9.1...1.10.0
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-qz](https://redireConfiguration
📅 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