当前位置: 首页>>代码示例>>PHP>>正文


PHP ArrayNodeDefinition::isRequired方法代码示例

本文整理汇总了PHP中Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition::isRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayNodeDefinition::isRequired方法的具体用法?PHP ArrayNodeDefinition::isRequired怎么用?PHP ArrayNodeDefinition::isRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition的用法示例。


在下文中一共展示了ArrayNodeDefinition::isRequired方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addConfiguration

 /**
  * {@inheritdoc}
  */
 public function addConfiguration(ArrayNodeDefinition $pluginNode)
 {
     $pluginNode->isRequired()->addDefaultsIfNotSet()->validate()->ifTrue(function ($value) {
         return $value['min_length'] >= $value['max_length'];
     })->thenInvalid('The configuration option "min_length" must be lower than "max_length".')->end()->children()->scalarNode('class')->info('Authorization Code class.')->isRequired()->validate()->ifTrue(function ($value) {
         return !class_exists($value);
     })->thenInvalid('The class does not exist.')->end()->end()->scalarNode('manager')->info('Authorization Code manager.')->defaultValue('oauth2_server.auth_code.manager.default')->end()->integerNode('min_length')->info('The minimum length of Authorization Code values produced by this bundle. Should be at least 20.')->defaultValue(20)->min(1)->end()->integerNode('max_length')->info('The maximum length of Authorization Code values produced by this bundle. Should be at least 30.')->defaultValue(30)->min(2)->end()->integerNode('lifetime')->info('The lifetime (in seconds) of an Authorization Code. Should be less than 1 minute (default is 30 seconds).')->defaultValue(30)->min(1)->end()->booleanNode('enforce_pkce')->info('Enforce Proof Key for token exchange (PKCE) for non-confidential clients (see RFC7636). This option is useless if the option "allow_public_clients" is set to "false".')->defaultTrue()->end()->booleanNode('allow_public_clients')->info('If true, public clients are allowed to issue access tokens using this grant type.')->defaultFalse()->end()->end();
 }
开发者ID:spomky-labs,项目名称:oauth2-server-bundle,代码行数:11,代码来源:AuthCodeGrantTypePlugin.php

示例2: addConfiguration

 /**
  * {@inheritdoc}
  */
 public function addConfiguration(ArrayNodeDefinition $pluginNode)
 {
     $pluginNode->isRequired()->addDefaultsIfNotSet()->validate()->ifTrue(function ($value) {
         return $value['min_length'] >= $value['max_length'];
     })->thenInvalid('The configuration option "min_length" must be lower than "max_length".')->end()->children()->integerNode('min_length')->info('The minimum length of refresh token values produced by this bundle. Should be at least 20.')->defaultValue(20)->min(1)->end()->integerNode('max_length')->info('The maximum length of refresh token values produced by this bundle. Should be at least 30.')->defaultValue(30)->min(2)->end()->integerNode('lifetime')->info('The lifetime (in seconds) of a refresh token (default is 1209600 seconds = 14 days).')->defaultValue(1209600)->min(0)->end()->scalarNode('class')->info('Refresh token class.')->validate()->ifTrue(function ($value) {
         return !class_exists($value);
     })->thenInvalid('The class does not exist.')->end()->isRequired()->end()->scalarNode('manager')->info('Refresh token manager.')->defaultValue('oauth2_server.refresh_token.manager.default')->end()->end();
 }
开发者ID:spomky-labs,项目名称:oauth2-server-bundle,代码行数:11,代码来源:RefreshTokenGrantTypePlugin.php

示例3: addConfiguration

 /**
  * {@inheritdoc}
  */
 public function addConfiguration(ArrayNodeDefinition $pluginNode)
 {
     $pluginNode->isRequired()->addDefaultsIfNotSet()->children()->scalarNode('login_route_name')->info('The name of the login route. Will be converted into URL and used to redirect the user if not logged in. If you use "FOSUserBundle", the route name should be "fos_user_security_login".')->isRequired()->end()->arrayNode('login_route_parameters')->info('Parameters associated to the login route (if needed).')->useAttributeAsKey('name')->prototype('scalar')->end()->treatNullLike([])->end()->scalarNode('user_account_manager')->info('The user account manager.')->isRequired()->end()->scalarNode('template')->info('The consent page template.')->cannotBeEmpty()->defaultValue('@SpomkyLabsOAuth2ServerBundle/authorization/authorization.html.twig')->end()->booleanNode('allow_scope_selection')->info('If true, resource owners will be able to select the scope on the consent page. This option is useless if the "ScopeManagerPlugin" is not enabled.')->defaultFalse()->end()->scalarNode('path')->info('The path to the authorization endpoint.')->defaultValue('/oauth/v2/authorize')->end()->end();
     $this->addFormSection($pluginNode);
     $this->addOptionSection($pluginNode);
     $this->addAuthorizationRequestSection($pluginNode);
     $this->addPreConfiguredAuthorizationSection($pluginNode);
 }
