Completed
Push — master ( 8ba72f...a2bda9 )
by Derek Stephen
01:51
created

JpegStrategy::handleTransparency()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Del\Image\Strategy;
4
5
class JpegStrategy implements ImageTypeStrategyInterface
6
{
7
    /**
8
     * @param string $filename
9
     * @return resource
10
     */
11 4
    public function create($filename)
12
    {
13 4
        return imagecreatefromjpeg($filename);
14
    }
15
16 1
    public function save($resource, $filename, $compression)
17
    {
18 1
        imagejpeg($resource, $filename, $compression);
19 1
    }
20
21
    /**
22
     * @return string
23
     */
24 1
    public function getContentType()
25
    {
26 1
        return 'image/jpeg';
27
    }
28
29
    /**
30
     * @param $resource
31
     */
32 3
    public function render($resource)
33
    {
34 3
        imagejpeg($resource);
35 3
    }
36
37
    /**
38
     * @return void
39
     */
40
    public function handleTransparency($newImage, $image)
41
    {
42
        return;
43
    }
44
45
46
}