| Total Complexity | 3 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class Rendering |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @param string $imagePath |
||
| 14 | * @param int $size |
||
| 15 | * @param string $type |
||
| 16 | * |
||
| 17 | * @throws Exceptions\ImageCreateFromPngFailedException |
||
| 18 | * @throws Exceptions\ImageTrueColorCreationFailedException |
||
| 19 | * @throws Exceptions\InvalidSectionSpecifiedException |
||
| 20 | * |
||
| 21 | * @return Avatar |
||
| 22 | */ |
||
| 23 | public function avatar(string $imagePath, int $size, $type = ImageSection::FRONT): Avatar |
||
| 24 | { |
||
| 25 | $avatar = new Avatar($imagePath); |
||
| 26 | $avatar->render($size, $type); |
||
| 27 | |||
| 28 | return $avatar; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function isometricAvatar(string $imagePath, int $size): IsometricAvatar |
||
|
|
|||
| 32 | { |
||
| 33 | $uuid = $this->userdata->uuid ?? env('DEFAULT_UUID'); |
||
| 34 | $timestamp = $this->userdata->updated_at->timestamp ?? \time(); |
||
| 35 | $isometricAvatar = new IsometricAvatar( |
||
| 36 | $uuid, |
||
| 37 | $timestamp |
||
| 38 | ); |
||
| 39 | $isometricAvatar->render($size); |
||
| 40 | |||
| 41 | return $isometricAvatar; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param string $imagePath |
||
| 46 | * @param int $size |
||
| 47 | * @param string $type |
||
| 48 | * |
||
| 49 | * @throws \Throwable |
||
| 50 | * |
||
| 51 | * @return Skin |
||
| 52 | */ |
||
| 53 | public function skin(string $imagePath, int $size, $type = ImageSection::FRONT): Skin |
||
| 59 | } |
||
| 60 | } |
||
| 61 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.