开发者ID:spomky-labs,项目名称:oauth2-server-bundle,代码行数:11,代码来源:AuthorizationEndpointPlugin.php

示例4: addConfiguration

 /**
  * {@inheritdoc}
  */
 public function addConfiguration(ArrayNodeDefinition $pluginNode)
 {
     $pluginNode->isRequired()->addDefaultsIfNotSet()->children()->scalarNode('class')->info('The Client class.')->isRequired()->validate()->ifTrue(function ($value) {
         return !class_exists($value);
     })->thenInvalid('The class does not exist.')->end()->end()->scalarNode('manager')->info('The Client manager.')->defaultValue('oauth2_server.client_manager.default')->end()->end();
     $this->addTokenEndpointAuthMethodsSection($pluginNode);
     $this->addManagementSection($pluginNode);
 }
开发者ID:spomky-labs,项目名称:oauth2-server-bundle,代码行数:11,代码来源:ClientManagerPlugin.php

示例5: addConfiguration

 /**
  * {@inheritdoc}
  */
 public function addConfiguration(ArrayNodeDefinition $pluginNode)
 {
     $pluginNode->isRequired()->addDefaultsIfNotSet()->children()->scalarNode('user_account_manager')->info('The user account manager.')->isRequired()->end()->end();
 }
开发者ID:spomky-labs,项目名称:oauth2-server-bundle,代码行数:7,代码来源:ResourceOwnerPasswordCredentialsGrantTypePlugin.php

示例6: addEntitySection

 /**
  *
  * @access private
  * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
  * @return \CCDNUser\AdminBundle\DependencyInjection\Configuration
  */
 private function addEntitySection(ArrayNodeDefinition $node)
 {
     $node->isRequired()->cannotBeEmpty()->children()->arrayNode('entity')->isRequired()->cannotBeEmpty()->children()->arrayNode('user')->isRequired()->cannotBeEmpty()->children()->scalarNode('class')->isRequired()->cannotBeEmpty()->end()->end()->end()->end()->end()->end();
     return $this;
 }
开发者ID:moave,项目名称:CCDNUserAdminBundle,代码行数:11,代码来源:Configuration.php

示例7: createDatabaseNode

 protected static function createDatabaseNode()
 {
     $node = new ArrayNodeDefinition('database');
     $node->isRequired()->children()->scalarNode('host')->defaultValue('localhost')->end()->append(self::createRequiredScalar('username'))->append(self::createRequiredScalar('password'))->append(self::createRequiredScalar('name'))->end();
     return $node;
 }
开发者ID:michelezamuner,项目名称:php-reactive-commands-test,代码行数:6,代码来源:Definition.php

示例8: addEntitySection

 /**
  *
  * @access private
  * @param  \Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition $node
  * @return \CCDNUser\SecurityBundle\DependencyInjection\Configuration
  */
 private function addEntitySection(ArrayNodeDefinition $node)
 {
     $node->isRequired()->cannotBeEmpty()->children()->arrayNode('entity')->isRequired()->cannotBeEmpty()->children()->arrayNode('user')->isRequired()->cannotBeEmpty()->children()->scalarNode('class')->isRequired()->cannotBeEmpty()->end()->end()->end()->arrayNode('session')->addDefaultsIfNotSet()->canBeUnset()->children()->scalarNode('class')->defaultValue('CCDNUser\\SecurityBundle\\Entity\\Session')->end()->end()->end()->end()->end()->end();
     return $this;
 }
开发者ID:nvision-luxembourg,项目名称:CCDNUserSecurityBundle,代码行数:11,代码来源:Configuration.php

示例9: addConfiguration

 public function addConfiguration(ArrayNodeDefinition $pluginNode)
 {
     $pluginNode->isRequired()->addDefaultsIfNotSet()->children()->booleanNode('allow_refresh_token_with_resource_owner_grant_type')->defaultTrue()->end()->scalarNode('end_user_manager')->isRequired()->cannotBeEmpty()->end()->end();
 }
开发者ID:gitter-badger,项目名称:OAuth2ServerBundle,代码行数:4,代码来源:ResourceOwnerPasswordCredentialsGrantTypePlugin.php

