src/Phossa2/Di/Service.php
public static function __callstatic(/*# string */ $method, array $params)
    {
        if (static::$container) {
            // append scope if provided
            if (!isset($params[0])) {
                $method .= '@' . $params[0];
            }
            return static::$container->get($method);
        }

        // container not set yet
        throw new NotFoundException(
            Message::get(Message::DI_CONTAINER_NOTFOUND),
            Message::DI_CONTAINER_NOTFOUND
        );
    }
public static function __callstatic(/*# string */ $method, array $params)
    {
        if (static::$container) {
            // append scope if provided
            if (!isset($params[0])) {
                $method .= '@' . $params[0];
            }
            return static::$container->get($method);
        }

        // container not set yet
        throw new NotFoundException(
            Message::get(Message::DI_CONTAINER_NOTFOUND),
            Message::DI_CONTAINER_NOTFOUND
        );
    }
public static function __callstatic ( /*# string */ $ method , array $ params ) { if ( static :: $ container ) { // append scope if provided if ( ! isset ( $ params [ 0 ] ) ) { $ method .= '@' . $ params [ 0 ] ; } return static :: $ container -> get ( $ method ) ; } // container not set yet throw new NotFoundException ( Message :: get ( Message :: DI_CONTAINER_NOTFOUND ) , Message :: DI_CONTAINER_NOTFOUND ) ; }
Locate a service from the container

```php
// the global config object
$config = Service::config();

// the container
$container = Service::container();
```

@param  string $method object id actually
@param  array $params
@return object
@throws NotFoundException if container not set or object not found
@throws RuntimeException if object instantiation error
@access public
@api
Locate a service from the container