search

Home  >  Q&A  >  body text

php - Is there any professional terminology for this writing method in laravel's Illuminate package?

/**
     * 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);
    }

难道叫工厂模式?

我想大声告诉你我想大声告诉你2845 days ago586

reply all(1)I'll reply

  • 某草草

    某草草2017-05-16 13:14:14

    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+,

    reply
    0
  • Cancelreply