public static function fromArray(array $serviceConfiguration)
    {
        if (!isset($serviceConfiguration['class']))
        {
            throw new InvalidServiceException('The service configuration must define a "class" attribute.');
        }

        // construct the service definition
        $defintion = new static($serviceConfiguration['class'], $serviceConfiguration['arguments'] ?? []);

        // add service method calls if configured
        if (isset($serviceConfiguration['calls']))
        {
            foreach($serviceConfiguration['calls'] as $call)
            {
                if (isset($call['method']) && isset($call['arguments']))
                {
                    $defintion->calls($call['method'], $call['arguments']);
                }
                else 
                {
                    throw new InvalidServiceException('Every service call must have the attributes "method" and "arguments".');
                }
            }
        }

        return $defintion;
    }