namespace illuminate\container;use closure;use arrayaccess;use reflectionclass;use reflectionmethod;use reflectionfunction;use reflectionparameter;use invalidargumentexception; Use illuminate\contracts\container\bindingresolutionexception;use illuminate\contracts\container\ container as containercontract;// namespaceclass container implements Arrayaccess, containercontract{// container implements arrayaccess, containercontract /** * the current globally available container (if any) . * * @var static */ protected static $instance; // The current globally available container (If any); /** &Nbsp; * an array of the types that have been resolved. * * @var array */ protected $resolved = [];// a resolved a array types // an array of the types that have Been resolved. /** * the container ' s bindings. * * @var array */ protected $bindings = [];// the container ' s bindings. // a array use by bindings types /** * the container ' s shared instances. * * @var array */ protected $instances = []; // the container ' s shared instances. /** * the registered type aliases. * * @var array */ protected $aliases = [];// The registered type aliases. /** * the extension closures for services. * * @var array */ protected $extenders = [];// the extension closures for services. /** * all of the registered tags. * * @var array */ protected $tags = [];// all of the registered tags. /** * the stack of concretions currently being built. * * @var array */ protected $buildStack = [];// The stack of concretions currently being built. /** * the contextual binding map. * * @var array */ public $contextual = [];//the contextual binding map.&nbsP; /** * all of the registered rebound callbacks. * * @var array */ protected $reboundCallbacks = [];// all of the registered rebound callbacks. /** * All of the global resolving callbacks. * * @var array */ protected $globalResolvingCallbacks = [];// All of the global Callbacks. /** * all of the global after resolving callbacks. * * @var array */ protected $globalAfterResolvingCallbacks = [];// all of the global after resolving callbacks. /** * All of the after resolving callbacks by class type. * * @var array */ protected $resolvingCallbacks = [];// all of the after resolving callbacks by class type. /** * all of the after resolving callbacks by class type. * * @var array */ protected $afterResolvingCallbacks = [];//all of the after resolving callbacks by class type. /** * Define a contextual binding. * * @param string $concrete * @return \illuminate\contracts\container\contextualbindingbuilder */ public function when ($concrete) { $concrete = $this->normalize ($concrete);// get a Normal ize () return new contextualbindingbuilder ($this, $concrete);// return a function }// define a contextual binding
This article is from the "Focus on PHP" blog, please be sure to keep this source http://jingshanls.blog.51cto.com/3357095/1769603
This can have