delboy1978uk /
image
| 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
|
|||
| 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 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.