for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Del\Image\Strategy;
use GdImage;
abstract class TransparentStrategy
{
public function handleTransparency(GdImage $newImage, GdImage $image): void
$image
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
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.
// Set blending mode as false
\imagealphablending($newImage, false);
// Tell it we want to save alpha channel info
\imagesavealpha($newImage, true);
// Set the transparent color
$color = \imagecolorallocatealpha($newImage, 0, 0, 0, 127);
// Fill the image with nothingness
\imagefill($newImage, 0, 0, $color);
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.