Code Duplication    Length = 18-18 lines in 2 locations

src/Arrayy.php 2 locations

@@ 5078-5095 (lines=18) @@
5075
     * @phpstan-param  array<TKey,T> ...$args
5076
     * @phpstan-return static<TKey,T>
5077
     */
5078
    public function push(...$args)
5079
    {
5080
        $this->generatorToArray();
5081
5082
        if (
5083
            $this->checkPropertyTypes
5084
            &&
5085
            $this->properties !== []
5086
        ) {
5087
            foreach ($args as $key => $value) {
5088
                $this->checkType($key, $value);
5089
            }
5090
        }
5091
5092
        \array_push($this->array, ...$args);
5093
5094
        return $this;
5095
    }
5096
5097
    /**
5098
     * Get a random value from the current array.
@@ 6947-6964 (lines=18) @@
6944
     * @phpstan-param  array<TKey,T> ...$args
6945
     * @phpstan-return static<TKey,T>
6946
     */
6947
    public function unshift(...$args): self
6948
    {
6949
        $this->generatorToArray();
6950
6951
        if (
6952
            $this->checkPropertyTypes
6953
            &&
6954
            $this->properties !== []
6955
        ) {
6956
            foreach ($args as $key => $value) {
6957
                $this->checkType($key, $value);
6958
            }
6959
        }
6960
6961
        \array_unshift($this->array, ...$args);
6962
6963
        return $this;
6964
    }
6965
6966
    /**
6967
     * Tests whether the given closure return something valid for all elements of this array.