php - Is there any professional terminology for this writing method in laravel's Illuminate package?
我想大声告诉你
我想大声告诉你 2017-05-16 13:12:14
0
1
549

/**
     * Dynamically call the default driver instance.
     *
     * @param  string  $method
     * @param  array  $parameters
     * @return mixed
     */
    public function __call($method, $parameters)
    {
        return $this->guard()->{$method}(...$parameters);
    }
/**
     * Dynamically call the default driver instance.
     *
     * @param  string  $method
     * @param  array   $parameters
     * @return mixed
     */
    public function __call($method, $parameters)
    {
        return $this->driver()->$method(...$parameters);
    }
/**
     * Dynamically call the default driver instance.
     *
     * @param  string  $method
     * @param  array   $parameters
     * @return mixed
     */
    public function __call($method, $parameters)
    {
        return $this->store()->$method(...$parameters);
    }

难道叫工厂模式?

我想大声告诉你
我想大声告诉你

reply all(1)
某草草

It is the factory pattern, you see those classes are implements FactoryContract.
Then use the magic function to implement the method of calling specific factory products, where... is a variable number of parameter lists added in 5.6+,

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template