protected function canInstantiate(ReflectionClass $class)
    {
        if (!$class->isInstantiable()) {
            return false;
        }

        $constructor = $class->getConstructor();

        return is_null($constructor) || 0 === $constructor->getNumberOfRequiredParameters();
    }