GrayScaleCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 19
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 5 1
A __construct() 0 3 1
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