sfelix-martins /
json-exception-handler
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace SMartins\Exceptions\Handlers; |
||||
| 4 | |||||
| 5 | use SMartins\Exceptions\JsonApi\Error; |
||||
| 6 | use SMartins\Exceptions\JsonApi\Source; |
||||
| 7 | use League\OAuth2\Server\Exception\OAuthServerException; |
||||
|
0 ignored issues
–
show
|
|||||
| 8 | |||||
| 9 | class OAuthServerHandler extends AbstractHandler |
||||
| 10 | { |
||||
| 11 | /** |
||||
| 12 | * Create instance using the Exception to be handled. |
||||
| 13 | * |
||||
| 14 | * @param \League\OAuth2\Server\Exception\OAuthServerException $e |
||||
| 15 | */ |
||||
| 16 | public function __construct(OAuthServerException $e) |
||||
| 17 | { |
||||
| 18 | parent::__construct($e); |
||||
| 19 | } |
||||
| 20 | |||||
| 21 | /** |
||||
| 22 | * {@inheritdoc} |
||||
| 23 | */ |
||||
| 24 | public function handle() |
||||
| 25 | { |
||||
| 26 | return (new Error)->setStatus($this->getHttpStatusCode()) |
||||
|
0 ignored issues
–
show
The method
getHttpStatusCode() does not exist on SMartins\Exceptions\Handlers\OAuthServerHandler. Did you maybe mean getStatusCode()?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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...
|
|||||
| 27 | ->setCode($this->getCode()) |
||||
| 28 | ->setSource((new Source())->setPointer($this->getDefaultPointer())) |
||||
| 29 | ->setTitle($this->exception->getErrorType()) |
||||
|
0 ignored issues
–
show
The method
getErrorType() does not exist on Exception.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
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...
|
|||||
| 30 | ->setDetail($this->exception->getMessage()); |
||||
| 31 | } |
||||
| 32 | } |
||||
| 33 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths