protected function fromArray(array $definition)
    {
        $definition += $this->defaultDefinition;

        $refClass = new ReflectionClass($definition['class']);
        $instance = $refClass->newInstanceArgs(self::parseArguments($definition['arguments']));

        foreach ($definition['call'] as $methodName => $args) {
            $refMethod = new ReflectionMethod($instance, $methodName);
            $refMethod->invokeArgs($instance, self::parseArguments($args));
        }

        return $instance;
    }