public function extend($name, Closure $extender) {
		$name = $this->getAlias($name);
		$component = &$this->components[$name];

		if (!isset($component['extender'])) {
			$component['extender'] = [];
		}

		if ($this->isSingleton($name)) {
			$component = $this->make($name);

			$component = $this->resolveExtend($name, $component);

			return $this->instance($name, $component);
		}

		array_push($component['extender'], $extender);
	}
public function extend($name, Closure $extender) {
		$name = $this->getAlias($name);
		$component = &$this->components[$name];

		if (!isset($component['extender'])) {
			$component['extender'] = [];
		}

		if ($this->isSingleton($name)) {
			$component = $this->make($name);

			$component = $this->resolveExtend($name, $component);

			return $this->instance($name, $component);
		}

		array_push($component['extender'], $extender);
	}
public function extend ( $ name , Closure $ extender ) { $ name = $ this -> getAlias ( $ name ) ; $ component = & $ this -> components [ $ name ] ; if ( ! isset ( $ component [ 'extender' ] ) ) { $ component [ 'extender' ] = [ ] ; } if ( $ this -> isSingleton ( $ name ) ) { $ component = $ this -> make ( $ name ) ; $ component = $ this -> resolveExtend ( $ name , $ component ) ; return $ this -> instance ( $ name , $ component ) ; } array_push ( $ component [ 'extender' ] , $ extender ) ; }
Extend component.
If component is singleton, this method will resolve extend and return new instance.

@param  string  $name     Component name
@param  Closure $extender Component extender
@return void
Extend component . If component is singleton this method will resolve extend and return new instance .