File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -913,23 +913,10 @@ public function shiftArray(): Type
913913
914914 public function shuffleArray (): Type
915915 {
916- $ valuesArray = $ this ->getValuesArray ();
916+ $ builder = ConstantArrayTypeBuilder::createFromConstantArray ($ this ->getValuesArray ());
917+ $ builder ->degradeToGeneralArray ();
917918
918- $ isIterableAtLeastOnce = $ valuesArray ->isIterableAtLeastOnce ();
919- if ($ isIterableAtLeastOnce ->no ()) {
920- return $ valuesArray ;
921- }
922-
923- $ generalizedArray = new ArrayType ($ valuesArray ->getIterableKeyType (), $ valuesArray ->getIterableValueType ());
924-
925- if ($ isIterableAtLeastOnce ->yes ()) {
926- $ generalizedArray = TypeCombinator::intersect ($ generalizedArray , new NonEmptyArrayType ());
927- }
928- if ($ valuesArray ->isList ->yes ()) {
929- $ generalizedArray = TypeCombinator::intersect ($ generalizedArray , new AccessoryArrayListType ());
930- }
931-
932- return $ generalizedArray ;
919+ return $ builder ->getArray ();
933920 }
934921
935922 public function sliceArray (Type $ offsetType , Type $ lengthType , TrinaryLogic $ preserveKeys ): Type
You can’t perform that action at this time.
0 commit comments