File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 8
8
9
9
class PasswordExposed implements Rule
10
10
{
11
+ private $ passwordExposedChecker ;
12
+
13
+ public function __construct (PasswordExposedChecker $ passwordExposedChecker = null )
14
+ {
15
+ if (!$ passwordExposedChecker ) {
16
+ $ passwordExposedChecker = new PasswordExposedChecker ();
17
+ }
18
+
19
+ $ this ->passwordExposedChecker = $ passwordExposedChecker ;
20
+ }
21
+
11
22
/**
12
23
* Determine if the validation rule passes.
13
24
*
@@ -18,7 +29,7 @@ class PasswordExposed implements Rule
18
29
*/
19
30
public function passes ($ attribute , $ value )
20
31
{
21
- $ passwordStatus = ( new PasswordExposedChecker ()) ->passwordExposed ($ value );
32
+ $ passwordStatus = $ this -> passwordExposedChecker ->passwordExposed ($ value );
22
33
23
34
return $ passwordStatus !== PasswordStatus::EXPOSED ;
24
35
}
You can’t perform that action at this time.
0 commit comments