File tree 1 file changed +3
-16
lines changed
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
913
913
914
914
public function shuffleArray (): Type
915
915
{
916
- $ valuesArray = $ this ->getValuesArray ();
916
+ $ builder = ConstantArrayTypeBuilder::createFromConstantArray ($ this ->getValuesArray ());
917
+ $ builder ->degradeToGeneralArray ();
917
918
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 ();
933
920
}
934
921
935
922
public function sliceArray (Type $ offsetType , Type $ lengthType , TrinaryLogic $ preserveKeys ): Type
You can’t perform that action at this time.
0 commit comments