8
8
9
9
namespace Ibexa \Bundle \Core \DependencyInjection \Configuration \Parser \Repository ;
10
10
11
- use Ibexa \Bundle \Core \DependencyInjection \Configuration \AbstractParser ;
12
11
use Ibexa \Bundle \Core \DependencyInjection \Configuration \RepositoryConfigParserInterface ;
13
- use Ibexa \Bundle \Core \DependencyInjection \Configuration \SiteAccessAware \ContextualizerInterface ;
14
12
use Ibexa \Contracts \Core \Repository \Values \User \User ;
15
13
use Symfony \Component \Config \Definition \Builder \NodeBuilder ;
16
14
29
27
* update_type_on_change: false
30
28
* ```
31
29
*/
32
- final class PasswordHash extends AbstractParser implements RepositoryConfigParserInterface
30
+ final class PasswordHash implements RepositoryConfigParserInterface
33
31
{
34
32
public function addSemanticConfig (NodeBuilder $ nodeBuilder ): void
35
33
{
@@ -40,6 +38,7 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder): void
40
38
->integerNode ('default_type ' )
41
39
->info ('Default password hash type, see the constants in Ibexa\Contracts\Core\Repository\Values\User\User. ' )
42
40
->example ('!php/const:Ibexa\Contracts\Core\Repository\Values\User\User::PASSWORD_HASH_PHP_DEFAULT ' )
41
+ ->defaultValue (User::PASSWORD_HASH_PHP_DEFAULT )
43
42
->validate ()
44
43
->ifTrue (static function ($ value ): bool {
45
44
$ hashType = (int ) $ value ;
@@ -58,26 +57,9 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder): void
58
57
->booleanNode ('update_type_on_change ' )
59
58
->info ('Whether the password hash type should be changed when the password is changed if it differs from the default type. ' )
60
59
->example ('false ' )
60
+ ->defaultFalse ()
61
61
->end ()
62
62
->end ()
63
63
->end ();
64
64
}
65
-
66
- /**
67
- * @param array<string, mixed> $scopeSettings
68
- */
69
- public function mapConfig (array &$ scopeSettings , $ currentScope , ContextualizerInterface $ contextualizer ): void
70
- {
71
- if (!isset ($ scopeSettings ['password_hash ' ])) {
72
- return ;
73
- }
74
-
75
- $ settings = $ scopeSettings ['password_hash ' ];
76
- if (isset ($ settings ['default_type ' ])) {
77
- $ contextualizer ->setContextualParameter ('password_hash.default_type ' , $ currentScope , $ settings ['default_type ' ]);
78
- }
79
- if (isset ($ settings ['update_type_on_change ' ])) {
80
- $ contextualizer ->setContextualParameter ('password_hash.update_type_on_change ' , $ currentScope , $ settings ['update_type_on_change ' ]);
81
- }
82
- }
83
65
}
0 commit comments