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 88
99class PasswordExposed implements Rule
1010{
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+
1122 /**
1223 * Determine if the validation rule passes.
1324 *
@@ -18,7 +29,7 @@ class PasswordExposed implements Rule
1829 */
1930 public function passes ($ attribute , $ value )
2031 {
21- $ passwordStatus = ( new PasswordExposedChecker ()) ->passwordExposed ($ value );
32+ $ passwordStatus = $ this -> passwordExposedChecker ->passwordExposed ($ value );
2233
2334 return $ passwordStatus !== PasswordStatus::EXPOSED ;
2435 }
You can’t perform that action at this time.
0 commit comments