Issues (73)

src/Command/RotateCommand.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Jackal\ImageMerge\Command;
4
5
use Jackal\ImageMerge\Command\Options\LevelCommandOption;
6
use Jackal\ImageMerge\Model\Image;
7
8
/**
9
 * Class RotateCommand
10
 * @package Jackal\ImageMerge\Command
11
 */
12
class RotateCommand extends AbstractCommand
13
{
14
    /**
15
     * RotateCommand constructor.
16
     * @param LevelCommandOption $options
17
     */
18
    public function __construct(LevelCommandOption $options)
19
    {
20
        parent::__construct($options);
21
    }
22
23
    /**
24
     * @param Image $image
25
     * @return Image
26
     */
27
    public function execute(Image $image)
28
    {
29
        $degree = $this->options->getLevel();
0 ignored issues
show
The method getLevel() does not exist on Jackal\ImageMerge\Comman...\CommandOptionInterface. It seems like you code against a sub-type of Jackal\ImageMerge\Comman...\CommandOptionInterface such as Jackal\ImageMerge\Comman...ions\LevelCommandOption. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
        /** @scrutinizer ignore-call */ 
30
        $degree = $this->options->getLevel();
Loading history...
30
        $resource = $image->getResource();
31
        if ($degree and ($degree % 360)) {
32
            $resource = imagerotate($resource, $degree, 0);
33
        }
34
35
        return $image->assignResource($resource);
36
    }
37
}
38