This release closes 25 issues! 🎉
Major new features 🚀
- PHP 8.3 - support for natively typed class constants (RFC)
- PHP 8.3 - support for
#[\Override]
attribute (phpstan/phpstan-src@e9a5639) (RFC)- New configuration option:
checkMissingOverrideMethodAttribute
(https://phpstan.org/config-reference#checkmissingoverridemethodattribute) (phpstan/phpstan-src@ac4d3de)
- New configuration option:
Bleeding edge 🔪
- Detect overriding
@final
method in OverridingMethodRule, #9135 - MethodSignatureRule - look at abstract trait method (phpstan/phpstan-src@5fd8cee)
- MagicConstantContextRule (#2741), #10099, thanks @staabm!
If you want to see the shape of things to come and adopt bleeding edge features early, you can include this config file in your project's phpstan.neon
:
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
Of course, there are no backwards compatibility guarantees when you include this file. The behaviour and reported errors can change in minor versions with this file included. Learn more
Improvements 🔧
- Add ConstantsInTraitsRule (#2718), thanks @paulbalandan!
- Add NoncapturingCatchRule (#2721), #8663, thanks @paulbalandan!
- Detect non-abstract methods with no body (#2730), #4244, thanks @paulbalandan!
- Detect properties declared in interface (#2731), #8915, thanks @paulbalandan!
- Add VariadicParametersDeclarationRule (#2733), #3802, thanks @paulbalandan!
- Add InvalidCallablePropertyTypeRule (#2745), #4424, thanks @paulbalandan!
- ConflictingTraitConstantsRule (phpstan/phpstan-src@f94a3c3)
- Read class constant type when generalizing the type for
dynamicConstantNames
(phpstan/phpstan-src@cb9571b) - Rework prototype searching in OverridingMethodRule (phpstan/phpstan-src@4b2ffb8), #10101, #7541, #10043, #7859, #8081, #8500, #9014
- OverridingMethodRule - search for method prototype in traits (phpstan/phpstan-src@2df14af)
- VarTagTypeRuleHelper: fix widening array shapes (#2738), #10130, thanks @janedbal!
- Note about Xdebug with
--debug
(phpstan/phpstan-src@c534f8c) - FunctionSignatureMapProvider - cache data statically (phpstan/phpstan-src@394064b), #10039
Bugfixes 🐛
- Star projection is always within template type bounds (#2715), #10097, thanks @jiripudil!
- Support
non-empty-string
instr_shuffle()
(#2717), thanks @staabm! - Look if userland prototype has
ReturnTypeWillChange
or not (phpstan/phpstan-src@eb0c7a1), #9615 - Fix wrong tip about returning a list (phpstan/phpstan-src@00adfaa, phpstan/phpstan-src@00a9d94)
- Fix parameter names for multi-variant functions (#2726), #9018, #9399, #9923, #9823, thanks @schlndh!
- Fix iterator_to_array, iterator_count for PHP 8.2 (#2625), #9793, #7760, thanks @schlndh!
- Update array_filter signature to allow null as callback (#2740) (#2740), thanks @andyexeter!
Function signature fixes 🤖
- Fix return value of
mailparse_msg_get_part()
(#2722), thanks @jlherren! - Update functionMaps (#2699), thanks @zonuexe!
- Change
iptcparse
return type (#2727), thanks @ManuelHu!
Internals 🔍
- Create DirectoryCreator helper class (#2697), thanks @CalebDW!
- Use PHP 8.3 in Name Collision Detector (phpstan/phpstan-src@8cd239e)
- Golden test for reflection (#2679), thanks @schlndh!
- Fully qualify the name of the
#[\Override]
attribute in error messages (#10136), thanks @TimWolla! - RuleTestCase - allow null tip (phpstan/phpstan-src@f384b43)