File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed
Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 103103use PHPStan \Type \ThisType ;
104104use PHPStan \Type \Type ;
105105use PHPStan \Type \TypeAlias ;
106- use PHPStan \Type \GenericTypeAliasType ;
107106use PHPStan \Type \TypeAliasResolver ;
108107use PHPStan \Type \TypeAliasResolverProvider ;
109108use PHPStan \Type \TypeCombinator ;
Original file line number Diff line number Diff line change 1818use PHPStan \Type \Generic \GenericStaticType ;
1919use PHPStan \Type \Generic \TemplateType ;
2020use PHPStan \Type \Generic \TemplateTypeHelper ;
21+ use PHPStan \Type \GenericTypeAliasType ;
2122use PHPStan \Type \IntersectionType ;
2223use PHPStan \Type \MixedType ;
2324use PHPStan \Type \ObjectType ;
2425use PHPStan \Type \Type ;
25- use PHPStan \Type \GenericTypeAliasType ;
2626use PHPStan \Type \TypeTraverser ;
2727use Traversable ;
2828use function array_filter ;
Original file line number Diff line number Diff line change 1111use PHPStan \Type \Generic \TemplateTypeVarianceMap ;
1212use PHPStan \Type \Traits \LateResolvableTypeTrait ;
1313use PHPStan \Type \Traits \NonGeneralizableTypeTrait ;
14+ use function array_keys ;
1415use function array_map ;
1516use function array_merge ;
1617use function array_unique ;
@@ -68,9 +69,11 @@ public function getMissingRequiredParamNames(): array
6869 {
6970 $ missing = [];
7071 foreach ($ this ->paramNames as $ i => $ name ) {
71- if (! isset ($ this ->args [$ i ]) && $ this ->defaults [$ i ] = == null ) {
72- $ missing [] = $ name ;
72+ if (isset ($ this ->args [$ i ]) || $ this ->defaults [$ i ] ! == null ) {
73+ continue ;
7374 }
75+
76+ $ missing [] = $ name ;
7477 }
7578
7679 return $ missing ;
@@ -136,7 +139,7 @@ public function isResolvable(): bool
136139 }
137140 }
138141
139- foreach ($ this ->paramNames as $ i => $ name ) {
142+ foreach (array_keys ( $ this ->paramNames ) as $ i ) {
140143 if (!isset ($ this ->args [$ i ]) && $ this ->defaults [$ i ] === null ) {
141144 return false ;
142145 }
@@ -227,4 +230,3 @@ public function toPhpDocNode(): TypeNode
227230 }
228231
229232}
230-
Original file line number Diff line number Diff line change 1717use function array_map ;
1818use function array_values ;
1919use function count ;
20- use function array_fill ;
2120
2221final class TypeAlias
2322{
You can’t perform that action at this time.
0 commit comments