Repository navigation
Mago 1.63.0 gives checks that only a docblock type makes redundant or impossible their own issue codes, and fixes 35 bugs, most of them in the PHP stubs, the semantics checks, and the parser. Many stub fixes record the PHP version that added a symbol, so Mago now reports its use on older versions. Update pragmas and baselines that name the old codes for these checks.
✨ Features
Analyzer
- Docblock-only checks: reports a check that only a docblock type makes redundant or impossible under its own code. (3a71664)
docblock-type-contradiction replaces impossible-condition, impossible-type-comparison, impossible-null-type-comparison, impossible-key-check, impossible-nonnull-entry-check and no-value for these checks. redundant-condition-given-docblock-type replaces redundant-condition, redundant-comparison, redundant-type-comparison and similar codes. Each report notes that PHP does not check docblock types at runtime.
🐛 Bug Fixes
Analyzer
- Missing type hints: no longer asks for a native hint that PHP cannot express, such as a resource or a callable property. (eee20d2)
isset()on objects: narrows anobjecttoArrayAccesswhen anisset()check on one of its offsets passes. (3d14c32)- Magic properties: skips
non-documented-propertywhen__get()or__set()gives the property a type. (fba7a28) defined()checks: adefined()check removes theunavailable-constantreport for the constant it guards. (#2874, #2875, f25cfba)- Extension signatures: reports a missing method in a first-class callable when an extension provides signatures. (#2914, #2915, b01b12d)
Codex
- Variadic callables: accepts a callable with a variadic parameter where one with fewer parameters is expected. (#2903, #2906, a3a40d5)
- Generic first-class callables: binds templates nested in an
iterableparameter. (#2856, 6374b02)
Prelude
- Functions and constants: marks 10 functions and 27 constants that PHP 8.1 to 8.5 added with their versions. (#2866, #2867, d8766a5)
- Class members: marks 14 members that PHP 8.1 to 8.5 added to existing classes with their versions. (#2868, #2869, 81a9678)
- Date symbols: marks the date symbols that PHP 8.2, 8.3 and 8.4 added with their versions. (#2861, #2862, 19bc90e)
- Reflection members: marks the members that PHP 8.1, 8.2 and 8.4 added, and corrects two versions. (#2863, #2864, 31269b6)
- PHP 8.6 reflection: adds the new
ReflectionAttributeandReflectionParametermethods. (#2870, #2871, 8518b2b) nl_langinfo()constants: marks the constants that PHP has only from 8.2 on with their version. (#2872, #2873, 49316be)- curl symbols: marks the symbols PHP 8.1 to 8.5 added,
CURLStringFileamong them, and corrects 17 versions. (#2904, #2905, 9384719) - OpenSSL constants: marks the constants that PHP 8.3 to 8.5 added, and corrects four versions. (#2919, #2920, 4947d1a)
- Sodium symbols: marks the Ristretto255 and XChaCha20 symbols that PHP 8.1 added. (#2921, #2922, 4aaf7b4)
- Removed symbols: marks the symbols that PHP 8.0 removed, and drops two members that PHP does not have. (#2859, #2860, 2cb4a26)
- OpenSSL parameters: accepts PEM strings as certificates, and the key
openssl_csr_new()fills by reference. (#2857, #2858, 4d59504) - Phar:
PharDatano longer extendsPhar, andOPENSSL_SHA*values and inherited method types match PHP. (#2885, #2886, 3be8369) mb_parse_str(): accepts any variable as the$resultargument, as PHP does. (#2887, #2888, c3c8279)curl_multi_exec(): makes the$still_runningargument required, as PHP does. (#2889, #2890, 582eec0)- Reflection constants: fixes the values of
ReflectionClass::SKIP_*andReflectionClassConstant::IS_FINAL. (#2901, #2902, 3b2aae2) - curl constants: gives four curl constants the values PHP uses. (#2912, #2913, 2faa294)
stream_context_get_options(): types the options it returns asarray<string, array<string, mixed>>. (dc4dc0e)
Formatter
- Single named arguments:
always-break-named-arguments-listnow breaks a call with a single named argument. (#2665, #2694, 93e3a1c)
Linter
braced-string-interpolation: its fix keeps the meaning of"${name}"and"$$name". (#2877, #2878, eab52a6)
PHPDoc Syntax
- Callable type aliases: parses prefixed callable type aliases, such as
@phpstan-type, with named parameters. (#2809, #2810, 01d9d7d)
Semantics
finalproperty hooks: reports a property hook with more than onefinalmodifier. (#2893, #2894, 098edb8)- Asymmetric visibility: reports an untyped property with asymmetric visibility. (#2897, #2898, e439b73)
- Readonly promoted properties: reports an untyped readonly promoted property. (#2899, #2900, af32687)
#[\NoDiscard]: reports it on a constructor, avoidmagic method, or a property hook. (#2895, #2896, 22bdba0)neveras a class name: reportsneveras the name of a class-like from PHP 8.1 on. (#2907, #2908, 8b67d3a)
Syntax
enumas a name: parses a leadingenumas a name when no enum name follows, as inEnum::create(). (#2876, #2879, 11ec1a0)- Property hook modifiers: parses modifiers before
&, as infinal &get, as PHP does. (#2891, #2892, 3438bd8) - Heredoc indentation: reports a heredoc or nowdoc body line that lacks the closing marker's indentation. (#2909, #2910, d703abe)
🏗️ Internal
CI
- PGO builds: stops building macOS x86 binaries with profile-guided optimization. (92a38fd)
- Fuzz workspaces: seeds the fuzz workspaces with the root lockfile. (52d80e2)
🧩 Extension Protocol
No protocol changes in this release.
🙏 Thank You
Contributors
Thank you to everyone who contributed to this release:
- @amateescu: #2915
- @shu-chen-dot-ca: #2694
- @simPod: #2810
- @thunderer: #2858, #2860, #2862, #2864, #2867, #2869, #2871, #2873, #2875, #2878, #2879, #2886, #2888, #2890, #2892, #2894, #2896, #2898, #2900, #2902, #2905, #2906, #2908, #2910, #2913, #2920, #2922
Issue Reporters
Thank you to everyone who reported issues that shaped this release:
- @amateescu: #2914
- @dragosprotung: #2856
- @FluffyDiscord: #2665
- @lekoala: #2903
- @simPod: #2809
- @thunderer: #2857, #2859, #2861, #2863, #2866, #2868, #2870, #2872, #2874, #2877, #2885, #2887, #2889, #2891, #2893, #2895, #2897, #2899, #2901, #2904, #2907, #2909, #2912, #2919, #2921
- @wouterrutgers: #2876
Full Changelog: 1.62.0...1.63.0