Code Duplication    Length = 10-11 lines in 2 locations

src/GD.php 2 locations

@@ 56-65 (lines=10) @@
53
     * @param int $level
54
     * @return ImageInterface
55
     */
56
    public function brightness(int $level): ImageInterface
57
    {
58
        if (!$this->compareRangeValue($level, 255))
59
        {
60
            throw new InvalidArgumentException('Wrong brightness level, range -255 - 255, ' . $level . ' given');
61
        }
62
        imagefilter($this->getImage(), IMG_FILTER_BRIGHTNESS, $level);
63
64
        return $this;
65
    }
66
67
    /**
68
     * @param int $level
@@ 71-81 (lines=11) @@
68
     * @param int $level
69
     * @return ImageInterface
70
     */
71
    public function contrast(int $level): ImageInterface
72
    {
73
        if (!$this->compareRangeValue($level, 100))
74
        {
75
            throw new InvalidArgumentException('Wrong contrast level, range -100 - 100, ' . $level . ' given');
76
        }
77
78
        imagefilter($this->getImage(), IMG_FILTER_CONTRAST, $level);
79
80
        return $this;
81
    }
82
83
    /**
84
     * @return ImageInterface