33namespace  PHPStan \Type \Constant ;
44
55use  PHPStan \ShouldNotHappenException ;
6+ use  PHPStan \TrinaryLogic ;
67use  PHPStan \Type \Accessory \AccessoryArrayListType ;
78use  PHPStan \Type \Accessory \NonEmptyArrayType ;
89use  PHPStan \Type \Accessory \OversizedArrayType ;
@@ -42,14 +43,14 @@ private function __construct(
4243private  array  $ valueTypes
4344private  array  $ nextAutoIndexes
4445private  array  $ optionalKeys
45- private  bool  $ isList
46+ private  TrinaryLogic $ isList
4647)
4748{
4849}
4950
5051public  static  function  createEmpty (): self 
5152{
52- return  new  self ([], [], [0 ], [], true );
53+ return  new  self ([], [], [0 ], [], TrinaryLogic:: createYes () );
5354}
5455
5556public  static  function  createFromConstantArray (ConstantArrayType $ startArrayTypeself 
@@ -59,7 +60,7 @@ public static function createFromConstantArray(ConstantArrayType $startArrayType
5960$ startArrayTypegetValueTypes (),
6061$ startArrayTypegetNextAutoIndexes (),
6162$ startArrayTypegetOptionalKeys (),
62- $ startArrayTypeisList ()-> yes () ,
63+ $ startArrayTypeisList (),
6364);
6465
6566if  (count ($ startArrayTypegetKeyTypes ()) > self ::ARRAY_COUNT_LIMIT ) {
@@ -162,7 +163,7 @@ public function setOffsetValueType(?Type $offsetType, Type $valueType, bool $opt
162163$ minmin ($ this nextAutoIndexes );
163164$ maxmax ($ this nextAutoIndexes );
164165if  ($ offsetTypegetValue () > $ min
165- $ this isList  = false ;
166+ $ this isList  = TrinaryLogic:: createNo () ;
166167}
167168if  ($ offsetTypegetValue () >= $ max
168169/** @var int|float $newAutoIndex */ 
@@ -177,7 +178,7 @@ public function setOffsetValueType(?Type $offsetType, Type $valueType, bool $opt
177178}
178179}
179180} else  {
180- $ this isList  = false ;
181+ $ this isList  = TrinaryLogic:: createNo () ;
181182}
182183
183184if  ($ optional
@@ -191,7 +192,7 @@ public function setOffsetValueType(?Type $offsetType, Type $valueType, bool $opt
191192return ;
192193}
193194
194- $ this isList  = false ;
195+ $ this isList  = TrinaryLogic:: createNo () ;
195196
196197$ scalarTypes$ offsetTypegetConstantScalarTypes ();
197198if  (count ($ scalarTypes0 ) {
@@ -254,7 +255,7 @@ public function setOffsetValueType(?Type $offsetType, Type $valueType, bool $opt
254255if  ($ offsetTypenull ) {
255256$ offsetTypeunion (...array_map (static  fn  (int  $ indexnew  ConstantIntegerType ($ index$ this nextAutoIndexes ));
256257} else  {
257- $ this isList  = false ;
258+ $ this isList  = TrinaryLogic:: createNo () ;
258259}
259260
260261$ this keyTypes [] = $ offsetType
@@ -297,7 +298,7 @@ public function getArray(): Type
297298$ arrayintersect ($ arraynew  OversizedArrayType ());
298299}
299300
300- if  ($ this isList ) {
301+ if  ($ this isList -> yes () ) {
301302$ arrayintersectWith ($ array
302303}
303304
@@ -306,7 +307,7 @@ public function getArray(): Type
306307
307308public  function  isList (): bool 
308309{
309- return  $ this isList ;
310+ return  $ this isList -> yes () ;
310311}
311312
312313}
0 commit comments