| 1 | <?php |
||
| 5 | final class GenericToken implements TokenInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * The plain text. |
||
| 9 | * |
||
| 10 | * @var string|null |
||
| 11 | */ |
||
| 12 | private $plainText; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The encrypted text. |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $encryptedText; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * GenericToken constructor. |
||
| 23 | * |
||
| 24 | * @param string $encryptedText The encrypted text. |
||
| 25 | * @param string|null $plainText The plain text string. |
||
| 26 | */ |
||
| 27 | public function __construct($encryptedText, $plainText = null) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Get the token as plain text. |
||
| 35 | * |
||
| 36 | * @return string|null |
||
| 37 | */ |
||
| 38 | public function plain() |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Get the token as encrypted text. |
||
| 45 | * |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | public function encrypted() |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Convert the token to string. |
||
| 55 | * |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | public function __toString() |
||
| 62 | } |
||
| 63 |