src/Support/Container/Container.php
/**
	 * Returns a singleton of the given class name from the last service provider that can provide it.
	 *
	 * @param string $className
	 * @param mixed ...$args
	 * @return object|null
	 */
Returns a singleton of the given class name from the last service provider that can provide it.
@param string $className
@param mixed ...$args
@return object|null
Returns a singleton of the given class name from the last service provider that can provide it . @param string $className @param mixed ... $args @return object|null
public function make($className, $args = null) {
		$args = func_get_args();
		$className = array_shift($args);
		if (array_key_exists($className, $this->providersMap)) {
			$providers = $this->providersMap[$className];
			$reverse = array_reverse($providers);
			foreach ($reverse as $provider) {
				if ($provider->isDeferred() && !in_array($provider, static::$booted)) {
					$provider->boot();
				}
				$resolved = $provider->resolve($className, $args);
				if (!is_null($resolved)) {
					$resolved = (array) $resolved;
					if (!empty($resolved)) {
						return head($resolved);
					}
				}
			}
		}
		return null;
	}
public function make ( $ className , $ args = null ) { $ args = func_get_args ( ) ; $ className = array_shift ( $ args ) ; if ( array_key_exists ( $ className , $ this -> providersMap ) ) { $ providers = $ this -> providersMap [ $ className ] ; $ reverse = array_reverse ( $ providers ) ; foreach ( $ reverse as $ provider ) { if ( $ provider -> isDeferred ( ) && ! in_array ( $ provider , static :: $ booted ) ) { $ provider -> boot ( ) ; } $ resolved = $ provider -> resolve ( $ className , $ args ) ; if ( ! is_null ( $ resolved ) ) { $ resolved = ( array ) $ resolved ; if ( ! empty ( $ resolved ) ) { return head ( $ resolved ) ; } } } } return null ; }
Returns a singleton of the given class name from the last service provider that can provide it.
Returns a singleton of the given class name from the last service provider that can provide it .