| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | public function __construct(string $clientData) |
||
| 46 | { |
||
| 47 | $this->rawData = Base64Url::decode($clientData); |
||
| 48 | $clientData = json_decode($this->rawData, true); |
||
| 49 | if (!\is_array($clientData)) { |
||
| 50 | throw new \InvalidArgumentException('Invalid client data.'); |
||
| 51 | } |
||
| 52 | |||
| 53 | $diff = array_diff_key(get_class_vars(self::class), $clientData); |
||
| 54 | unset($diff['rawData'], $diff['cid_pubkey']); |
||
| 55 | |||
| 56 | if (!empty($diff)) { |
||
| 57 | throw new \InvalidArgumentException('Invalid client data.'); |
||
| 58 | } |
||
| 59 | |||
| 60 | foreach ($clientData as $k => $v) { |
||
| 61 | $this->$k = $v; |
||
| 62 | } |
||
| 90 |