| Total Complexity | 9 |
| Total Lines | 83 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class RequestState |
||
| 17 | { |
||
| 18 | /** @var string */ |
||
| 19 | private $id; |
||
| 20 | |||
| 21 | /** @var ParameterBag */ |
||
| 22 | private $parameters; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param string $id |
||
| 26 | * @param mixed $nonce |
||
| 27 | */ |
||
| 28 | public function __construct($id = null, $nonce = null) |
||
| 29 | { |
||
| 30 | $this->id = $id; |
||
| 31 | $this->parameters = new ParameterBag(); |
||
| 32 | if ($nonce) { |
||
| 33 | $this->parameters->set('nonce', $nonce); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param string $id |
||
| 39 | * |
||
| 40 | * @return RequestState |
||
| 41 | */ |
||
| 42 | public function setId($id) |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | public function getId() |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return ParameterBag |
||
| 59 | */ |
||
| 60 | public function getParameters() |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @deprecated Since 1.2, to be removed in 2.0. Use getParameters() instead |
||
| 67 | * |
||
| 68 | * @param mixed $nonce |
||
| 69 | * |
||
| 70 | * @return RequestState |
||
| 71 | */ |
||
| 72 | public function setNonce($nonce) |
||
| 73 | { |
||
| 74 | $this->parameters->set('nonce', $nonce); |
||
| 75 | |||
| 76 | return $this; |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @deprecated Since 1.2, to be removed in 2.0. Use getParameters() instead |
||
| 81 | * |
||
| 82 | * @return mixed |
||
| 83 | */ |
||
| 84 | public function getNonce() |
||
| 87 | } |
||
| 88 | |||
| 89 | public function __serialize(): array { |
||
| 93 | ]; |
||
| 94 | } |
||
| 95 | |||
| 96 | public function __unserialize(array $data): void { |
||
| 101 |