protected function checkDependencies(Container $app)
    {
        $dependencies = [
            'twig' => 'TwigServiceProvider',
            'session' => 'SessionServiceProvider',
            'translator' => 'TranslationServiceProvider',
            'validator' => 'ValidatorServiceProvider',
            'form.factory' => 'FormServiceProvider',
            'security.token_storage' => 'SecurityServiceProvider'
        ];

        if (!$app['resolver'] instanceof ServiceControllerResolver) {
            throw new LogicException('You must register the ServiceControllerServiceProvider to use the UserServiceProvider');
        }

        foreach ($dependencies as $key => $provider) {
            if (!isset($app[$key])) {
                throw new LogicException(sprintf('You must register the %s to use the UserServiceProvider', $provider));
            }
        }
    }