| 1 | <?php |
||
| 7 | final class GenericToken implements TokenInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The plain text. |
||
| 11 | * |
||
| 12 | * @var string|null |
||
| 13 | */ |
||
| 14 | private $plainText; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * The encrypted text. |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $encryptedText; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * GenericToken constructor. |
||
| 25 | * |
||
| 26 | * @param string $encryptedText The encrypted text. |
||
| 27 | * @param string|null $plainText The plain text string. |
||
| 28 | */ |
||
| 29 | 6 | public function __construct($encryptedText, $plainText = null) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Get the token as plain text. |
||
| 37 | * |
||
| 38 | * @return string|null |
||
| 39 | */ |
||
| 40 | 4 | public function plain() |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Get the token as encrypted text. |
||
| 47 | * |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | 5 | public function encrypted() |
|
| 55 | |||
| 56 | /** |
||
| 57 | * Convert the token to string. |
||
| 58 | * |
||
| 59 | * @return string |
||
| 60 | */ |
||
| 61 | 1 | public function __toString() |
|
| 65 | } |
||
| 66 |