Issues (9)

src/Image/Strategy/TransparentStrategy.php (1 issue)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Del\Image\Strategy;
6
7
use GdImage;
8
9
abstract class TransparentStrategy
10
{
11 4
    public function handleTransparency(GdImage $newImage, GdImage $image): void
0 ignored issues
show
The parameter $image is not used and could be removed. ( Ignorable by Annotation )

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

11
    public function handleTransparency(GdImage $newImage, /** @scrutinizer ignore-unused */ GdImage $image): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
12
    {
13
        // Set blending mode as false
14 4
        \imagealphablending($newImage, false);
15
16
        // Tell it we want to save alpha channel info
17 4
        \imagesavealpha($newImage, true);
18
19
        // Set the transparent color
20 4
        $color = \imagecolorallocatealpha($newImage, 0, 0, 0, 127);
21
22
        // Fill the image with nothingness
23 4
        \imagefill($newImage, 0, 0, $color);
24
    }
25
}
26