| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function serve(Request $request, $uuidOrName = '', $size = 0): Response |
||
| 25 | { |
||
| 26 | $size = (int) $size; |
||
| 27 | $this->minepic->initialize($uuidOrName); |
||
| 28 | $headers = $this->generateHttpCacheHeaders($this->minepic->getUserdata(), $size, 'avatar'); |
||
| 29 | $this->minepic->updateStats(); |
||
| 30 | |||
| 31 | if ($request->server('HTTP_IF_MODIFIED_SINCE')) { |
||
| 32 | $avatarImage = ''; |
||
| 33 | $httpCode = 304; |
||
| 34 | } else { |
||
| 35 | $avatarImage = $this->minepic->renderSkinCurrentUser($size, 'F'); |
||
| 36 | $httpCode = 200; |
||
| 37 | $headers['Content-Type'] = 'image/png'; |
||
| 38 | } |
||
| 39 | |||
| 40 | return $this->responseFactory->make($avatarImage, $httpCode, $headers); |
||
| 41 | } |
||
| 43 |