public function unique(): self
    {
        // INFO: \array_unique() can't handle e.g. "stdClass"-values in an array

        $this->array = $this->reduce(
            static function ($resultArray, $value) {
                if (!\in_array($value, $resultArray, true)) {
                    $resultArray[] = $value;
                }

                return $resultArray;
            },
            []
        )->getArray();
        $this->generator = null;

        return $this;
    }
public function unique(): self
    {
        // INFO: \array_unique() can't handle e.g. "stdClass"-values in an array

        $this->array = $this->reduce(
            static function ($resultArray, $value) {
                if (!\in_array($value, $resultArray, true)) {
                    $resultArray[] = $value;
                }

                return $resultArray;
            },
            []
        )->getArray();
        $this->generator = null;

        return $this;
    }
public function unique ( ) : self { // INFO: \array_unique() can't handle e.g. "stdClass"-values in an array $ this -> array = $ this -> reduce ( static function ( $ resultArray , $ value ) { if ( ! \ in_array ( $ value , $ resultArray , true ) ) { $ resultArray [ ] = $ value ; } return $ resultArray ; } , [ ] ) -> getArray ( ) ; $ this -> generator = null ; return $ this ; }
Return a duplicate free copy of the current array.

@return static
<p>(Mutable)</p>
Return a duplicate free copy of the current array .