Skip to content

Commit

Permalink
Stan fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smoren committed Mar 12, 2024
1 parent 65271f8 commit 371745b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Structs/Slice.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Slice
*/
public static function toSlice($s): Slice
{
/** @var mixed $s */
if ($s instanceof Slice) {
return $s;
}
Expand All @@ -42,6 +43,7 @@ public static function toSlice($s): Slice
throw new ValueError("Invalid slice: \"{$str}\".");
}

/** @var string $s */
$slice = self::parseSliceString($s);

return new Slice(...$slice);
Expand Down Expand Up @@ -92,7 +94,7 @@ public static function isSliceArray($s): bool
return false;
}

if (!(\count($s) >= 0 && \count($s) <= 3)) {
if (\count($s) > 3) {
return false;
}

Expand Down

0 comments on commit 371745b

Please sign in to comment.