| @@ 57-66 (lines=10) @@ | ||
| 54 | /** |
|
| 55 | * @inheritdoc |
|
| 56 | */ |
|
| 57 | public function validate(string $expect): bool |
|
| 58 | { |
|
| 59 | $actual = $this->generate(); |
|
| 60 | ||
| 61 | if ($this->caseSensitive) { |
|
| 62 | return strcmp($expect, $actual) === 0; |
|
| 63 | } else { |
|
| 64 | return strcasecmp($expect, $actual) === 0; |
|
| 65 | } |
|
| 66 | } |
|
| 67 | ||
| 68 | } |
|
| 69 | ||
| @@ 68-77 (lines=10) @@ | ||
| 65 | * @inheritdoc |
|
| 66 | * @throws InvalidConfigException |
|
| 67 | */ |
|
| 68 | public function validate(string $expect): bool |
|
| 69 | { |
|
| 70 | $actual = $this->generate(); |
|
| 71 | ||
| 72 | if ($this->caseSensitive) { |
|
| 73 | return strcmp($expect, $actual) === 0; |
|
| 74 | } else { |
|
| 75 | return strcasecmp($expect, $actual) === 0; |
|
| 76 | } |
|
| 77 | } |
|
| 78 | ||
| 79 | } |
|
| 80 | ||