/**
* Get the rebound callbacks for a given type.
*
* @param string $abstract
* @return array
*/
protected function getReboundCallbacks($abstract)
{
if (isset($this->reboundCallbacks[$abstract])) {// if has the value in the reboundcallbacks array
return $this->reboundCallbacks[$abstract];// return it
}
return [];// return a null array
}// Get the rebound callbacks for a given type.
/**
* Wrap the given closure such that its dependencies will be injected when executed.
*
* @param \Closure $callback
* @param array $parameters
* @return \Closure
*/
public function wrap(Closure $callback, array $parameters = [])
{
return function () use ($callback, $parameters) {
return $this->call($callback, $parameters);// a waste
};
}// Wrap the given closure such that its
// set the given closure into the dependencies will be injected
// when it is executed we will fire the given closure
转载于:https://blog.51cto.com/jingshanls/1774600