2.1.55 #14634
ondrejmirtes
started this conversation in
General
2.1.55
#14634
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This release fixes 55 issues! 🎉
Bleeding edge 🔪
DateIntervalconstructor arguments at analysis time (#5587), Validate DateInterval $duration #14442, thanks @staabm and @VincentLanglet!MethodSignatureRule(#5584), Impure method should not be able to override pure method #14563, thanks @VincentLanglet and @staabm!define()andconstvalues against explicit types indynamicConstantNames(#5648),define('X', ..)should validate types againstdynamicConstantNames#14600, thanks @staabm and @VincentLanglet!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 🔧
$var::method()) to enable purity and side-effect checking (#5572), enum-string<BackedEnum>::from() should be considered pure #14557, phpstan could handle $class::someMethod syntax better #5020, thanks @VincentLanglet and @staabm!new self()(#5599), Detect private property which is only ever used to write to itself #14573array&callabletype (#5573), array&callable is not reported as a wrong param #14549, thanks @VincentLanglet and @staabm!numeric-stringforDateInterval::format('%a')when interval comes fromdiff()(#5674), DateInterval with int operation causes an error #1452, thanks @VincentLanglet and @staabm!Bugfixes 🐛
IssetCheckandMutatingScope::issetCheckwhen property has propagated error (#5569), False-positive nullCoalesce.property when combined with array access #14555optimizeConstantArrays(phpstan/phpstan-src@9743346)$arr[$key]existence acrossarray_search/array_find_keyvia conditional expression holders (#5552), Track $arr[$key] existence across array_search/array_find_key #14537, thanks @staabm and @VincentLanglet!array_find_key()returns null (#5693), Conditional expression false positive #14630DateInterval->daysafterDateTimeInterface->diff()(#5588), DateInterval::days should be refined to not have false values when returned from DateTimeInterface::diff #14428, thanks @staabm!*as assignment suppression insscanf/fscanfplaceholder counting (#5586), Incorrect number of sscanf placeholders detected (again) #10260, thanks @staabm and @VincentLanglet!RegexGroupParser::walkGroupAst()to prevent non-empty/non-falsy state bleeding (#5602), Matching $ with preg_match results in non-empty-string instead of string #14575, thanks @staabm and @VincentLanglet!ConstantArrayTypetoarraywhen resolving dynamic constant types (#5606), False positive: "If condition is always true" with if condition that depends on a dynamic constant #8526, thanks @VincentLanglet and @staabm!*scanf()format string placeholders (#5594), sscanf NUL terminators in format #14567, thanks @hakre!maybeinRandomIntParametersRulewhen either argument is an unboundedIntegerRangeType(#5622), Improper error for random_int params #14468, thanks @staabm and @VincentLanglet!$argcand$argvinglobalstatements (#5623),global $argvdoesn't take the same type as$argvin global scope #12392, thanks @staabm and @VincentLanglet!isAlwaysTerminatingfrom immediately-invoked callable arguments to the outer call (#5604), False positive Unreachable statement #14582, thanks @VincentLanglet!ConditionalTypewhen subject-target relationship is deterministic despite containing template types (#5631), should return X but returns Y false positive ? #11894, "Unable to resolve the template type T in call" with possible null #8048, thanks @VincentLanglet and @staabm!nullfromArgumentsNormalizer::reorderArgs()when positional args after named args create holes beyond parameter count (#5637), Internal error: Parameter signatures cannot have holes #14596, thanks @staabm and @VincentLanglet!...$argsunpacking is broken in PHP 8.0+ #9240, thanks @VincentLanglet and @staabm!BooleanAndfalsey andBooleanOrtruthy type narrowing when left and right conditions narrow different expression keys (#5595), False positive cannot assign offset #14566, Tagged union of array shapes is not refined properly when one of the members of the union makes the tag key optional #13061, Invalid identification of type when union types is used #7259, thanks @VincentLanglet!non-falsy-string == 0as always false inAccessoryNonFalsyStringType::looseCompare()(#5654), A non-falsy-string can be loosely equal to zero #14606, thanks @VincentLanglet and @staabm!TypeCombinator::union(#5660), False positive:isset()on superglobal key incorrectly reported as "always exists" #14610, thanks @staabm and @VincentLanglet!@throws voidongetIterator()when determining foreach Traversable throw points (#5666), False positive "Variable might not be defined" in try/catch for loops? #6833, thanks @staabm and @VincentLanglet!isSubTypeOfforLateResolvableTypeinUnionType::isSuperTypeOf()(#5645), Wrong Parameter #3 $x ... of method B::foo() should be contravariant with parameter $x ... of method A::foo() #10942, thanks @staabm and @VincentLanglet!array_spliceargument types (#5682), False positive with array_pop on same line as array_unshift #13510, thanks @VincentLanglet and @staabm!use ... asaliases (#5671), Case check of PHP classnames wrong when aliased #14617, thanks @VincentLanglet and @staabm!createConditionalExpressionseven when target is not tracked in the other scope (#5676), Another case of incorrect type narrowing with dependent types #14595, thanks @staabm and @VincentLanglet!TemplateTypeinIntersectionType::shuffleArray()when intersection is already a list (#5694), Preserve T in intersection with list type after sorting #14631Performance 🏎️
TypeCombinator::union()(#5629), thanks @staabm!ArrayType::isList()(#5680), thanks @staabm!Function signature fixes 🤖
opcache_get_configuration(#5424), thanks @devnix!SQLite3Result::fetchArray()(#3080), thanks @devnix!class_exists,interface_exists,trait_exists, andenum_existsas having no side effects in function metadata (#5607), rememberPossiblyImpureFunctionValues breaks class_exists check #8579, thanks @VincentLanglet and @staabm!PDOStatement::fetchAll()in function signature map (#5630), PDOStatement::fetchAll signature doesn't match the new PHP 8 format #5509, thanks @VincentLanglet and @staabm!list<mixed>fromPDOStatement::fetchAll()(#5643), PDO::fetchAll(PDO::FETCH_COLUMN) returns a list #11889, thanks @staabm and @VincentLanglet!Internals 🔍
Type::makeListMaybe()for sort functions that drop list-ness (#5611)Type::mapValueType(callable)for "same keys, transformed values" (#5611)Type::changeKeyCaseArray(?int)forarray_change_key_case(#5611)Type::filterArrayRemovingFalsey()forarray_filterno-callback path (#5611)Type::mapKeyType(callable)and use it alongsidemapValueTypein NodeScopeResolver (#5611)Type::toBitwiseNotType()for~$x(#5612)Type::toGetClassResultType()forget_class($x)(#5612)Type::toClassConstantType()for$x::class(#5612)Type::toObjectTypeForInstanceofCheck()forinstanceofRHS (#5612)Type::toObjectTypeForIsACheck()foris_a($x, $class, $allowString)(#5612)MutatingScope::getCallableParameterType(#5635), thanks @VincentLanglet!pcntl_fork()(Experiment: fork parallel workers via pcntl_fork() phpstan-src#5663)PHPSTAN_PARALLEL_FORK=1This discussion was created from the release 2.1.55.
Beta Was this translation helpful? Give feedback.
All reactions