Passed
Push — master ( d7d8c0...c26592 )
by Mads
03:35
created

RequestServiceProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 0 5 2
A register() 0 2 1
1
<?php
2
3
namespace Napp\Core\Api\Requests\Provider;
4
5
use Illuminate\Http\Request;
6
use Illuminate\Support\ServiceProvider;
7
use Napp\Core\Api\Auth\NappHttpHeaders;
8
9
class RequestServiceProvider extends ServiceProvider
10
{
11 6
    public function boot()
12
    {
13 6
        if (false === Request::hasMacro('isApiInternalCall')) {
14 4
            Request::macro('isApiInternalCall', function () {
15 4
                return $this->header(NappHttpHeaders::NAPP_API_CALL_TYPE) === 'internal';
0 ignored issues
show
Bug introduced by
The method header() does not exist on Napp\Core\Api\Requests\P...\RequestServiceProvider. ( Ignorable by Annotation )

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

15
                return $this->/** @scrutinizer ignore-call */ header(NappHttpHeaders::NAPP_API_CALL_TYPE) === 'internal';

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...
16 2
            });
17
        }
18 6
    }
19
20 6
    public function register()
21
    {
22 6
    }
23
}
24