| Conditions | 4 |
| Paths | 5 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 13 | public static function createFromPayload(string $payload): SessionUser |
|
| 19 | { |
||
| 20 | 13 | $res = new static(); |
|
| 21 | 13 | $ar = explode(':', $payload); |
|
| 22 | 13 | if (is_array($ar)) { |
|
|
|
|||
| 23 | 13 | if (isset($ar[0])) { |
|
| 24 | 13 | $res->roleId = (string)$ar[0]; |
|
| 25 | } |
||
| 26 | 13 | if (isset($ar[1])) { |
|
| 27 | 13 | $res->userId = (string)$ar[1]; |
|
| 28 | } |
||
| 29 | } |
||
| 30 | 13 | return $res; |
|
| 31 | } |
||
| 33 |