Repository navigation
Update dependency carthage-software/mago to v1.61.0 - #38
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #38 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 5 5
===========================================
Files 1 1
Lines 15 15
===========================================
Hits 15 15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.60.2→1.61.0Release Notes
carthage-software/mago (carthage-software/mago)
v1.61.0: Mago 1.61.0Compare Source
Mago 1.61.0 adds an opt-in check for overly wide
@throwstypes, ano-legacy-constructorrule, and semantics checks for code PHP rejects. It also fixes the nested-loop slowdown from 1.60.0 and brings about 200 fixes to the analyzer, type system, and stubs.✨ Features
Analyzer
find-overly-wide-throw-typesfor@throwstypes that never escape. (#2501, #2526,f66a97a,08432a0,2c55f7a)falsevalues used as array indexes aspossibly-false-array-index. (2e08ad6)Codex
int-mask<E_ERROR, E_WARNING>. (0d40968)non-empty-scalar,callable-array,callable-objectandstringable-object. (a1ff0f8)@phpstan-sealed: reads the classes allowed to extend a class from@phpstan-sealed. (c60a9f7)Linter
no-legacy-constructor: warns about class-named constructors, which PHP 8 runs as plain methods. (#2669, #2744,2c4ffce)Semantics
8bcf464)Twig Syntax
{{ ...attributes }}in Symfony UX component tags. (#2739,1f26c4f)Reporting
5fc9c97)🐛 Bug Fixes
Analyzer
Performance
8ee16b4)mixed: stops nested loops overmixedvalues from taking exponential time. (#2763, #2764,2e518e8)Control Flow
match: keeps variables assigned in one branch, and an arm condition's narrowing in its branch. (2ac2b07,cb88a2d)switchvariables: gives a case body the variables its condition assigns, and tracks variables a case unsets. (7b41d1e,19e9c79)switchnarrowing: narrows after aswitchwhose matching cases all leave, and in emptyswitch (true)cases. (7c52b96,a117bdb)elseif: keeps variables anelseifdefines when theifexits, and drops stale negations of reassigned variables. (8d670ab,a185dc6)&&says. (b3b790e,4ec0089)voidend withoutreturn, and addsnullto untyped closures that may. (58a5da0,42e58f6)else: an unreachableelsestill ends the way its statements do. (a7cfd50)bool. (77b63a0)Loops
9201857,e97a72c,db640ff)continuepaths define. (a9e9ea1,4cd2d96)breakalso defines it, and when abreakskips it. (28ccf39,68b0d6b)forloop with no condition or a true last condition as infinite. (c598ca3)a2eeee0)foreachtargets,staticdeclarations, and nestedlist()targets. (c416fec)mixedvariable's pre-loop type, and sees offsets the loop unsets. (5febad0,285c54c)nullloop conditions: builds them from the analyzed operand type. (629bec7)??conditions: narrows a loop condition that falls back tofalsewith??. (38b58f6)isset()in loops: keeps the loop origin ofisset()values through reads, and types offsets ofmixedasmixed. (1be5986,258744e)continue: acontinuein an inner loop no longer makes a narrowed property possiblynull. (0dda743)Narrowing
is_null(), and reuses the plain fetch's narrowing. (#2740,bdc2200,17455bb)0from narrowed ints, and narrows non-empty strings other than'0'to non-falsy. (4898533,9b11f6d)nullwhen a value loosely equals0or'', and__toString()objects against strings. (fcc3234,37680ec)numericand templates correctly, and keeps objects!instanceof staticcannot rule out. (784387b,cbe82ea)elsebranch ofcount(),strlen(), and literal variable comparisons. (5f454fd)0a437fc)$var::classcompared withstatic::class, and values compared throughget_debug_type(). (4393c9a,a5ac850)++or--in a condition changes. (3f20b6f)array_key_exists(): narrows the array it finds a key in. (63335e9)isset()offsets: narrows a scalar to a string whenisset()finds an offset in it, and keeps strings. (60fc92b,f00c7be)empty()onmixedkeys: keeps their falsy values. (5a1bd94)!isset(): no longer turns the parent of a missing array key into an array. (20e8525)is_resource(),is_object(), andis_array()narrow themixedpart of a union. (0df29cb)count(): an emptycount()onmixedmay be aCountableobject. (a63ffa9)1fe44ff)assert(): applies the$thisassertions of a method call. (8d02df0)&&orcasenarrows its array. (e87ee99,eae1d4a)e158deb)55dfff8,10fd41d)dbf835a)unset()removes. (85cea22,472fcaf)Variables and References
a327d43,c65e759,4bafca0)ef2b735)globalimports: types aglobalimport of a possibly unset variable as nullable. (255a23e)7558d81,f264d9b)e36087a)extract(): no longer reports variables as undefined afterextract(). (1a2216b)++and--as assignments of their operand. (f8210a3)Arrays
array_key_first()andarray_key_last(): know that the key they return exists in the array. (#2735,b2115b6)array_merge(): places list positions only after a known prefix, returns lists for int keys, and mergesmixed. (a48add8,09bb435)[], and updates every array holding an elementunset()removes. (1adfc48,0bf5332)be61a12)4185425)int, and accepts integer strings and overlapping keys. (6475201,d53ef10)cfd35e8)bfcbb63,4b4c187)94c06d6)array_key_exists()with a string key on an int-keyed array as always false. (ddab607)is_callable()arrays: allows destructuring an array narrowed byis_callable(). (2458c2d)get_object_vars()andarray_column()resolve them in property types. (03cec3b)ArrayAccess: checksnulloffsets against the key type, and binds open type arguments on the first write. (c9baf14,fcac374)Strings and Numbers
(object)casts asstdClass, orobjectformixed, and keeps int ranges through(int). (dd88ff6,0322b19)echo,print, andincludeaccept what PHP converts to a string, such asStringable. (#2775,99d2c3a)filter_var(): types it byFILTER_DEFAULT,FILTER_FLAG_EMPTY_STRING_NULL, and array inputs. (faba6d2)parse_url()and Argon2: a parsed URL path may be empty, andPASSWORD_ARGON2_PROVIDERdepends on the build. (2a78ccb)Generics
int. (9468c98)dd8dba7)60ba88c)e5ab459)d77a02d,98f32a5)7c17eec)foreach: iterates every part of a template's bound. (1ff13c9)$thisorstaticin the class's own methods. (0e57103)df1c778)Classes and Members
parent::$x::get(). (ba5c086,f099235)@paramnarrow. (5201220)__FUNCTION__and__METHOD__in a property hook as non-empty strings. (1249900)public(set) readonly: allows initializing such properties from any scope, and rejects a wider set visibility. (8c1ff02)__unserialize(): initializes readonly properties. (c2040e2)SimpleXMLElement: types a missing offset asnull, and treats children as dynamic properties. (#2749,b99343f,61e8925)new $this(): types it asstatic. (362b4f8)16334f2,4ec5d93)parent: resolves it in overridden signatures against the declaring class, and in traits to the user's parent. (4c7d13e,f38058f)f5ea779)a281ab3)__get()and__set(). (10b1adb)a5956b0)::classon a closure toClosure. (8e2cab7)417795f,28a5d50)Callables
78a40d6,10003d3)4ff64e7)89c967f)f257b0a)a0750bb,eb84e52)staticin a first-class method callable to its receiver. (733ea09)Generator. (9b05a91)iterabletakes the type the callable expects. (2b90d85)1f6a622)Diagnostics
7bcc539)Codex
get_class(...)fitsarray_map(). (#2734,93fca6b)d575f49,6940ba6)7d5e799,3ae8300)static: resolvesstaticin iterable type arguments and inherited template arguments. (fb3d807,bbebd6e)self: resolves a trait'sselfto the using class inside nested types. (5cb5d3e)4dd6018)\define()andDEFINE()constants, and keeps every value of repeated ones. (f39f59c,44e026a)7253e9f)bcd49d1)2189c27)e46d0f3)properties-of: expands it for classes without typed instance properties. (2fe4703)32d6d60)Closure. (0f77dca)mixed: a falsy value combined with truthymixedis no longer truthy. (79569d3)class-string<object>: accepts it. (b80c4d1)Stringableequality: aStringableobject can loosely equal a string. (5cdbef1)308dbcb)PHPDoc Syntax
76fe072)92db8e2)decimal-int-stringandnon-decimal-int-string. (aad0f24)6612bec)Prelude
curl_multi_info_read(): returns aCurlHandlein its result, orfalse. (#2736, #2737,203245a,1fcdc0f)curl_share_init_persistent(): corrects its signature. (4d09352)preg_match_all()keys: allows string keys for named groups in its matches. (#2441, #2706,bb12bb1)preg_match()andpreg_match_all()by their flags. (eec3ea6)end()andprev(): keep the array's key types. (#2780, #2781,ba5706c)explode(): may return an empty list for a negative limit. (eb98d37)truereturns: typesArrayObjectandArrayIteratorsort methods andldap_free_result()as returningtrue. (30c67ca,4078a31)truenarrow the path to a non-empty string, andpathinfo()always has adirname. (3492c5b,0432fcc)proc_open()and the scanf functions may write any value;pcntl_waitpid()writes anint. (8f88102,6e5521f)stream_get_meta_data(): makes the keys PHP may leave out optional. (93dc38b)ReflectionClass::isInstance()keeps the type of an object it rejects. (4a911da)ResourceBundle: allows reading its offsets. (cb3063e)DOMNode::$childNodesholds only nodes, andSimpleXMLElement::current()is nevernull. (d2a1f74,399fc13)03473ec)RedisClusterfrom the phpredis stubs. (2dfbcec)DateIntervaldate fields are writable, andgetTimezone()may returnfalse. (ae7d093,a6e37ca)0c6ebd1)func_get_args(): returns a list, andclass_exists()and similar checks are not pure, as they may autoload. (1d56e6d)ob_start(),pcntl_signal_get_handler(), and the file time functions. (7253e69)Linter
literal-named-argument: checks method calls only with the newcheck-method-callsoption. (#2741, #2758,30291a7)no-dead-store: a write intryno longer makes an earlier one dead. (#2766,b1b037c)Semantics
1c3db8d)#[\Deprecated]: reports it on classes, interfaces, and enums. (#2745, #2746,f84fa17)ed0cd97)sethook that returns a value, and a typedgethook that returns none. (d9a8c6e)parent: reportsparentin a class-like with no parent. (87f353f)89d4723)callableproperties: reportscallableas a property type. (#2773, #2774,061da27)callable,void, andneveras class constant types. (#2776, #2777,01de7f1)$this: reports invalid uses of$this. (#2785, #2786,4a2aa36)Twig Formatter
typestags: keeps atypeshash broken when the source breaks it. (#2738,e379b51)Twig Linter
end-block-name: keeps its fixes parseable for blocks and macros named after operators such asnot. (16c5f5b)Reporting
b6b1e0d)Database
ac77719)Orchestrator
stack-size. (#2761, #2762,0af918c)PHP SDK
3dc531f)ac95e85)Namespacecases: renamesNodeKind::NamespaceandFunctionTargetKind::NamespacetoNamespace_for PHP 8.6. (#2784,1fc5946)🏗️ Internal
Testing
@implements. (bbb9215)Sponsors
e9588b7)🧩 Extension Protocol
No protocol changes in this release. The PHP SDK renames the
Namespacecases ofNodeKindandFunctionTargetKindtoNamespace_, so update extensions that use them.🙏 Thank You
Contributors
Thank you to everyone who contributed to this release:
Issue Reporters
Thank you to everyone who reported issues that shaped this release:
Full Changelog: carthage-software/mago@1.60.2...1.61.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.