Code Duplication    Length = 8-8 lines in 2 locations

src/Tuple.php 2 locations

@@ 55-62 (lines=8) @@
52
     */
53
    final public function __construct(...$items)
54
    {
55
        if (count($items) < static::MIN_LENGTH) {
56
            throw new LengthException(sprintf(
57
                '%s expects a minimum of %d arguments but only got %d',
58
                $this::getType(),
59
                static::MIN_LENGTH,
60
                count($items)
61
            ));
62
        }
63
64
        if (count($items) > static::MAX_LENGTH) {
65
            throw new LengthException(sprintf(
@@ 64-71 (lines=8) @@
61
            ));
62
        }
63
64
        if (count($items) > static::MAX_LENGTH) {
65
            throw new LengthException(sprintf(
66
                '%s expects a maximum of %d arguments but instead got %d',
67
                $this::getType(),
68
                static::MAX_LENGTH,
69
                count($items)
70
            ));
71
        }
72
73
        $this->data = SplFixedArray::fromArray($items);
74
    }