| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | 4 | public function generate(ServerRequestInterface $request): string |
|
| 16 | { |
||
| 17 | 4 | $uri = $request->getUri(); |
|
| 18 | |||
| 19 | 4 | if ('' === $uri->getPath()) { |
|
| 20 | 2 | $message = 'Cannot auto-detect current page identity'; |
|
| 21 | 2 | throw new RuntimeException($message); |
|
| 22 | } |
||
| 23 | |||
| 24 | 2 | $vars = [self::SALT, $uri->getPath(), $uri->getPort(), $uri->getHost(), $uri->getQuery()]; |
|
| 25 | |||
| 26 | 2 | return $this->getHash($vars); |
|
| 27 | } |
||
| 29 |