| Total Complexity | 5 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 86.67% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class PngStrategy extends TransparentStrategy implements ImageTypeStrategyInterface |
||
| 6 | {
|
||
| 7 | /** |
||
| 8 | * @param string $filename |
||
| 9 | * @return resource |
||
| 10 | */ |
||
| 11 | 12 | public function create(string $filename) |
|
| 12 | {
|
||
| 13 | 12 | return \imagecreatefrompng($filename); |
|
|
|
|||
| 14 | } |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param resource $resource |
||
| 18 | * @param string $filename |
||
| 19 | * @param int $compression |
||
| 20 | * @return void |
||
| 21 | */ |
||
| 22 | 1 | public function save($resource, string $filename = null, int $compression = 100): void |
|
| 26 | 1 | } |
|
| 27 | |||
| 28 | /** |
||
| 29 | * @return string |
||
| 30 | */ |
||
| 31 | 2 | public function getContentType(): string |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param $resource |
||
| 38 | */ |
||
| 39 | 8 | public function render($resource): void |
|
| 44 | 8 | } |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | public function getFileExtension(): string |
||
| 52 | } |
||
| 53 | } |
If the returned type also contains false, it is an indicator that maybe an error condition leading to the specific return statement remains unhandled.