每天laravel-20160802| Container -5

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

你可能感兴趣的:(每天laravel-20160802| Container -5)