Repository navigation
mago -- the parser, linter and formatter underneath -- is 1.62.0. The PHP stubs stay at 1.60.1:
bringing them forward is a step of its own.
The type checker
- A docblock that adds a shape to a class reads the properties the shape names:
@var Transaction&object{commits: int, rollbacks: int}onprivate Transaction $transaction, the
way a test types a double that extends the class and counts what it was asked. Both were reported
as undefined properties, because the native hint won over the docblock and a shape was read only
where no class was named. The same holds for a@param. Symfony's own tests write the idiom: five
false findings go there. decimal-int-string,non-decimal-int-string,non-empty-scalar,callable-arrayand
callable-objectare types --string, the scalar union, andcallable-- where they read as
class names nobody declares and silenced every check that met one. WordPress writes
decimal-int-stringin nineteen files, and now gets the findings its declared types imply.- Two refinements of one string written as an intersection are the stronger of them:
non-empty-string&non-decimal-int-stringis anon-empty-string. Kept as an intersection, a
str_replace()on one answeredstring|array. - A WordPress hash on a tag other than
@return, or one that never closes, saysarraywhere it
said nothing.
The linter
- WordPress's hash notation --
@type string $key Description.inside{ }-- is no longer an
invalid docblock: under--lint all,valid-docblockon WordPress falls from 1 180 to 6. literal-named-argument(clarity) looks at function calls only again, as before 0.1.4.
The formatter
- A method chain broken by hand inside an argument list, an assignment or a condition is laid out
differently: the enclosing list breaks and the chain is indented under it, where 0.1.5 left it
hugged in place. Reprinting four projects, 22 of 29 076 files change, 20 of them in Drupal core,
and only in line breaks and indentation.