GrayScaleCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Jackal\ImageMerge\Command;
4
5
use Jackal\ImageMerge\Model\Image;
6
7
/**
8
 * Class GrayScaleCommand
9
 * @package Jackal\ImageMerge\Command
10
 */
11
class GrayScaleCommand extends AbstractCommand
12
{
13
    /**
14
     * GrayScaleCommand constructor.
15
     */
16
    public function __construct()
17
    {
18
        parent::__construct(null);
19
    }
20
21
    /**
22
     * @param Image $image
23
     * @return Image
24
     */
25
    public function execute(Image $image)
26
    {
27
        imagefilter($image->getResource(), IMG_FILTER_GRAYSCALE);
28
29
        return $image;
30
    }
31
}
32