Issues (115)

src/Services/ValidateService.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace VGirol\JsonApi\Services;
4
5
use Illuminate\Http\Request;
6
use VGirol\JsonApiStructure\Exception\ValidationException;
7
use VGirol\JsonApiStructure\ValidateService as JsonApiStructureValidateService;
8
9
class ValidateService extends JsonApiStructureValidateService
10
{
11
    /**
12
     * Undocumented function
13
     *
14
     * @param Request $request
15
     * @param int     $options
16
     *
17
     * @return void
18
     */
19
    public function validateRequestStructure($request): void
20
    {
21
        try {
22
            $this->setMethod($request->method());
0 ignored issues
show
The method method() does not exist on Illuminate\Http\Request. ( Ignorable by Annotation )

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

22
            $this->setMethod($request->/** @scrutinizer ignore-call */ method());

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...
23
            $this->validateStructure($request->input(), $this->strict);
0 ignored issues
show
The method input() does not exist on Illuminate\Http\Request. ( Ignorable by Annotation )

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

23
            $this->validateStructure($request->/** @scrutinizer ignore-call */ input(), $this->strict);

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...
24
        } catch (ValidationException $e) {
25
            $class = "\VGirol\JsonApi\Exceptions\JsonApi{$e->errorStatus()}Exception";
26
            throw new $class($e->getMessage());
27
        }
28
    }
29
}
30