Eloquent\Phony\Mock\Builder\MockBuilder::addMethod PHP Метод

addMethod() публичный Метод

Add a custom method.
public addMethod ( string $name, callable | null $callback = null )
$name string The name.
$callback callable | null The callback.
    public function addMethod($name, $callback = null)
    {
        if ($this->isFinalized) {
            throw new FinalizedMockException();
        }
        if (!$callback) {
            $callback = $this->emptyCallback;
        }
        $this->customMethods[$name] = array($callback, $this->invocableInspector->callbackReflector($callback));
        return $this;
    }