for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace RafflesArgentina\ResourceController\Exceptions;
class ResourceControllerException extends \Exception
{
/**
* Report the exception.
*
* @return void
*/
public function report()
//
}
* Render the exception into an HTTP response.
* @param \Illuminate\Http\Request $request The request object.
* @return mixed
public function render($request)
if ($request->wantsJson()) {
return $this->validInternalServerErrorJsonResponse($this->message);
} else {
return redirect()->back()->with(['rafflesargentina.status.error' => $this->message]);
* Return a valid 500 Internal Server Error json response.
* @param string $message The response message.
* @return \Illuminate\Http\JsonResponse
public function validInternalServerErrorJsonResponse($message = 'Error')
$message
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function validInternalServerErrorJsonResponse(/** @scrutinizer ignore-unused */ $message = 'Error')
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return response()->json(
[
'exception' => class_basename($this),
'file' => basename($this->getFile()),
'line' => $this->getLine(),
'message' => $this->getMessage(),
'trace' => $this->getTrace(),
], 500, [], JSON_PRETTY_PRINT
);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.