Issues (1)

src/Exceptions/LaraClientApiClientException.php (1 issue)

Severity
1
<?php
2
3
namespace Usamamuneerchaudhary\LaraClient\Exceptions;
4
5
use Exception;
6
use Illuminate\Support\Facades\Log;
7
8
class LaraClientApiClientException extends Exception
9
{
10
    protected $statusCode;
11
    protected $response;
12
13
    /**
14
     * @param $message
15
     * @param $statusCode
16
     * @param $response
17
     */
18
    public function __construct($message = '', $statusCode = null, $response = null)
19
    {
20
        parent::__construct($message);
21
        $this->statusCode = $statusCode;
22
        $this->response = $response;
23
    }
24
25
    /**
26
     * @return mixed|null
27
     */
28
    public function getStatusCode(): mixed
29
    {
30
        return $this->statusCode;
31
    }
32
33
    /**
34
     * @return mixed|null
35
     */
36
    public function getResponse(): mixed
37
    {
38
        return $this->response;
39
    }
40
41
    /**
42
     * @return void
43
     */
44
    public function report(): void
45
    {
46
        Log::debug('HTTP Error with Lara Client API');
47
    }
48
49
    /**
50
     * @param $request
51
     * @return \Illuminate\Http\JsonResponse
52
     */
53
    public function render($request): \Illuminate\Http\JsonResponse
0 ignored issues
show
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

53
    public function render(/** @scrutinizer ignore-unused */ $request): \Illuminate\Http\JsonResponse

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
54
    {
55
        return response()->json(["error" => true, "message" => $this->getStatusCode()]);
56
    }
57
}
58