Passed
Push — master ( 6b81ad...6f63e3 )
by Nuno
02:17
created

FacadeMethodExtension   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 28
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A searchIn() 0 10 2
A subject() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of Laravel Code Analyse.
7
 *
8
 * (c) Nuno Maduro <[email protected]>
9
 *
10
 *  For the full copyright and license information, please view the LICENSE
11
 *  file that was distributed with this source code.
12
 */
13
14
namespace NunoMaduro\LaravelCodeAnalyse\Extensions;
15
16
use function get_class;
17
use Illuminate\Support\Facades\Facade;
18
use NunoMaduro\LaravelCodeAnalyse\FacadeConcreteClassResolver;
0 ignored issues
show
Bug introduced by
The type NunoMaduro\LaravelCodeAn...deConcreteClassResolver 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...
19
20
final class FacadeMethodExtension extends AbstractExtension
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    protected $staticAccess = true;
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    protected function subject(): string
31
    {
32
        return Facade::class;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    protected function searchIn(): string
39
    {
40
        $facadeClass = $this->classReflection->getNativeReflection()
41
            ->getName();
42
43
        if ($concrete = $facadeClass::getFacadeRoot()) {
44
            return get_class($concrete);
45
        }
46
47
        return NullConcreteClass::class;
48
    }
49
}
50