for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Api;
use App\Core as MinepicCore;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Laravel\Lumen\Http\ResponseFactory;
use Laravel\Lumen\Routing\Controller as BaseController;
/**
* Class BaseApiController.
*/
class DownloadTextureController extends BaseController
{
* @var MinepicCore
protected $minepic;
/** @var ResponseFactory */
protected $responseFactory;
* Api constructor.
public function __construct(
MinepicCore $minepic,
ResponseFactory $responseFactory
) {
$this->minepic = $minepic;
$this->responseFactory = $responseFactory;
}
* Serve Avatar.
*
* @param \Illuminate\Http\Request
* @throws \Throwable
public function serve(Request $request, string $uuidOrName = ''): Response
$request
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function serve(/** @scrutinizer ignore-unused */ Request $request, string $uuidOrName = ''): Response
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$headers = [
'Content-Disposition' => 'Attachment;filename='.$uuidOrName.'.png',
'Content-Type' => 'image/png',
];
$this->minepic->initialize($uuidOrName);
$avatarImage = $this->minepic->skinCurrentUser();
$avatarImage->prepareTextureDownload();
return $this->responseFactory->make($avatarImage, 200, $headers);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.