Passed
Push — master ( 420f5e...d683e4 )
by Mario
03:38
created

ResourceControllerException::validInternalServerErrorJsonResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 10
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace RafflesArgentina\ResourceController\Exceptions;
4
5
class ResourceControllerException extends \Exception
6
{
7
    /**
8
     * Report the exception.
9
     *
10
     * @return void
11
     */
12
    public function report()
13
    {
14
        //
15
    }
16
17
    /**
18
     * Render the exception into an HTTP response.
19
     *
20
     * @param \Illuminate\Http\Request $request The request object.
21
     *
22
     * @return mixed
23
     */
24
    public function render($request)
25
    {
26
        if ($request->wantsJson()) {
27
            return $this->validInternalServerErrorJsonResponse($this, $this->message);
0 ignored issues
show
Bug introduced by
The method validInternalServerErrorJsonResponse() does not exist on RafflesArgentina\Resourc...urceControllerException. ( Ignorable by Annotation )

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

27
            return $this->/** @scrutinizer ignore-call */ validInternalServerErrorJsonResponse($this, $this->message);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
28
        } else {
29
            return redirect()->back()->with(['rafflesargentina.status.error' => $this->message]);
30
        }
31
    }
32
}
33