Skip to content

Commit

Permalink
fix: check bundle is bootable
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Mar 29, 2023
1 parent db3e02b commit 1e451dd
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 16 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ jobs:
- '^2.7'
- '^3.0'
include:
# Ensure the bundle is bootable
- php: '8.2'
symfony: '6.2.*'
bootable: true
# Fix laminas/laminas-code support
- php: '8.0'
symfony: '4.4.*'
laminas: true
# Waiting for php-cs-fixer to support PHP 8.2
- php: '8.1'
symfony: '6.2.*'
bootable: true
quality: true
exclude:
# Symfony 6.1.* requires PHP >= 8.1
Expand Down
72 changes: 58 additions & 14 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,39 +66,83 @@ public function getConfigTreeBuilder()
$config['providers']['default']['default'] = true;
$config['providers']['default']['password_token'] = $config['password_token'];
$config['providers']['default']['user'] = $config['user'];
$config['providers']['default']['manager'] = $config['manager'];
if (\array_key_exists('manager', $config)) {
$config['providers']['default']['manager'] = $config['manager'];
}
unset($config['user'], $config['password_token'], $config['manager']);

return $config;
})
->end()
->children()
->arrayNode('providers')->useAttributeAsKey('name')->prototype('array')
->arrayNode('providers')
->useAttributeAsKey('name')
->prototype('array')
->children()
->scalarNode('manager')->defaultValue('coop_tilleuls_forgot_password.manager.doctrine')->cannotBeEmpty()->info('Persistence manager service to handle the token storage.')->end()
->booleanNode('default')->defaultFalse()->end()
->scalarNode('manager')
->defaultValue('coop_tilleuls_forgot_password.manager.doctrine')
->cannotBeEmpty()
->info('Persistence manager service to handle the token storage.')
->end()
->booleanNode('default')
->defaultFalse()
->end()
->arrayNode('password_token')
->children()
->scalarNode('class')->cannotBeEmpty()->isRequired()->info('PasswordToken class.')->end()
->scalarNode('expires_in')->defaultValue('1 day')->cannotBeEmpty()->info('Expiration time using Datetime format. see : https://www.php.net/manual/en/datetime.format.php.')->end()
->scalarNode('user_field')->defaultValue('user')->cannotBeEmpty()->info('User field name on PasswordToken entity.')->end()
->arrayNode('serialization_groups')->info('PasswordToken serialization groups.')->defaultValue([])->useAttributeAsKey('name')->prototype('scalar')
->scalarNode('class')
->cannotBeEmpty()
->isRequired()
->info('PasswordToken class.')
->end()
->scalarNode('expires_in')
->defaultValue('1 day')
->cannotBeEmpty()
->info('Expiration time using Datetime format. see : https://www.php.net/manual/en/datetime.format.php.')
->end()
->end()
->scalarNode('user_field')
->defaultValue('user')
->cannotBeEmpty()
->info('User field name on PasswordToken entity.')
->end()
->arrayNode('serialization_groups')
->info('PasswordToken serialization groups.')
->defaultValue([])
->useAttributeAsKey('name')
->prototype('scalar')->end()
->end()
->end()
->end()
->arrayNode('user')
->children()
->scalarNode('class')->cannotBeEmpty()->isRequired()->info('User class.')->end()
->scalarNode('email_field')->defaultValue('email')->cannotBeEmpty()->info('User email field name to retrieve it (email, username...).')->end()
->scalarNode('password_field')->defaultValue('password')->cannotBeEmpty()->info('User password field name.')->end()
->arrayNode('authorized_fields')->defaultValue(['email'])->requiresAtLeastOneElement()->info('User fields names to retrieve it (email, username...).')->prototype('scalar')->end()->end()
->scalarNode('class')
->cannotBeEmpty()
->isRequired()
->info('User class.')
->end()
->scalarNode('email_field')
->defaultValue('email')
->cannotBeEmpty()
->info('User email field name to retrieve it (email, username...).')
->end()
->scalarNode('password_field')
->defaultValue('password')
->cannotBeEmpty()
->info('User password field name.')
->end()
->arrayNode('authorized_fields')
->defaultValue(['email'])
->requiresAtLeastOneElement()
->info('User fields names to retrieve it (email, username...).')
->prototype('scalar')->end()
->end()
->end()
->end()
->end()
->end()
->end()
->booleanNode('use_jms_serializer')->defaultFalse()->end()
->booleanNode('use_jms_serializer')
->defaultFalse()
->end()
->end();

return $treeBuilder;
Expand Down

0 comments on commit 1e451dd

Please sign in to comment.