chore(deps): update all non-major dependencies (minor) - autoclosed
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
phpstan/phpstan | require-dev | minor |
1.8.11 -> 1.9.1
|
vimeo/psalm | require-dev | minor |
4.29.0 -> 4.30.0
|
Release Notes
phpstan/phpstan
v1.9.1
🔧
Improvements -
AccessoryArrayListType
is part of BC promise (#1967), thanks @enumag! - Specify types from true/false asserts (#1957), thanks @rvanvelzen!
- Support conditional types in phpdoc asserts (#1964), thanks @rvanvelzen!
- Let casting
object
tostring
result in an error (#1948), thanks @rvanvelzen! - Add more support for
checkBenevolentUnionTypes
config (#1940), thanks @VincentLanglet! - Error on unknown parameter name in parameter conditional type (#1966), #8284, thanks @rvanvelzen!
🐛
Bugfixes - List type cast to array is still a list (#1958, #1959), #8280, thanks @rajyan!
- Fix
mt_rand
return type (#1956), #8272, thanks @enumag! -
strtr
returnsnon-empty-string
(#1963), thanks @staabm!
v1.9.0
Check out the article about this release!
🚀
Major new features -
PHPDoc-based type narrowing with
@phpstan-assert
,@phpstan-assert-if-true
,@phpstan-assert-if-false
(#1317), #7110, #8186, thanks @rvanvelzen! -
@phpstan-self-out
/@phpstan-this-out
support (#1799), thanks @rvanvelzen!- Can be used to change the type of the current object after calling a method on it. This is useful for generic mutable objects.
- Documentation
-
@param-out
support (#1804), #7231, #6871, #6186, #4372, #5785, thanks @staabm!- Can be used to specify type of function argument passed by reference
- Documentation
- Add extensible
ClassReflection::getAllowedSubTypes()
(#1477), thanks @jiripudil! - Add config parameter
checkBenevolentUnionTypes
to strictly check BenevolentUnionType (#1930), #8223, thanks @VincentLanglet!
🔪
Bleeding edge -
Array
list
type (#1751), #3311, #8185, #6243, thanks @rvanvelzen!- Lists are arrays with sequential integer keys starting at 0
- Improve error wording of the NonexistentOffset, BooleanAndConstantConditionRule, and BooleanOrConstantConditionRule (#1882), thanks @VincentLanglet!
- MissingMagicSerializationMethodsRule (#1711), #7482, thanks @staabm!
- Unescape strings in phpdoc-parser (https://github.com/phpstan/phpstan-src/commit/97786ed8376b478ec541ea9df1c450c1fbfe7461)
- Stub files validation - detect duplicate classes and functions (https://github.com/phpstan/phpstan-src/commit/ddf8d5c3859c2c75c20f525a0e2ca8b99032373a, https://github.com/phpstan/phpstan-src/commit/17e4b74335e5235d7cd6708eb687a774a0eeead4)
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
non-negative-int
andnon-positive-int
(#1803), thanks @rvanvelzen! - Optimize
NonexistentOffsetInArrayDimFetchCheck
(#1801), thanks @herndlm! - Modify the built-in
@method
extension to look at@throws
in __call (#1842), #8163, thanks @VincentLanglet! - Improve impossible type checker for void-returning functions (#1857), #8169, thanks @rvanvelzen!
- Allow using
$this
/static
in conditional return types (#1863), thanks @rvanvelzen! - Emit warnings when Xdebug is not used according to CLI flags (#1878), thanks @staabm!
- Improve array_fill return type extension (#1879), thanks @rvanvelzen!
- Add support for
mb_convert_case()
andmb_convert_kana()
(#1866), thanks @zonuexe! - Accept and describe
callable-object
andcallable-string
(#1906), thanks @rvanvelzen! - Add colon as prefix of line number in table report, when running in VSCode terminal (#1901), #8086, thanks @LeoVie!
- Cover ExtendedMethodReflection by BC promise (but not implementing it, only calling the methods) (#1913), thanks @staabm!
- Locate identifiers by type for OptimizedSingleFileSourceLocator (#1114), thanks @tomasfejfar!
- Implement
FunctionReflection
/ExtendedMethodReflection::returnsByReference()
(#1899), #6005, thanks @staabm! - Add noreturn as PseudoTypeClass (#1937), #8242, thanks @zonuexe!
- Introduce new simple ScopeFactory (https://github.com/phpstan/phpstan-src/commit/1cc337acc877bc02f1a6686fbfe38994a987fbc5)
-
MutatingScope::enterNamespace()
is part of BC promise (https://github.com/phpstan/phpstan-src/commit/92732ca8de9d479762337bbc25c629f20d096e0c)
🐛
Bugfixes - Preserve non-empty-array type when generalizing arrays (#1752), #7996, thanks @herndlm!
- There's no valid use-case to implement
Scope
orFunctionReflection
in userland class (https://github.com/phpstan/phpstan-src/commit/2796f8dd8fd5156abd8f19f4ecab2be14248782c) -
no-named-arguments
implies variadic argument is alist
(#1796), thanks @herndlm! - Fix list checking on level 7 vs. level 8 (https://github.com/phpstan/phpstan-src/commit/926058491578747d2f99ec6b02ad28c988f3c28d), #8071
- MixedType: support subtracted in array-type methods (#1852), #3370, thanks @staabm!
- Allow compare SimpleXMLElement to number (#1755), #1795, thanks @muno92!
- Fix min max call on array of union types (#1795), #8088, thanks @VincentLanglet!
- Support
Countable
incount()
(#1876), thanks @staabm! - Improve
RuleLevelHelper::accepts()
for constant arrays (#1911), #8209, thanks @rvanvelzen! - Fix closure return type based on by-ref use (#1914), #6806, #4739, #5753, #6559, #6902, #7220, thanks @rvanvelzen!
- Consider
get_object_var()
as private property read (#1902), #3654, thanks @vovochka404! - Temporary solution to handle "maybe" certainty types assign in nativeExpressionTypes (#1932), thanks @rajyan!
- Refactor arrow function scope logic to make it consistent with anonymous functions (#1935), thanks @rajyan!
- Fix static bleedingEdge toggles in tests (#1928), thanks @rvanvelzen!
- Improve unset on ConstantArrayType (#1927), #8225, thanks @VincentLanglet!
- Fix stale result cache for
@param-out
(https://github.com/phpstan/phpstan-src/commit/cf40007c004d7d24e286b8663a3d0e0ed8f3fbb7) - Fix stale result cache for arrow functions (https://github.com/phpstan/phpstan-src/commit/29690576ea459e24b3eab1d2987628c7d166ce09)
- Fix closure return type for different same-code array_map arguments in same scope (#1915), #8179, thanks @rvanvelzen!
-
$this
in nativeExpressionTypes (#1936), thanks @rajyan! - Handle ClassConstFetch in Scope (#1944), #7913, thanks @rajyan!
- Retain non-variable expression types in closure (#1929), #8205, thanks @rvanvelzen!
- Fix stale result cache for asserts (https://github.com/phpstan/phpstan-src/commit/471265fc62f30504f4a0aecf79585bef42e69213)
- Fix stale result cache for
@phpstan-self-out
(#1949), thanks @staabm!
🤖
Function signature fixes - Fix class_implements return type (#1797), thanks @enumag!
-
mb_check_encoding()
acceptsarray<string>
in PHP 7.2+ (#1867), thanks @zonuexe!
🔍
Internals - Introduce ArrayType traits (#1715), thanks @herndlm!
- Introduce
Type::getConstantArrays
as successor forTypeUtils::getOldConstantArrays
(#1684), thanks @herndlm! - Deprecate
TypeUtils::getArrays()
andTypeUtils::getAnyArrays()
(#1687), thanks @herndlm! - Add
Type::getLastIterableValueType()
(#1811), thanks @herndlm! - Add
Type::getFirstIterableValueType()
(#1811), thanks @herndlm! - Add
Type::getFirstIterableKeyType()
andType::getLastIterableKeyType()
(#1812), #8152, thanks @herndlm! - Preparation for native types (#1823), #5333, thanks @rajyan!
- Move iterable methods from array to iterable traits (#1821), thanks @herndlm!
- Do not use other traits in
JustNullableTypeTrait
(#1821), thanks @herndlm! - Add
Type::isConstantArray()
(#1822), thanks @herndlm! - Replace single
getConstantArrays()
usage withisConstantArray()
(#1827), thanks @herndlm! - Add
Type::getArraySize()
(#1828), thanks @herndlm! - Add
Type::flipArray()
(#1832), thanks @herndlm! - Add
Type::getKeysArray()
andType::getValuesArray()
(#1851), thanks @herndlm! - Implement
FunctionReflection::getDocComment()
(#1834), thanks @staabm! - Add
Type::popArray()
andType::shiftArray()
(#1847), thanks @herndlm! - Add
Type::shuffleArray()
(#1853), thanks @herndlm! - Deprecate
ConstantArrayType::generalizeToArray()
(#1856), thanks @herndlm! - Explicitly specify native type for
array_pop
/array_shift
arg (#1864), thanks @herndlm! - Replace
ArrayType::castToArrayKey()
withType::toArrayKey()
(#1841), thanks @rvanvelzen! - remove IsFloatFunctionTypeSpecifyingExtension (#1880), thanks @staabm!
- remove IsNumericFunctionTypeSpecifyingExtension (#1880), thanks @staabm!
- Remove is_bool, is_countable and is_null type specifying extensions (#1881), thanks @mad-briller!
- Add
Type::fillKeysArray()
(#1869), thanks @herndlm! - Consistently return
ErrorType
for invalid keys (#1869), thanks @herndlm! - Replace
is_(int,object,resource,scalar)
extensions with stubs (#1884), thanks @BackEndTea! - Refactor
pow()
return type extension to re-useBinaryOp\Pow
type inference (#1900), thanks @staabm! - Get rid of of
Type::getArrays()
usage inInvalidKeyInArrayDimFetchRule
(#1872), thanks @herndlm! - Add
Type::searchArray()
(#1874), thanks @herndlm! - MutatingScope: change
variableTypes
to save byexprString
(#1909), thanks @rajyan! - MutatingScope: merge
variableTypes
andmoreSpecificTypes
(#1919), thanks @rajyan! - Upgrade deprecated
::set-*
in GitHub Actions (#1917), thanks @rez1dent3! - Improve non-array specification for recently cleaned-up array functions (#1907), thanks @herndlm!
- Retain sort order in intersection type (#1906), thanks @rvanvelzen!
- Add
Type::intersectKeyArray()
(#1916), thanks @herndlm! - Changelog generator - allow excluding branch (https://github.com/phpstan/phpstan-src/commit/aaf4b7df4493d44e7ca21e2b52daa2ec2c7c5033)
- MutatingScope refactoring and regression test (#1934), thanks @rajyan!
- Refactor to save nativeTypeExpressions by ExpressionTypeHolder (#1936), thanks @rajyan!
- Merge constantTypes with expressionTypes (#1938), thanks @rajyan!
vimeo/psalm
v4.30.0
What's Changed
Features
- Enhance type detection for internal php functions
key
,current
,end
andreset
by @boesing in https://github.com/vimeo/psalm/pull/8584 - Add dictionary delta for PHP 8.2 by @lptn in https://github.com/vimeo/psalm/pull/8634
- Add support for phpstan assertions by @VincentLanglet in https://github.com/vimeo/psalm/pull/8654
Fixes
- Add additional checks for concat of non-empty strings to return non-falsy by @gphargreaves in https://github.com/vimeo/psalm/pull/8585
- Correct return type of DateTimeImmutable sub method stub by @gphargreaves in https://github.com/vimeo/psalm/pull/8583
- fix wrong php version id in $_FILES by @kkmuffme in https://github.com/vimeo/psalm/pull/8600
- #7810/improve reflection stubs by @gphargreaves in https://github.com/vimeo/psalm/pull/8592
- ensure callbacks have the required number of params by @kkmuffme in https://github.com/vimeo/psalm/pull/8594
- Fix for issue #8631 by @hamburnyog in https://github.com/vimeo/psalm/pull/8639
- Fix XMLReader::expand() nullable parameter $baseNode by @BenMorel in https://github.com/vimeo/psalm/pull/8641
- Do not report serialize as unused by @VincentLanglet in https://github.com/vimeo/psalm/pull/8650
- serialize is not pure for array of object by @VincentLanglet in https://github.com/vimeo/psalm/pull/8652
- Fix Spl file handling signatures by @neclimdul in https://github.com/vimeo/psalm/pull/8644
- Remove
argc
andargv
elements from$_ENV
by @weirdan in https://github.com/vimeo/psalm/pull/8666 - adding openssl_x509_verify by @orklah in https://github.com/vimeo/psalm/pull/8677
Internal changes
- Allow to set PHP 8.2 version by @franmomu in https://github.com/vimeo/psalm/pull/8643
- Fix assert testing callmap return types by @othercorey in https://github.com/vimeo/psalm/pull/8676
New Contributors
- @neclimdul made their first contribution in https://github.com/vimeo/psalm/pull/8644
Full Changelog: https://github.com/vimeo/psalm/compare/4.29.0...4.30.0
Configuration
-
If you want to rebase/retry this MR, click this checkbox.
This MR has been generated by Renovate Bot.