setSecurityResponse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
ccs 0
cts 6
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
5
namespace Xervice\Service\Middleware\Security\Response;
6
7
8
use DataProvider\ApiAuthenticationFailedDataProvider;
0 ignored issues
show
Bug introduced by
The type DataProvider\ApiAuthenticationFailedDataProvider was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Illuminate\Http\Request;
10
use Xervice\Service\Application\Response\ApiResponse;
11
12
class SecurityUnauthorizedResponse extends ApiResponse implements SecurityUnauthorizedResponseInterface
13
{
14
    /**
15
     * @param \Illuminate\Http\Request $request
16
     */
17
    public function setSecurityResponse(Request $request): void
18
    {
19
        $message = new ApiAuthenticationFailedDataProvider();
20
        $message->setStatus(401);
21
        $message->setMessage('Unauthorized');
22
23
        $this->setDataProvider($message);
24
    }
25
26
}