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
30d51ad to
8442d6f
Compare
8442d6f to
6282980
Compare
6282980 to
759633b
Compare
759633b to
f1f5ec9
Compare
e543c70 to
c23f26f
Compare
26cae27 to
8e93294
Compare
a55fc12 to
e18fe51
Compare
| datasource | package | from | to | | ---------- | -------------------------------------- | ------- | ------- | | packagist | carthage-software/mago | 1.14.0 | 1.18.1 | | packagist | php-standard-library/phpstan-extension | 2.0.3 | 2.1.0 | | packagist | phpstan/phpstan | 2.1.40 | 2.1.46 | | packagist | phpunit/phpunit | 11.5.50 | 11.5.55 |
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.14.0→^1.18.1^2.0.3→^2.1.0^2.1.40→^2.1.46^11.5.50→^11.5.55Release Notes
carthage-software/mago (carthage-software/mago)
v1.18.1: Mago 1.18.1Compare Source
Mago 1.18.1
Patch release fixing a CI failure that prevented 1.18.0 binaries from being built for
aarch64-unknown-linux-gnuandaarch64-unknown-linux-musltargets.🐛 Bug Fixes
Tests
--stdin-inputintegration tests spawn the builtmagobinary as a subprocess. When cross-compiling (e.g., aarch64 target on an x86_64 CI runner), the binary can't execute, causing all 5 tests to fail. These tests now detect cross-compilation and skip gracefully.Full Changelog: carthage-software/mago@1.18.0...1.18.1
v1.18.0: Mago 1.18.0Compare Source
Mago 1.18.0
Mago 1.18.0 is a packed release with 5 new features, 17 bug fixes across all tools, and improvements to the docblock parser. Highlights include full
callable-stringtype support withfunction_exists/is_callablenarrowing,--stdin-inputfor editor integrations on analyze/lint/guard, preciserange()return types, aPsl\Dict\select_keystype provider, and numerous false positive fixes in the analyzer, linter, and formatter.✨ Features
Analyzer
callable-stringtype support: Addedcallable-string,lowercase-callable-string, anduppercase-callable-stringtypes.function_exists()narrows strings tocallable-string(#1532)range()return type provider: Infers precise return types based on argument values -range(1, 5)returnsnon-empty-list<int<1, 5>>,range(0, 5.0)returnsnon-empty-list<float>,range('a', 'z')returnsnon-empty-list<non-empty-string>(#1510)Psl\Dict\select_keysreturn type provider: Narrows the return type to a shaped array when called with literal keys, handling keyed arrays, generic arrays, and union/iterable types (#1357)$v === falsewhere$visintis now flagged as redundant even insideforeach/for/whileloops, when the types are from fundamentally incompatible categories (#1555)CLI
--stdin-inputfor analyze, lint, and guard: Pipe unsaved buffer content from editors and use the real file path for baseline matching and issue locations. Supports path normalization for consistent baseline behavior (#1253)--onlyerror for analyze: Instead of a confusing clap suggestion,mago analyze --onlynow explains that the analyzer is not rule-based and suggests--retain-code(#774)🐛 Bug Fixes
Analyzer
too-many-argumentswhen calling dynamic callable strings,nevernarrowing afterfunction_existsfalse branch, andunreachable-else-clauseforfunction_existschecks. The scalar comparator now properly checksis_callableduring assertion contexts, andcast_atomic_to_callableuses a mixed signature (#1561)$arr[$i++]inside anisset($arr[$i])block now preserves the narrowed type by saving it before the increment side-effect invalidates it (#1556)!emptynot removingfalse/nullfrom unions: When!empty($row['key'])proves a key exists, non-array types likefalseandnullare now removed from the parent union (#1565)count()not generating NonEmptyCountable assertion:count($arr)in truthy context now properly narrows the array to non-emptyinside_loopflag when analyzing match arm conditions to fix false non-exhaustive match errorsarray_mergewith unpacked arguments:array_merge(...$lists)where$listsislist<list<int>>now correctly returnslist<int>instead ofarray<non-negative-int, int>(#1548)net_get_interfacesreturn type: Corrected the prelude stub to match PHP documentation (#1550)Linter
->notleaking across->and()boundaries: Theuse-specific-expectationsrule no longer carries the->notmodifier past->and()calls, which reset the expectation context in Pest chains (#1511)// @​mago-expect lint:halsteadsuppresses all of them (#1452)fn(array $nums) => Calculator::sum(...$nums)is no longer incorrectly suggested to be replaced withCalculator::sum(...)(#1246)Formatter
$this->and static method chains from 3 to 5 accesses, so chains like$this->tokenStorage->getToken()->getUser()->getFoo()stay on one line when they fit withinprint-width(#1451)@mago-format-ignore-nextcorrupting code in sub-expressions: The ignore marker inside match arms, arrays, or function parameters no longer leaks to the next class member, which previously duplicated raw source content (#1513)>inside&&chains now get their own group, preventing unwanted line breaks (#1562)BraceStyle,MethodChainBreakingStyle,EndOfLine, andNullTypeHintnow usesnake_casein the generated schema, with PascalCase preserved as aliases for backwards compatibility (#1530)Docblock
{@​internal ...}and other inline tags can now span multiple lines in PHPDoc comments (#1257)Codex
Database
[],*,?, or{}in their path are now treated as literal paths when they exist on disk, instead of being interpreted as glob patterns (#1459)🏗️ Internal
@psalm-asserttemplate narrowing (#1517)types_share_categoryhelper for loop-aware redundant comparison detectionis_gap_insignificanthelper for robust ignore-next marker validation🙏 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.17.0...1.18.0
v1.17.0: Mago 1.17.0Compare Source
Mago 1.17.0
Mago 1.17.0 continues the focus on analyzer accuracy with 20+ bug fixes and several new features. Highlights include detection of array access on non-array types (
false, scalars), support for PHP 8.4's#[\Deprecated]attribute, literal float arithmetic tracking, a new@suspends-fiberannotation for async code, and invalidation of memoized$thisproperties on self-method calls. The linter gains new rules for fully-qualified global imports and ambiguous constant access, plus an auto-fixer for redundant parentheses.✨ Features
Analyzer
false-array-access,possibly-false-array-access,possibly-invalid-array-access, andinvalid-array-accessissue codes report when array access is performed onfalse, scalars, or other non-array types, including assignment contexts (#1542)#[\Deprecated]PHP attribute: Functions, methods, classes, constants, and enums with the#[\Deprecated]attribute are now recognized as deprecated (#1541)@suspends-fiberannotation: A new docblock tag@suspends-fibermarks methods that suspend fibers. Calls to these methods invalidate all memoized$thisproperty narrowings, preventing false positives in async code.Revolt\EventLoop\Suspension::suspend()is recognized automatically (#1536)$this->method()calls now clear memoized$this->property types, fixing false positives where property narrowings survived across method calls that could modify them (#1536)Psl\Math\max,Psl\Math\maxva,Psl\Math\min,Psl\Math\minva, andPsl\Math\absnow use the same precise integer range providers as the built-in functions$arr[] = $val) and indexed assignment ($arr[$k] = $val) on by-reference parameters now validate against the parameter's type constraint (#1539)Linter
no-fully-qualified-global-function,no-fully-qualified-global-constant,no-fully-qualified-global-classrules: New rules that flag fully-qualified references (#1494)ambiguous-constant-accessrule: Detects ambiguous constant access patterns (#1508)redundant-parenthesesrule now has an auto-fixer (#1549)🐛 Bug Fixes
Analyzer
string('')intotruthy-mixed, which caused false redundant-condition warnings (#1534)isseton string offsets:isset($s[0])on a genericstringno longer returnstrueunconditionally - empty strings have no characters, so the result is correctlybool(#1537)parse_urlcomponent return types:parse_url()with a component argument now correctly includesfalsein the return type, since malformed URLs returnfalseregardless of the component (#1546)breakno longer drop the pre-loop empty array variant, fixing false positives wherecount($arr)was always truthy after awhile(true)loop (#1535)if (!isset($arr[$key])) { throw; }exits, empty array variants are now removed from the base variable since isset proves the array is non-emptynever-returning call (likeexit()) withoutbreakare no longer incorrectly marked as unreachable - the switch can still jump directly to those cases (#1531)if ($m === 0) { echo; }) no longer leak to subsequent code, preventing incorrect type narrowing (#1509)&&: Variables passed by reference in function calls on the left side of&&now correctly update their type for the right side evaluation (#1524)$arr[$dynamic] = valueno longer replaces the value types of existing known keys in the array (#1527)isset/emptychecks on union types with lists: The impossible-isset check now considersTArray::Listvariants in union types, and non-empty arrays with literal key types no longer produce false possibly-undefined warnings (#1512)int|int(0)are now properly handled by computing combined bounds (#1526)1000 * 0.5) now compute the actual result (float(500.0)) instead of returning unspecifiedfloat(#1540)Formatter
fits()handling of LineSuffix: Corrected line-suffix width calculation in the formatter (#1516)Prelude
getimagesize/getimagesizefromstringparam-out: Added@param-out ?arrayannotation matching the nullable parameter type (#1523)Codex
truthy-mixedno longer contains falsy values andfalsy-mixedno longer contains truthy values in type comparisons (#1534)#[\Deprecated]attribute: The codex scanner now sets the deprecated flag from PHP attributes in addition to@deprecateddocblock tags (#1541)Composer
🏗️ Internal
🙏 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.16.0...1.17.0
v1.16.0: Mago 1.16.0Compare Source
Mago 1.16.0
Mago 1.16.0 is a significant release focused on analyzer accuracy. This release fixes over 20 false positives across loop analysis, type narrowing, integer range tracking, switch fall-through handling, and comparison assertions. It also adds new features including duplicate enum value detection, argument validation hooks for
setcookie,session_set_save_handler, andsession_set_cookie_params, and improved return type inference formin,max,abs, andarray_reverse.✨ Features
Analyzer
setcookie/setrawcookie: When the 3rd argument is an array (options form), additional positional arguments are now flagged as errors (#1467, #1492)session_set_save_handler: Validates both the object form (1-2 args) and callable form (6-9 args), reporting errors for mismatched argument counts (#1468)session_set_cookie_params: When the 1st argument is an array, extra arguments are now flagged as errors (#1468)min/max/absreturn types: Multi-argumentminandmaxcalls now return precise integer range types, and a newabsprovider returns non-negative ranges (#1477, #1480)🐛 Bug Fixes
Analyzer
$total += $delta(#1491, #1493, #1499)$n++inside if-conditions had their side effects discarded when the if-body always exited, causing false "impossible condition" reports (#1504)while ($row = func())were incorrectly treated as always-true, causing variables modified inside the loop to lose their pre-loop values (#1505)defaultclause are no longer incorrectly flagged (#1484, #1485)non-negative-int) on the secondary variable in less-than comparisons no longer produce incorrect type narrowing when negated (#1503)count() === Nnot narrowing empty arrays: Empty arrays without generic parameters are now correctly removed when reconciling exact count assertions (#1506)never: Loose equality (==) with strings no longer incorrectly narrows numeric types tonever(#1488)instanceof self/instanceof static: These expressions are now properly resolved for type computation (#1464)neverproducingmixed: Operations onnevertypes now correctly propagateneverinstead of falling back tomixed(#1502)numericin string concatenation: Thenumerictype is now accepted in string concatenation operations (#1500)issetreturn type:isset()now returnstrueinstead ofboolwhen all checked values are definitely set, and array keys are marked as definite after loops that always enter (#1486, #1493)Formatter
Prelude
array_reversereturn type: Non-list arrays (e.g.,array<string, int>) now correctly preserve their key type instead of being narrowed tolist<V>(#1466)non-positive-inttype mapping: Was incorrectly mapped topositive-intdue to a copy-paste error (#1479)@deprecatedonmb_scrub: The function is not deprecated in PHP (#1476, #1481)getrusagefunction signature: Corrected the return type to match PHP documentation (#1501)iconvmode parameter: Corrected the mode parameter type toint<0, 3>(#1497)openssl_pkey_get_detailsreturn type: Made all keys optional since algorithm-specific keys are only present for their key typesession_set_save_handlerstub: Merged duplicate declarations into a single signature with union types (#1468)session_set_cookie_paramsstub: Merged duplicate declarations into a single signature (#1468)Codex
📖 Documentation
🏗️ Internal
🙏 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.15.3...1.16.0
v1.15.3: Mago 1.15.3Compare Source
Mago 1.15.3
Mago 1.15.3 is a patch release that fixes formatter idempotency issues with trailing closing tags and non-standard line endings, adds a comment placement infrastructure for stable binary expression formatting, fixes incorrect OpenSSL function signatures, and resolves a CPU spin-lock in the Composer wrapper.
✨ Features
Formatter
should_breakdecisions in binary expressions and keeps comments inside parenthesized subexpressions, fixing formatting oscillation between passes (#817, #1456)🐛 Bug Fixes
Formatter
?>is removed: The opening tag formatting decision usedsource_text.contains("?>")to detect inline PHP templates. Whenremove_trailing_close_tagremoved a trailing?>on the first pass, the second pass saw no?>and changed the formatting. Replaced with an AST walker that counts closing tags at any depth, excluding the trailing one that gets removed (#1350, #1457)\rnot recognized as line terminator: Files with\r\r\n, bare\r(classic Mac OS), or other non-standard line endings caused the formatter to merge lines and crash on multi-line block comments. Fixedskip_newline,split_lines,replace_end_of_line, andprint_commentto handle bare\ras a line terminator. Also fixedline_startsin the database crate which only scanned for\n, causing incorrect line numbering for bare-CR files (#1460, #1462)Prelude
openssl_x509_*functions incorrectly acceptedOpenSSLCertificate|falseinstead of the correctOpenSSLCertificate|stringparameter type (#1463)Composer
proc_get_statusin a tight loop with no sleep, causing 100% CPU usage on one core during--watchmode. Added a 10ms sleep interval and fixed signal-based exit code propagation (#1454, #1455)🏗️ Internal
🙏 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.15.2...1.15.3
v1.15.2: Mago 1.15.2Compare Source
Mago 1.15.2
Mago 1.15.2 is a re-release of 1.15.1 with corrected version metadata. The 1.15.1 release was tagged before the version bump was applied, causing binaries to report
1.15.0in--versionoutput and preventing publication to crates.io. This release contains no code changes beyond the version bump.For the full list of changes since 1.15.0, see the 1.15.1 release notes.
Full Changelog: carthage-software/mago@1.15.1...1.15.2
v1.15.1: Mago 1.15.1Compare Source
Mago 1.15.1
Mago 1.15.1 is a patch release that distinguishes
$thisfromstaticreturn types, reverts a formatter regression with parenthesis removal in binary expressions, and restores glibc 2.17 compatibility for the Linux GNU build.✨ Features
Codex
$thisfromstaticreturn types: Added a separateis_staticflag to the type system to properly differentiate$this(same instance) fromstatic(same class, possibly different instance). Returningnew static()from a method declared as@return $thisis now correctly flagged, whilereturn $thisremains valid.return new static()continues to be accepted for: staticreturn types (#1429)🐛 Bug Fixes
Formatter
CI/CD
x86_64-unknown-linux-gnubinary is now built with cross using the manylinux2014 container again, restoring compatibility with older Linux distributions. PGO optimization for this target has been removed as it was incompatible with the cross-compilation setup (#1431, #1433, #1434)🙏 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.15.0...1.15.1
v1.15.0: Mago 1.15.0Compare Source
Mago 1.15.0
Mago 1.15.0 brings three new linter rules, configurable
minimum-fail-levelin TOML files, automatic watch mode restarts on config changes, PGO-optimized Linux x86 builds, and a wave of analyzer and codex bug fixes improving generics, intersection types, and type inference accuracy.✨ Features
Analyzer
Psl\Type\nullish()return type provider: Added type narrowing support forPsl\Type\nullish(), complementing existing PSL type providers (#1390, #1391)Psl\Async\all()andPsl\Async\concurrently()return type providers: Both functions now preserve sealed array shapes, list structure, and non-empty status. For example,Psl\Async\all(['foo' => $awaitableString, 'bar' => $awaitableInt])correctly returnsarray{foo: string, bar: int}(#1423)Linter
no-alternative-syntaxrule: Detects alternative control structure syntax (if/endif,while/endwhile, etc.) and suggests using brace-based syntax instead (#1313)no-short-bool-castrule: Flags!!$exprdouble-negation casts and suggests using(bool) $exprfor clarity (#1312)prefer-pre-incrementrule: Suggests++$iover$i++and--$iover$i--when the return value is unused, as pre-increment avoids an unnecessary copy (#1311)no-alias-functionrule: Theno-alias-functionrule now supports automatic fixing, replacing aliased PHP functions with their canonical equivalents (#1297)CLI
minimum-fail-levelconfiguration option: Theminimum-fail-levelsetting can now be configured inmago.tomlunder[analyzer],[linter], and[guard]sections, removing the need to pass--minimum-fail-levelon every invocation. The CLI flag still overrides the config value (#1343, #1384)mago analyze --watchnow monitors the configuration file, baseline file,composer.json, andcomposer.lockfor changes and automatically restarts the analysis session when they are modified (#1402)🐛 Bug Fixes
Analyzer
ambiguous-object-method-accessaftermethod_existsnarrowing: Whenmethod_exists($this, 'foo')adds aHasMethodintersection type, calling other methods on$thisno longer falsely reports ambiguous access (#1413, #1426)stdClass&object{tags: list<Tag>}now correctly resolves the property from the shaped object part (#1387, #1421)unimplemented-abstract-property-hookwith traits: Concrete properties from used traits now correctly satisfy interface abstract property hooks (#1415, #1420)$this/staticreturn type not enforced for non-final classes: Returningnew self()from a method declared as@return $thisor: staticnow correctly reports a type mismatch in non-final classes. Anonymous classes are treated as effectively final (#1410, #1411, #1418)@extends: Template parameters inherited through@extendsannotations are now correctly resolved when accessing shaped array keys (#1412, #1414)i64::MAXtreated as int instead of float: Very large integer literals are now correctly inferred asfloat(#1405)Codex
non_empty: Empty array[]used as a default parameter value is now correctly typed asnon_empty=false, fixing false positivedocblock-type-mismatcherrors when using generic classes with default empty arrays (#1422, #1425)Linter
variable-namerule for underscore-prefixed variables: Variables starting with_(e.g.,$_unused) are no longer flagged by thevariable-namenaming rule (#1395, #1398)Box::leakwith owned storage for rule descriptions (#1408)Formatter
Type Syntax
i64::MAXare now rejected instead of silently overflowing (#1406)Syntax Core
Atom
[A-Z]range used in SIMD-accelerated case folding (#1393)Database
📖 Documentation
minimum-fail-leveloption🏗️ Internal
🙏 Thank You
Contributors
A huge thank you to everyone who contributed code to 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