SecurityUnauthorizedResponse   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 12
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A setSecurityResponse() 0 7 1
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
}