public function add($service, $alias = '', $args = [])
    {
        // Register the service as a prototype
        if (!empty($args)) {
            if (empty($alias)) {
                $this->container->add($service)->withArgument($args);
            } else {
                $this->container->add($alias, $service)->withArgument($args);
            }
        } else {
            if (empty($alias)) {
                $this->container->add($service);
            } else {
                $this->container->add($alias, $service);
            }
        }
    }
public function add($service, $alias = '', $args = [])
    {
        // Register the service as a prototype
        if (!empty($args)) {
            if (empty($alias)) {
                $this->container->add($service)->withArgument($args);
            } else {
                $this->container->add($alias, $service)->withArgument($args);
            }
        } else {
            if (empty($alias)) {
                $this->container->add($service);
            } else {
                $this->container->add($alias, $service);
            }
        }
    }
public function add ( $ service , $ alias = '' , $ args = [ ] ) { // Register the service as a prototype if ( ! empty ( $ args ) ) { if ( empty ( $ alias ) ) { $ this -> container -> add ( $ service ) -> withArgument ( $ args ) ; } else { $ this -> container -> add ( $ alias , $ service ) -> withArgument ( $ args ) ; } } else { if ( empty ( $ alias ) ) { $ this -> container -> add ( $ service ) ; } else { $ this -> container -> add ( $ alias , $ service ) ; } } }
Register a service.

@param string $service
@param string $alias
@param mixed $args
Register a service .