This PR contains the following updates:
Release Notes
phpstan/phpstan (phpstan/phpstan)
Compare Source
Improvements 🔧
- Add DateIntervalFormatDynamicReturnTypeExtension (#4165), thanks @VincentLanglet!
- MatchExpressionRule - ignore
reportAlwaysTrueInLastCondition: true
(#4319), thanks @vrana!
Bugfixes 🐛
- Allow to cast resource to float (#4314), thanks @VincentLanglet!
- Fix internal error when assigning new DatePeriod into property (phpstan/phpstan-src@
c3babe1
)
- Consider assert as side effect (#4227), #12224, thanks @VincentLanglet!
- Resolve static in assert PHPDoc (#4222), #12548, #11289, #12376, thanks @VincentLanglet!
- mb_convert_encoding: Support auto encoding (#4323), #13463, thanks @VincentLanglet!
- Fix InvalidComparisonOperationRule for UnionType (#4168), #3364, thanks @VincentLanglet!
Function signature fixes 🤖
- Add more precise return types for the openssl cipher functions (#4043), thanks @stof!
Internals 🔍
Compare Source
Bleeding edge 🔪
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 🔧
- Introduce
rawMessage
key in ignoreErrors
(#4111), thanks @gharlan!
- Remember narrowed types from the constructor from deep PropertyFetches (#4315), thanks @staabm!
- Remember narrowed readonly types in nested property fetches in anonymous functions (#4313), #13321, thanks @staabm!
Bugfixes 🐛
Function signature fixes 🤖
- Treat
Redis::connect
as non-deterministic (#4318), thanks @vrana!
Internals 🔍
Compare Source
Whopping 88 issues were solved in this release! @VincentLanglet and @staabm are the true GOATs here.
Bleeding edge 🔪
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 🔧
- dynamicConstantNames - allow specifying constant type (#3583), thanks @ssigwart!
- Add ConstFetchNode support in array shape key (#4289), #5773, #6989, thanks @VincentLanglet!
- This syntax is now supported:
array{Foo::BAR: int}
- Add
*ParameterClosureThis
extensions (#4273), thanks @calebdw!
- Introduce
checkTooWideParameterOutInProtectedAndPublicMethods
(#4229), #12080, thanks @VincentLanglet!
- Place UniversalObjectCratesClassReflectionExtension last (#4207), #13342, thanks @calebdw!
- [PHP 8.5] Fix deprecation warnings with
ReflectionProperty::setAccessible()
(#4230), thanks @staabm!
- [PHP 8.5] Fix deprecation (phpstan/phpstan-src@
d36a97f
)
- [PHP 8.5] Fix deprecation (phpstan/phpstan-src@
103d193
)
- Update nikic/php-parser to 5.6.1 (phpstan/phpstan-src@
f5aae9c
)
- Resolve
array~list
as non-empty-array
(#4225), #9734, thanks @VincentLanglet!
- Add support for template bound null type (#4267), #13048, #12894, #12989, thanks @SplotyCode!
- Fix performance problem in AnnotationsPropertiesClassReflectionExtension (#4268), #13425, thanks @staabm!
- [PHP 8.5] Increment on non-numeric string is deprecated, use
str_increment()
instead (#4262), thanks @staabm!
- [PHP 8.5] Fix "Using null as an array offset is deprecated, use an empty string instead" (#4301), thanks @staabm!
- [PHP 8.5] another deprecation (phpstan/phpstan-src@
44deb6b
)
- MatchExpressionRule - ignore
reportAlwaysTrueInLastCondition
with enums (#4286), thanks @vrana!
- Respect rule level in InvalidKeyInArrayDimFetchRule (#4166), thanks @VincentLanglet!
- Improve
TypeCombinator::unionWithSubtractedType
(#4200), thanks @VincentLanglet!
- Update
curl_getinfo()
return types (#4279), thanks @FeBe95!
- Detect more possibly-nonexistent offset types (#4164), #1061, thanks @VincentLanglet!
- Allow
ReflectionClass<covariant X>
even on PHP 8.3- (phpstan/phpstan-src@9435151
), #13452
- Report always true/false comparison against
null
only for native properties without native type (phpstan/phpstan-src@802fa6e
), #11609
- Report accessing private properties on non-final classes in
??
condition (phpstan/phpstan-src@9e24fa2
), #12645
- ConsistentConstructorDeclarationRule (phpstan/phpstan-src@
66af941
)
- Check
new static()
arguments when paired with @phpstan-consistent-constructor
(phpstan/phpstan-src@4274cfb
)
Bugfixes 🐛
- Resolve
static
type in method @throws
(#4128), #11900, thanks @VincentLanglet!
- Fix wrong inference on preg_match != false (#4223), #11708, #11908, thanks @VincentLanglet!
- ObjectShapeType - do not access
Type::getProperty()
before making sure Type::hasProperty()
is yes (phpstan/phpstan-src@3beb667
), #13424
- Fix plus operator with constant arrays (#4266), #11912, thanks @SplotyCode!
- Fix false positive about assign to protected property from a subclass (phpstan/phpstan-src@
6bf3ce7
), #13123
- Prevent infinite recursion when describing template type with default value (phpstan/phpstan-src@
c5d7128
), #13163
- Fix FilterFunctionReturnTypeHelper for
FILTER_*
constants redeclared with wrong type (#4199), #10483, #10661, thanks @VincentLanglet!
- Fix for unmatched ignored trait error being reported with partial analysis (phpstan/phpstan-src@
cd6b3fd
)
- Fix Promoted vs. regular property inconsistency with generics (#4157), #13049, thanks @sayuprc!
- Note already loaded
vendor/hoa/protocol/Wrapper.php
in __composer_autoload_files
(#4275), #13369
- Make DOMNamedNodeMap generic (#4211), #13365, thanks @stefanfisk!
- Fix hasOffsetValueType with object (#4272), thanks @VincentLanglet!
- Handle default parameter value in
@phpstan-assert
(#4226), #9435, thanks @VincentLanglet!
- Do not report non existent offset when it s an array creation (#4204), #12447, #7286, #3803, thanks @VincentLanglet!
- Escape tag in githubErrorFormatter (#4198), #10051, thanks @VincentLanglet!
- Fix hasOffsetValueType for arrays (#4277), #13455, thanks @VincentLanglet!
- Fix non-final object cast to array (#4167), #2730, thanks @VincentLanglet!
- Fix
ConstantFloatType::toString
(#4278), #12225, thanks @VincentLanglet!
- Fix array_map with accessory HasOffsetValueType (phpstan/phpstan-src@
e8b3111
), https://redirect.github.com/phpstan/phpstan/discussions/13395
- Improve implode signature (#4159), #5760, #12079, thanks @VincentLanglet!
- Check magic methods on final classes for allow dynamic properties (#4285), #13450, thanks @calebdw!
- Stop PHPDoc arrays with specified key type being converted to iterables when the native type is iterable (phpstan/phpstan-src@
b042caa
), #13411
- Faster
ArrayType::hasOffsetValueType()
(#4288), #13455, thanks @staabm!
- Fix false positive of function.alreadyNarrowedType (function call variable assignment) (#4237), #13268, #12087, #9666, #9445, #7773 thanks @staabm!
- Improve ReplaceFunctionsDynamicReturnTypeExtension (#4023), #9870, thanks @VincentLanglet!
- Fix count inferences (#4149), #13111, thanks @VincentLanglet!
- Fix ImpossibleInstanceOfRule (#4154), #10036, thanks @VincentLanglet!
- Fix
array_column
inference (#4201), #10367, thanks @VincentLanglet!
non-empty-array
might be empty after array_keys()
with filter (#4295), #13377, thanks @staabm!
- Allow possibly undefined property on left side of
??
(phpstan/phpstan-src@a06db02
), #11424, #10379
- Fix incorrect analyzing of array_shift with non-empty-list property (#4294), #13438, #2888, #3387, #2560, #2457, #11846, thanks @staabm!
- Implemented NativeTypeExpr (#4302), #10595, #11322, thanks @staabm!
- Fix bug with nested methods in anonymous classes in methods (phpstan/phpstan-src@
c985b85
)
- Fix call to ParserNodeTypeToPHPStanType in FunctionDefinitionCheck (phpstan/phpstan-src@
71f22e7
)
- ClosureTypeFactory - fix
static
return type resolution in closure (phpstan/phpstan-src@6b9644e
, phpstan/phpstan-src@af3f105
), #13298
- Fix while loop inside another loop during scope stabilization phase (phpstan/phpstan-src@
94b6012
), #13385
- PHPDoc tag
@phpstan-consistent-constructor
no longer requires constructor to exist (phpstan/phpstan-src@b7e305f
), #11316
- Fix ConsistentConstructorRule (phpstan/phpstan-src@
b6ad10a
)
- Fix NewStaticRule when there's
@phpstan-consistent-constructor
but constructor implementation is in a parent (phpstan/phpstan-src@be3c27a
), #10722
Function signature fixes 🤖
- Remove some Ds stubs from functionMap (#4218), thanks @VincentLanglet!
- Remove som AMQP stubs for functionMap (#4217), thanks @VincentLanglet!
- Remove some solr definition in functionMap (#4219), thanks @VincentLanglet!
- Remove more solr definition (#4221), thanks @VincentLanglet!
- Remove useless reflection stubs (#4232), thanks @VincentLanglet!
- Remove methods similar to phpstorm stubs (#4231), thanks @VincentLanglet!
- Fix PDOStatement getIterator return type (#3974), #8886, thanks @mbolli!
- Fix
RedisCluster::scan
signature (#4195), thanks @DKhalil!
- Improve debug_backtrace args type (phpstan/phpstan-src@
864e4f6
)
- Better
Exception::getTrace()
return type (#4264), thanks @keradus!
- Declare assert-if-true for filesystem functions (#4234), #6788, thanks @staabm!
- Fix session_set_cookie_params signature (#4194), #7772, thanks @VincentLanglet!
- Fix
SimpleXMLElement::offsetSet
(#4196), thanks @VincentLanglet!
- Remove ownerDocument stub (#4197), thanks @VincentLanglet!
- Fix
RedisCluster::multi()
return type (#4283), #13392, thanks @sayuprc!
- Update
xml_*_handler
signature (#4254), #9970, thanks @VincentLanglet!
Internals 🔍
- Move isOffsetAccessLegal to MaybeOffsetAccessibleTypeTrait (#4205), thanks @VincentLanglet!
- Add phpdoc for generators in unit tests (#4212), thanks @Flyingmana!
- Added regression test (#4216), #13310, thanks @staabm!
- Get rid of couple
instanceof *Type
checks in TypeCombinator (#4244), thanks @canvural!
- Remove unused
shouldGeneralizeInferredType
method from template type classes (#4269), thanks @SplotyCode!
- Extract TooWideReturnTypeCheck (#4260), thanks @staabm!
- Add non regression test (#4176), #3761, thanks @VincentLanglet!
- Regression test (#4182), #4993, thanks @VincentLanglet!
- Simplify tests in which treatPhpDocTypesAsCertain is always true (#4274), thanks @staabm!
- Remove obsolete note (phpstan/phpstan-src@
6238750
)
- Add PHPDoc types for iterators in unit tests (#4276), thanks @Flyingmana!
- Simplify ParametersAcceptorSelector (#4160), thanks @staabm!
- Added regression test (#4241), #10312, thanks @staabm!
- Add
PhpFunctionFromParserNodeReflection::isMethodOrPropertyHook()
(phpstan/phpstan-src@2c53ed6
), #13393
- Regression tests (phpstan/phpstan-src@
dcda566
), #7824, #10819
- Regression test (phpstan/phpstan-src@
3380dc5
), #9204
- Use phpstan/build-cs (phpstan/phpstan-src@
ecfd995
)
- Regression test (phpstan/phpstan-src@
7870d2d
), #13135
- Add non regression test(#4175), #3616, thanks @VincentLanglet!
- Add non regression test (#4181), #4809, thanks @VincentLanglet!
- Add non regression test (#4183), #5206, thanks @VincentLanglet!
- Add non regression test (#4189), #13267, thanks @VincentLanglet!
- Add non regression tests (#4280), #11761, thanks @VincentLanglet!
- Regression test (phpstan/phpstan-src@
0e706b3
), #4532
- Regression test (phpstan/phpstan-src@
305e592
), #10492
- Regression test (phpstan/phpstan-src@
bfa860e
), #8668
- Added regression test (#4300), #12273, thanks @staabm!
- Added regression test (#4306), thanks @staabm!
- Added regression test (#4308), #7225, thanks @staabm!
- Added regression test (#4310), #13469, thanks @staabm!
- If condition analysis improvement (phpstan/phpstan-src@
e4eae3b
)
- isFinal can be asked outside of
$constructor instanceof PhpMethodReflection
(phpstan/phpstan-src@85fd1a4
)
sebastianbergmann/phpunit (phpunit/phpunit)
v9.6.27
: PHPUnit 9.6.27
Compare Source
Changed
- #6366: Exclude
__sleep()
and __wakeup()
from test double code generation on PHP >= 8.5
Learn how to install or update PHPUnit 9.6 in the documentation.
Keep up to date with PHPUnit:
- You can follow @phpunit@phpc.social to stay up to date with PHPUnit's development.
- You can subscribe to the PHPUnit Updates newsletter to receive updates about and tips for PHPUnit.
v9.6.26
: PHPUnit 9.6.26
Compare Source
Changed
- Implement
__serialize()
in addition to __sleep()
(which will be deprecated in PHP 8.5)
Learn how to install or update PHPUnit 9.6 in the documentation.
Keep up to date with PHPUnit:
- You can follow @phpunit@phpc.social to stay up to date with PHPUnit's development.
- You can subscribe to the PHPUnit Updates newsletter to receive updates about and tips for PHPUnit.
Configuration
📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.
This PR contains the following updates:
2.1.22
->2.1.25
9.6.25
->9.6.27
Release Notes
phpstan/phpstan (phpstan/phpstan)
v2.1.25
Compare Source
Improvements 🔧
reportAlwaysTrueInLastCondition: true
(#4319), thanks @vrana!Bugfixes 🐛
c3babe1
)Function signature fixes 🤖
Internals 🔍
v2.1.24
Compare Source
Bleeding edge 🔪
rawMessage
in baseline generators (#4317), thanks @gharlan!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
: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 🔧
rawMessage
key inignoreErrors
(#4111), thanks @gharlan!Bugfixes 🐛
str_increment
(phpstan/phpstan-src@e4c5865
), #1348107a010f
), #13492Function signature fixes 🤖
Redis::connect
as non-deterministic (#4318), thanks @vrana!Internals 🔍
symfony/polyfill-php83
(phpstan/phpstan-src@e4c5865
), #13481, thanks @staabm!v2.1.23
Compare Source
Whopping 88 issues were solved in this release! @VincentLanglet and @staabm are the true GOATs here.
Bleeding edge 🔪
BcMath\Number
(#3995), #13001, thanks @schlndh!bool
type as too-wide when onlytrue
orfalse
is assigned (#4243), #13384, 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
: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 🔧
array{Foo::BAR: int}
*ParameterClosureThis
extensions (#4273), thanks @calebdw!checkTooWideParameterOutInProtectedAndPublicMethods
(#4229), #12080, thanks @VincentLanglet!ReflectionProperty::setAccessible()
(#4230), thanks @staabm!d36a97f
)103d193
)f5aae9c
)array~list
asnon-empty-array
(#4225), #9734, thanks @VincentLanglet!str_increment()
instead (#4262), thanks @staabm!44deb6b
)reportAlwaysTrueInLastCondition
with enums (#4286), thanks @vrana!TypeCombinator::unionWithSubtractedType
(#4200), thanks @VincentLanglet!curl_getinfo()
return types (#4279), thanks @FeBe95!ReflectionClass<covariant X>
even on PHP 8.3- (phpstan/phpstan-src@9435151
), #13452null
only for native properties without native type (phpstan/phpstan-src@802fa6e
), #11609??
condition (phpstan/phpstan-src@9e24fa2
), #1264566af941
)new static()
arguments when paired with@phpstan-consistent-constructor
(phpstan/phpstan-src@4274cfb
)Bugfixes 🐛
static
type in method@throws
(#4128), #11900, thanks @VincentLanglet!Type::getProperty()
before making sureType::hasProperty()
is yes (phpstan/phpstan-src@3beb667
), #134246bf3ce7
), #13123c5d7128
), #13163FILTER_*
constants redeclared with wrong type (#4199), #10483, #10661, thanks @VincentLanglet!cd6b3fd
)vendor/hoa/protocol/Wrapper.php
in__composer_autoload_files
(#4275), #13369@phpstan-assert
(#4226), #9435, thanks @VincentLanglet!ConstantFloatType::toString
(#4278), #12225, thanks @VincentLanglet!e8b3111
), https://redirect.github.com/phpstan/phpstan/discussions/13395b042caa
), #13411ArrayType::hasOffsetValueType()
(#4288), #13455, thanks @staabm!array_column
inference (#4201), #10367, thanks @VincentLanglet!non-empty-array
might be empty afterarray_keys()
with filter (#4295), #13377, thanks @staabm!??
(phpstan/phpstan-src@a06db02
), #11424, #10379c985b85
)71f22e7
)static
return type resolution in closure (phpstan/phpstan-src@6b9644e
, phpstan/phpstan-src@af3f105
), #1329894b6012
), #13385@phpstan-consistent-constructor
no longer requires constructor to exist (phpstan/phpstan-src@b7e305f
), #11316b6ad10a
)@phpstan-consistent-constructor
but constructor implementation is in a parent (phpstan/phpstan-src@be3c27a
), #10722Function signature fixes 🤖
RedisCluster::scan
signature (#4195), thanks @DKhalil!864e4f6
)Exception::getTrace()
return type (#4264), thanks @keradus!SimpleXMLElement::offsetSet
(#4196), thanks @VincentLanglet!RedisCluster::multi()
return type (#4283), #13392, thanks @sayuprc!xml_*_handler
signature (#4254), #9970, thanks @VincentLanglet!Internals 🔍
instanceof *Type
checks in TypeCombinator (#4244), thanks @canvural!shouldGeneralizeInferredType
method from template type classes (#4269), thanks @SplotyCode!6238750
)PhpFunctionFromParserNodeReflection::isMethodOrPropertyHook()
(phpstan/phpstan-src@2c53ed6
), #13393dcda566
), #7824, #108193380dc5
), #9204ecfd995
)7870d2d
), #131350e706b3
), #4532305e592
), #10492bfa860e
), #8668e4eae3b
)$constructor instanceof PhpMethodReflection
(phpstan/phpstan-src@85fd1a4
)sebastianbergmann/phpunit (phpunit/phpunit)
v9.6.27
: PHPUnit 9.6.27Compare Source
Changed
__sleep()
and__wakeup()
from test double code generation on PHP >= 8.5Learn how to install or update PHPUnit 9.6 in the documentation.
Keep up to date with PHPUnit:
v9.6.26
: PHPUnit 9.6.26Compare Source
Changed
__serialize()
in addition to__sleep()
(which will be deprecated in PHP 8.5)Learn how to install or update PHPUnit 9.6 in the documentation.
Keep up to date with PHPUnit:
Configuration
📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.