public function stub(string $name): self
    {
        $hasStub = i\iterable_has_any($this->steps, function ($step) use ($name) {
            return $step[0] instanceof Stub && $step[0]->getName() === $name;
        });

        if ($hasStub) {
            throw new \BadMethodCallException("Pipeline builder already has '$name' stub");
        }

        return $this->then(new Stub($name));
    }
public function stub(string $name): self
    {
        $hasStub = i\iterable_has_any($this->steps, function ($step) use ($name) {
            return $step[0] instanceof Stub && $step[0]->getName() === $name;
        });

        if ($hasStub) {
            throw new \BadMethodCallException("Pipeline builder already has '$name' stub");
        }

        return $this->then(new Stub($name));
    }
public function stub ( string $ name ) : self { $ hasStub = i \ iterable_has_any ( $ this -> steps , function ( $ step ) use ( $ name ) { return $ step [ 0 ] instanceof Stub && $ step [ 0 ] -> getName ( ) === $ name ; } ) ; if ( $ hasStub ) { throw new \ BadMethodCallException ( "Pipeline builder already has '$name' stub" ) ; } return $ this -> then ( new Stub ( $ name ) ) ; }
Add a stub, which does nothing but can be replaced later.

@param string $name
@return static
@throw \BadMethodCallException if stub already exists
Add a stub which does nothing but can be replaced later .