private function getParameterValue(string $id, ReflectionParameter $parameter, ContainerInterface $container)
    {
        if (! ($class = $parameter->getClass())) {
            if ($parameter->isDefaultValueAvailable()) {
                // a default value is available so use that
                return $parameter->getDefaultValue();
            }

            // no default, eek
            throw new FatalNotFoundException("Cannot resolve '" . $parameter->getName() . "' for class '" . $id . "'");
        }

        try {
            // attempt to resolve the value
            return $container->get($class->getName());
        } catch (NotFoundException $e) {
            if ($parameter->isDefaultValueAvailable()) {
                // a default value is available so use that
                return $parameter->getDefaultValue();
            }
            throw $e;
        }
    }