protected function addValidators(Application $app)
    {
        if (!isset($app['validator'])) {
            throw new Exception\MissingDependencyException('The validator manager is missing');
        }

        $provider = $this;
        $app['validator'] = $app->share(
            $app->extend(
                'validator',
                function ($validatorManager) use ($provider) {
                    return $provider->attachValidators($validatorManager);
                }
            )
        );
    }