protected function createService(string $name, array $service) : void
    {
        if (!isset($service["callback"])) {
            throw new Exception("The service '$name' is missing a callback.");
        }

        if (isset($service["shared"]) && $service["shared"]) {
            $this->setShared($name, $service["callback"]);
        } else {
            $this->set($name, $service["callback"]);
        }

        if (isset($service["active"]) && $service["active"]) {
            $this->get($name);
        }
    }
protected function createService(string $name, array $service) : void
    {
        if (!isset($service["callback"])) {
            throw new Exception("The service '$name' is missing a callback.");
        }

        if (isset($service["shared"]) && $service["shared"]) {
            $this->setShared($name, $service["callback"]);
        } else {
            $this->set($name, $service["callback"]);
        }

        if (isset($service["active"]) && $service["active"]) {
            $this->get($name);
        }
    }
protected function createService ( string $ name , array $ service ) : void { if ( ! isset ( $ service [ "callback" ] ) ) { throw new Exception ( "The service '$name' is missing a callback." ) ; } if ( isset ( $ service [ "shared" ] ) && $ service [ "shared" ] ) { $ this -> setShared ( $ name , $ service [ "callback" ] ) ; } else { $ this -> set ( $ name , $ service [ "callback" ] ) ; } if ( isset ( $ service [ "active" ] ) && $ service [ "active" ] ) { $ this -> get ( $ name ) ; } }
Create a service from a name and an array containing details on
how to create it.

@param string $name    of service.
@param array  $service details to use when creating the service.

@throws Exception when configuration is corrupt.

@return void
Create a service from a name and an array containing details on how to create it .