diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1491781 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 + +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efad63c..14ab2d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,21 @@ name: CI on: - schedule: - # Every sunday at 02:00 - - cron: 0 2 * * 0 - pull_request: push: branches: - main - '[0-9].[0-9]' + tags: + - '*' + pull_request: ~ + schedule: + # Every Sunday at 02:00 + - cron: 0 2 * * 0 + workflow_dispatch: ~ + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: tests: @@ -34,14 +41,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 diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index a896c2a..2ea5f4f 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -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;