Passed
Push — add-with-all-to-modules-list ( 82b81d...0edb38 )
by Chema
03:40
created

FactoryResolver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10
c 3
b 0
f 0
eloc 5
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 6 1
A getResolvableType() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gacela\Framework\ClassResolver\Factory;
6
7
use Gacela\Framework\AbstractFactory;
8
use Gacela\Framework\ClassResolver\AbstractClassResolver;
9
10
final class FactoryResolver extends AbstractClassResolver
11
{
12
    public const TYPE = 'Factory';
13
14
    /**
15
     * @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...
16
     */
17 56
    public function resolve(object|string $caller): AbstractFactory
18
    {
19
        /** @var AbstractFactory $resolved */
20 56
        $resolved = $this->doResolve($caller);
21
22 56
        return $resolved;
23
    }
24
25 56
    protected function getResolvableType(): string
26
    {
27 56
        return self::TYPE;
28
    }
29
}
30