| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | 3 | public function hash(Response $response) |
|
| 48 | { |
||
| 49 | $params = [ |
||
| 50 | 3 | $response->getLastModified()->format(\DateTime::ISO8601), |
|
| 51 | 3 | ]; |
|
| 52 | |||
| 53 | // add cookies to ETag |
||
| 54 | 3 | if ($this->request_stack->getMasterRequest()) { |
|
| 55 | 2 | $params[] = http_build_query($this->request_stack->getMasterRequest()->cookies->all()); |
|
| 56 | 2 | } |
|
| 57 | |||
| 58 | 3 | return hash($this->algorithm, implode(self::ETAG_SEPARATOR, $params)); |
|
| 59 | } |
||
| 60 | } |
||
| 61 |