Passed
Push — feature/remove-setup-as-array ( 3bb37a...da7ebe )
by Jesús
04:16 queued 36s
created

FacadeResolver   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 22
ccs 6
cts 7
cp 0.8571
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 10 2
A getResolvableType() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Framework\ClassResolver\Facade;
6
7
use Gacela\Framework\AbstractFacade;
8
use Gacela\Framework\ClassResolver\AbstractClassResolver;
9
10
final class FacadeResolver extends AbstractClassResolver
11
{
12
    /**
13
     * @param object|class-string $caller
0 ignored issues
show
Documentation Bug introduced by
The doc comment object|class-string at position 2 could not be parsed: Unknown type name 'class-string' at position 2 in object|class-string.
Loading history...
14
     *
15
     * @throws FacadeNotFoundException
16
     */
17 1
    public function resolve($caller): AbstractFacade
18
    {
19
        /** @var ?AbstractFacade $resolved */
20 1
        $resolved = $this->doResolve($caller);
21
22 1
        if ($resolved === null) {
23
            throw new FacadeNotFoundException($caller);
24
        }
25
26 1
        return $resolved;
27
    }
28
29 1
    protected function getResolvableType(): string
30
    {
31 1
        return 'Facade';
32
    }
33
}
34