for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\Image;
use App\Image\Sections\Avatar;
use App\Image\Sections\Skin;
class Rendering
{
/**
* @param string $imagePath
* @param int $size
* @param string $type
*
* @throws Exceptions\ImageCreateFromPngFailedException
* @throws Exceptions\ImageTrueColorCreationFailedException
* @throws Exceptions\InvalidSectionSpecifiedException
* @return Avatar
*/
public function avatar(string $imagePath, int $size, $type = ImageSection::FRONT): Avatar
$avatar = new Avatar($imagePath);
$avatar->render($size, $type);
return $avatar;
}
public function isometricAvatar(string $imagePath, int $size): IsometricAvatar
$imagePath
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function isometricAvatar(/** @scrutinizer ignore-unused */ string $imagePath, int $size): IsometricAvatar
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$uuid = $this->userdata->uuid ?? env('DEFAULT_UUID');
userdata
App\Image\Rendering
$timestamp = $this->userdata->updated_at->timestamp ?? \time();
$isometricAvatar = new IsometricAvatar(
$uuid,
$timestamp
);
$isometricAvatar->render($size);
return $isometricAvatar;
* @throws \Throwable
* @return Skin
public function skin(string $imagePath, int $size, $type = ImageSection::FRONT): Skin
$skin = new Skin($imagePath);
$skin->render($size, $type);
return $skin;
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.