| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | public function hasCacheableContentType(Response $response): bool |
||
| 51 | { |
||
| 52 | $contentType = $response->headers->get('Content-Type', ''); |
||
| 53 | |||
| 54 | if (Str::startsWith($contentType, 'text/')) { |
||
| 55 | return true; |
||
| 56 | } |
||
| 57 | |||
| 58 | if (Str::contains($contentType, ['/json', '+json'])) { |
||
| 59 | return true; |
||
| 60 | } |
||
| 61 | |||
| 62 | return false; |
||
| 63 | } |
||
| 64 | } |
||
| 65 |