Total Complexity | 6 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 85.71% |
Changes | 0 |
1 | <?php |
||
5 | class JpegStrategy implements ImageTypeStrategyInterface |
||
6 | { |
||
7 | /** |
||
8 | * @param string $filename |
||
9 | * @return null|resource |
||
10 | */ |
||
11 | 6 | public function create(string $filename) |
|
14 | } |
||
15 | |||
16 | /** |
||
17 | * @param resource $resource |
||
18 | * @param string $filename |
||
19 | * @param int $compression |
||
20 | */ |
||
21 | 1 | public function save($resource, string $filename = null, int $compression = 100): void |
|
24 | 1 | } |
|
25 | |||
26 | /** |
||
27 | * @return string |
||
28 | */ |
||
29 | 1 | public function getContentType(): string |
|
30 | { |
||
31 | 1 | return 'image/jpeg'; |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * @param resource $resource |
||
36 | */ |
||
37 | 4 | public function render($resource): void |
|
40 | 4 | } |
|
41 | |||
42 | /** |
||
43 | * @param resource $newImage |
||
44 | * @param resource $image |
||
45 | */ |
||
46 | 1 | public function handleTransparency($newImage, $image): void |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * @return string |
||
54 | */ |
||
55 | public function getFileExtension(): string |
||
58 | } |
||
59 | } |
If the returned type also contains false, it is an indicator that maybe an error condition leading to the specific return statement remains unhandled.