src/Support/Container/Container.php
/**
	 * Registers a service provider in the container.
	 *
	 * @param ServiceProvider $provider
	 * @return void
	 */
Registers a service provider in the container.
@param ServiceProvider $provider
@return void
Registers a service provider in the container . @param ServiceProvider $provider @return void
public function register(ServiceProvider $provider) {
		$this->providers[] = $provider;
		foreach ($provider->provides() as $className) {
			if (!array_key_exists($className, $this->providersMap)) {
				$this->providersMap[$className] = array();
			}
			if (in_array($provider, $this->providersMap[$className])) continue;
			$this->providersMap[$className][] = $provider;
		}
	}
public function register ( ServiceProvider $ provider ) { $ this -> providers [ ] = $ provider ; foreach ( $ provider -> provides ( ) as $ className ) { if ( ! array_key_exists ( $ className , $ this -> providersMap ) ) { $ this -> providersMap [ $ className ] = array ( ) ; } if ( in_array ( $ provider , $ this -> providersMap [ $ className ] ) ) continue ; $ this -> providersMap [ $ className ] [ ] = $ provider ; } }
Registers a service provider in the container.
Registers a service provider in the container .
// Make sure the array exists // Do not continue if the provider is already in the array // Add the provider to the class name mapping