Total Complexity | 6 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 94.44% |
Changes | 0 |
1 | <?php |
||
5 | class PngStrategy extends AbstractTransparentImage implements ImageTypeStrategyInterface |
||
6 | { |
||
7 | /** |
||
8 | * @param string $filename |
||
9 | * @return resource |
||
10 | */ |
||
11 | 12 | public function create($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, $filename, $compression) |
|
26 | 1 | } |
|
27 | |||
28 | /** |
||
29 | * @return string |
||
30 | */ |
||
31 | 1 | public function getContentType() |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param $resource |
||
38 | */ |
||
39 | 9 | public function render($resource) |
|
40 | { |
||
41 | 9 | imagealphablending($resource, true); |
|
42 | 9 | imagesavealpha($resource, true); |
|
43 | 9 | imagepng($resource); |
|
44 | 9 | } |
|
45 | |||
46 | 6 | public function handleTransparency($newImage, $image) |
|
61 | } |
||
62 | } |
||
63 | } |