Eloquent\Phony\Mock\Builder\MockBuilder::addStaticMethod PHP Method

addStaticMethod() public method

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