@@ -80,7 +80,7 @@ |
||
| 80 | 80 | { |
| 81 | 81 | $this->formerPasswords = array_merge($this->formerPasswords, $formerPasswords); |
| 82 | 82 | |
| 83 | - StableSort::usort($this->formerPasswords, static function (FormerPassword $a, FormerPassword $b): int { |
|
| 83 | + StableSort::usort($this->formerPasswords, static function(FormerPassword $a, FormerPassword $b): int { |
|
| 84 | 84 | return $b->getDate() <=> $a->getDate(); |
| 85 | 85 | }); |
| 86 | 86 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | { |
| 43 | 43 | $this->constraints[] = new DateIntervalConstraint($min, $max, $weight); |
| 44 | 44 | |
| 45 | - StableSort::usort($this->constraints, static function ( |
|
| 45 | + StableSort::usort($this->constraints, static function( |
|
| 46 | 46 | DateIntervalConstraint $a, |
| 47 | 47 | DateIntervalConstraint $b |
| 48 | 48 | ): int { |
@@ -106,7 +106,7 @@ |
||
| 106 | 106 | $guessableData = array_merge($guessableData, $password->getGuessableData()); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - foreach ($this->formatter->apply(CharTree::fromString((string)$password)) as $formattedPassword) { |
|
| 109 | + foreach ($this->formatter->apply(CharTree::fromString((string) $password)) as $formattedPassword) { |
|
| 110 | 110 | foreach ($guessableData as $data) { |
| 111 | 111 | if ($this->contains($formattedPassword, $data)) { |
| 112 | 112 | return $data; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $pspell = pspell_new($locale); |
| 58 | 58 | } catch (ErrorException $exception) { |
| 59 | 59 | throw new RuntimeException( |
| 60 | - 'An error occurred while loading the word list: ' . $exception->getMessage(), |
|
| 60 | + 'An error occurred while loading the word list: '.$exception->getMessage(), |
|
| 61 | 61 | /*code*/0, |
| 62 | 62 | $exception |
| 63 | 63 | ); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $check = pspell_check($this->pspell, $formattedWord); |
| 82 | 82 | } catch (ErrorException $exception) { |
| 83 | 83 | throw new RuntimeException( |
| 84 | - 'An error occurred while using the word list: ' . $exception->getMessage(), |
|
| 84 | + 'An error occurred while using the word list: '.$exception->getMessage(), |
|
| 85 | 85 | /*code*/0, |
| 86 | 86 | $exception |
| 87 | 87 | ); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | private function applyInternal(CharTree $charTree, int $minLength, ?int $maxLength): CharTree |
| 68 | 68 | { |
| 69 | 69 | // When PHP 7.1 is no longer supported, change to using spl_object_id. |
| 70 | - $hash = spl_object_hash($charTree) . ';' . $minLength . ';' . $maxLength; |
|
| 70 | + $hash = spl_object_hash($charTree).';'.$minLength.';'.$maxLength; |
|
| 71 | 71 | |
| 72 | 72 | if (!isset(self::$memoization[$hash])) { |
| 73 | 73 | self::$memoization[$hash] = $this->format($charTree, $minLength, $maxLength); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | private function applyInternalStartingWithRoot(CharTree $charTree, int $minLength, ?int $maxLength): CharTree |
| 144 | 144 | { |
| 145 | 145 | // When PHP 7.1 is no longer supported, change to using spl_object_id. |
| 146 | - $hash = spl_object_hash($charTree) . ';' . $minLength . ';' . $maxLength; |
|
| 146 | + $hash = spl_object_hash($charTree).';'.$minLength.';'.$maxLength; |
|
| 147 | 147 | |
| 148 | 148 | if (!isset(self::$startsWithMemoization[$hash])) { |
| 149 | 149 | self::$startsWithMemoization[$hash] = $this->generateStartingWithRoot($charTree, $minLength, $maxLength); |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | $rootLength = mb_strlen($root); |
| 170 | 170 | if ($rootLength <= $maxLength || $maxLength === null) { |
| 171 | 171 | $branches = $charTree->getBranches(); |
| 172 | - $branchMinLength = $minLength <= $rootLength ? 0 : $minLength - $rootLength; |
|
| 173 | - $branchMaxLength = $maxLength === null ? null : $maxLength - $rootLength; |
|
| 172 | + $branchMinLength = $minLength <= $rootLength ? 0 : $minLength-$rootLength; |
|
| 173 | + $branchMaxLength = $maxLength === null ? null : $maxLength-$rootLength; |
|
| 174 | 174 | |
| 175 | 175 | $substringBranches = []; |
| 176 | 176 | foreach ($branches as $branch) { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | private function applyInternal(CharTree $charTree, int $length): CharTree |
| 52 | 52 | { |
| 53 | 53 | // When PHP 7.1 is no longer supported, change to using spl_object_id. |
| 54 | - $hash = spl_object_hash($charTree) . ';' . $length; |
|
| 54 | + $hash = spl_object_hash($charTree).';'.$length; |
|
| 55 | 55 | |
| 56 | 56 | if (!isset(self::$memoization[$hash])) { |
| 57 | 57 | self::$memoization[$hash] = $this->format($charTree, $length); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $rootLength = mb_strlen($root); |
| 77 | - $branchLength = $length - $rootLength; |
|
| 77 | + $branchLength = $length-$rootLength; |
|
| 78 | 78 | |
| 79 | 79 | if ($branchLength < 0) { |
| 80 | 80 | return CharTree::fromString(''); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | private function applyInternal(CharTree $charTree, int $minLength, ?int $maxLength): CharTree |
| 63 | 63 | { |
| 64 | 64 | // When PHP 7.1 is no longer supported, change to using spl_object_id. |
| 65 | - $hash = spl_object_hash($charTree) . ';' . $minLength . ';' . $maxLength; |
|
| 65 | + $hash = spl_object_hash($charTree).';'.$minLength.';'.$maxLength; |
|
| 66 | 66 | |
| 67 | 67 | if (!isset(self::$memoization[$hash])) { |
| 68 | 68 | self::$memoization[$hash] = $this->format($charTree, $minLength, $maxLength); |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | $rootLength = mb_strlen($root); |
| 98 | - $branchMinLength = $minLength <= $rootLength ? 0 : $minLength - $rootLength; |
|
| 99 | - $branchMaxLength = $maxLength === null ? null : $maxLength - $rootLength; |
|
| 98 | + $branchMinLength = $minLength <= $rootLength ? 0 : $minLength-$rootLength; |
|
| 99 | + $branchMaxLength = $maxLength === null ? null : $maxLength-$rootLength; |
|
| 100 | 100 | |
| 101 | 101 | $filteredBranches = []; |
| 102 | 102 | foreach ($branches as $branch) { |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $hash = password_hash($password, $this->algorithm, $this->options); |
| 43 | 43 | } catch (ErrorException $exception) { |
| 44 | 44 | throw new RuntimeException( |
| 45 | - 'An error occurred while hashing the password: ' . $exception->getMessage(), |
|
| 45 | + 'An error occurred while hashing the password: '.$exception->getMessage(), |
|
| 46 | 46 | /*code*/0, |
| 47 | 47 | $exception |
| 48 | 48 | ); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | foreach ($branches as $branch) { |
| 69 | 69 | // When PHP 7.1 is no longer supported, change to using spl_object_id. |
| 70 | 70 | $branchHash = spl_object_hash($branch); |
| 71 | - $hash .= ';' . $branchHash; |
|
| 71 | + $hash .= ';'.$branchHash; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | if (!isset(self::$constructMemoization[$hash])) { |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | yield $this->root; |
| 275 | 275 | } else { |
| 276 | 276 | foreach ($branch as $string) { |
| 277 | - yield $this->root . $string; |
|
| 277 | + yield $this->root.$string; |
|
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | } |