每天laravel-20160802| Container -5

来源:互联网 发布:淘宝作图教程 编辑:程序博客网 时间:2024/06/07 04:08
    /**     * Get the Closure to be used when building a type.     * Get the Closure to be used when building a type.     * @param  string  $abstract     * @param  string  $concrete     * @return \Closure     */    protected function getClosure($abstract, $concrete)// one is abstract other is concrete    {        return function ($c, $parameters = []) use ($abstract, $concrete) {// like get four parameters            $method = ($abstract == $concrete) ? 'build' : 'make';// create the new type by class type.            return $c->$method($concrete, $parameters);// return the instance of the class ,        };    }
0 0
原创粉丝点击