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

FacadeResolver::resolve()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 10
ccs 4
cts 5
cp 0.8
crap 2.032
rs 10
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