Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
26 | 3 | public function player(): PlayerDto |
|
27 | { |
||
28 | 3 | $token = $this->tokenStorage->getToken(); |
|
29 | 3 | if (null === $token) { |
|
30 | 1 | throw new PlayerNotFoundInTokenStorageException(); |
|
31 | } |
||
32 | |||
33 | try { |
||
34 | 2 | $decoded = json_decode($token->getUser(), true, 512, JSON_THROW_ON_ERROR); |
|
35 | |||
36 | 1 | return new PlayerDto( |
|
37 | 1 | new PlayerId(UuidV4::fromString($decoded['id'])), |
|
38 | 1 | $decoded['nickname'], |
|
39 | 1 | (int) $decoded['level'], |
|
40 | 1 | new Role($decoded['role']) |
|
41 | ); |
||
42 | 1 | } catch (JsonException) { |
|
43 | 1 | throw new PlayerNotFoundInTokenStorageException(); |
|
44 | } |
||
47 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths