public function invoke($callable, $arguments = []): self
    {
        // If one argument given for each iteration, create an array for it.
        if (!\is_array($arguments)) {
            $arguments = \array_fill(
                0,
                \count($this->getArray(), \COUNT_NORMAL),
                $arguments
            );
        }

        // If the callable has arguments, pass them.
        if ($arguments) {
            $array = \array_map($callable, $this->getArray(), $arguments);
        } else {
            $array = $this->map($callable);
        }

        return static::create(
            $array,
            $this->iteratorClass,
            false
        );
    }
public function invoke($callable, $arguments = []): self
    {
        // If one argument given for each iteration, create an array for it.
        if (!\is_array($arguments)) {
            $arguments = \array_fill(
                0,
                \count($this->getArray(), \COUNT_NORMAL),
                $arguments
            );
        }

        // If the callable has arguments, pass them.
        if ($arguments) {
            $array = \array_map($callable, $this->getArray(), $arguments);
        } else {
            $array = $this->map($callable);
        }

        return static::create(
            $array,
            $this->iteratorClass,
            false
        );
    }
public function invoke ( $ callable , $ arguments = [ ] ) : self { // If one argument given for each iteration, create an array for it. if ( ! \ is_array ( $ arguments ) ) { $ arguments = \ array_fill ( 0 , \ count ( $ this -> getArray ( ) , \ COUNT_NORMAL ) , $ arguments ) ; } // If the callable has arguments, pass them. if ( $ arguments ) { $ array = \ array_map ( $ callable , $ this -> getArray ( ) , $ arguments ) ; } else { $ array = $ this -> map ( $ callable ) ; } return static :: create ( $ array , $ this -> iteratorClass , false ) ; }
Invoke a function on all of an array's values.

@param callable $callable
@param mixed    $arguments

@return static
<p>(Immutable)</p>
Invoke a function on all of an array s values .