示例10: addConfiguration

 /**
  * {@inheritdoc}
  */
 public function addConfiguration(ArrayNodeDefinition $pluginNode)
 {
     $pluginNode->isRequired()->addDefaultsIfNotSet()->validate()->ifTrue($this->isClientAssertionEncryptionParameterInvalid('key_encryption_algorithms'))->thenInvalid(self::ERROR_EMPTY_CLIENT_ASSERTION_KEY_ENCRYPTION_ALGORITHMS)->end()->validate()->ifTrue($this->isClientAssertionEncryptionParameterInvalid('content_encryption_algorithms'))->thenInvalid(self::ERROR_EMPTY_CLIENT_ASSERTION_CONTENT_ENCRYPTION_ALGORITHMS)->end()->validate()->ifTrue($this->isClientAssertionEncryptionParameterInvalid('key_set'))->thenInvalid(self::ERROR_EMPTY_CLIENT_ASSERTION_KEY_SET)->end()->children()->booleanNode('issue_refresh_token')->info('A refresh token, if available, will be issued with the access token. This option is not recommended.')->defaultFalse()->end()->arrayNode('signature_algorithms')->info('Supported signature algorithms.')->useAttributeAsKey('name')->prototype('scalar')->end()->treatNullLike([])->cannotBeEmpty()->end()->arrayNode('claim_checkers')->info('Checkers will verify the JWT claims.')->useAttributeAsKey('name')->prototype('scalar')->end()->treatNullLike(['exp', 'iat', 'nbf'])->end()->arrayNode('header_checkers')->info('Checkers will verify the JWT headers.')->useAttributeAsKey('name')->prototype('scalar')->end()->treatNullLike(['crit'])->end()->arrayNode('encryption')->addDefaultsIfNotSet()->children()->booleanNode('enabled')->defaultFalse()->end()->booleanNode('required')->defaultFalse()->end()->scalarNode('key_set')->defaultNull()->end()->arrayNode('key_encryption_algorithms')->info('Supported key encryption algorithms.')->useAttributeAsKey('name')->prototype('scalar')->end()->treatNullLike([])->end()->arrayNode('content_encryption_algorithms')->info('Supported content encryption algorithms.')->useAttributeAsKey('name')->prototype('scalar')->end()->treatNullLike([])->end()->end()->end()->end();
 }
开发者ID:spomky-labs,项目名称:oauth2-server-bundle,代码行数:7,代码来源:JWTBearerPlugin.php

示例11: addContextSection

 /**
  * Adds the godfather.context configuration
  *
  * @param ArrayNodeDefinition $rootNode
  */
 private function addContextSection(ArrayNodeDefinition $rootNode)
 {
     $rootNode->isRequired()->canBeUnset()->useAttributeAsKey('alias', false)->prototype('array')->children()->arrayNode('contexts')->useAttributeAsKey('name', false)->prototype('array')->children()->scalarNode('fallback')->defaultNull()->end()->scalarNode('class')->defaultNull()->end()->end()->end()->end()->end()->end();
 }
开发者ID:pugx,项目名称:godfather,代码行数:9,代码来源:Configuration.php

示例12: addConfiguration

 public function addConfiguration(ArrayNodeDefinition $pluginNode)
 {
     $pluginNode->isRequired()->addDefaultsIfNotSet()->children()->scalarNode('min_length')->defaultValue(20)->cannotBeEmpty()->end()->scalarNode('max_length')->defaultValue(30)->cannotBeEmpty()->end()->scalarNode('lifetime')->defaultValue(1209600)->cannotBeEmpty()->end()->scalarNode('token_class')->isRequired()->cannotBeEmpty()->end()->scalarNode('token_manager')->defaultValue('oauth2_server.refresh_token.manager.default')->cannotBeEmpty()->end()->end();
 }
开发者ID:gitter-badger,项目名称:OAuth2ServerBundle,代码行数:4,代码来源:RefreshTokenGrantTypePlugin.php

示例13: addConfiguration

 public function addConfiguration(ArrayNodeDefinition $pluginNode)
 {
     $pluginNode->isRequired()->children()->scalarNode('client_class')->cannotBeEmpty()->isRequired()->validate()->ifTrue(function ($value) {
         return !class_exists($value);
     })->thenInvalid('The class does not exist')->end()->end()->scalarNode('prefix')->isRequired()->cannotBeEmpty()->defaultNull()->end()->scalarNode('jwt_loader')->cannotBeEmpty()->isRequired()->end()->scalarNode('keyset_manager')->cannotBeEmpty()->isRequired()->end()->scalarNode('client_manager_class')->cannotBeEmpty()->defaultValue('SpomkyLabs\\OAuth2ServerBundle\\Plugin\\JWTBearerPlugin\\Model\\JWTClientManager')->end()->arrayNode('allowed_encryption_algorithms')->cannotBeEmpty()->isRequired()->useAttributeAsKey('key')->prototype('scalar')->end()->end()->arrayNode('private_keys')->isRequired()->requiresAtLeastOneElement()->useAttributeAsKey('key')->prototype('array')->isRequired()->requiresAtLeastOneElement()->useAttributeAsKey('key')->prototype('scalar')->end()->end()->end();
 }
开发者ID:gitter-badger,项目名称:OAuth2ServerBundle,代码行数:6,代码来源:JWTBearerPlugin.php

示例14: addConfiguration

 /**
  * {@inheritdoc}
  */
 public function addConfiguration(ArrayNodeDefinition $pluginNode)
 {
     $pluginNode->isRequired()->children()->scalarNode('access_token_manager')->info('The access token manager.')->defaultNull()->end()->end();
 }
开发者ID:spomky-labs,项目名称:oauth2-server-bundle,代码行数:7,代码来源:CorePlugin.php


注:本文中的Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition::isRequired方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。