public static function create($driver, array $args = [])
    {
        if (is_string($driver) && lcfirst($driver) === 'doctrine') {
            return new DoctrineResourceManager(new DoctrineDriver($args));
        } elseif ($driver instanceof DoctrineDriver) {
            return new DoctrineResourceManager($driver);
        }

        throw new \InvalidArgumentException(sprintf(
            'The driver "%s" can not be found.',
            is_string($driver) ? lcfirst($driver) : get_class($driver)
        ));
    }