for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Del\Image\Strategy;
abstract class TransparentStrategy
{
/**
* @param resource $newImage
* @param resource $image
*/
public function handleTransparency($newImage, $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($newImage, /** @scrutinizer ignore-unused */ $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.