Passed
Pull Request — main (#339)
by Chema
05:43 queued 01:20
created

DocBlockResolverAttributeBased   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 15
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFactory() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Benchmark\DocBlockResolver;
6
7
use Gacela\Framework\AbstractFactory;
8
use Gacela\Framework\DocBlockResolver\Doc;
9
use Gacela\Framework\DocBlockResolverAwareTrait;
10
11
/**
12
 * Test class for benchmarking attribute-based resolution.
13
 * Uses PHP attributes for performance comparison.
14
 */
15
#[Doc(method: 'getFactory', className: AbstractFactory::class)]
16
final class DocBlockResolverAttributeBased
17
{
18
    use DocBlockResolverAwareTrait;
19
20
    /**
21
     * Get factory through attribute-based resolution (fast path).
22
     * This will use searchClassOverAttributes() in DocBlockResolver.
23
     */
24
    public function getFactory(): AbstractFactory
25
    {
26
        /** @var AbstractFactory $factory */
27
        $factory = $this->__call('getFactory', []);
28
29
        return $factory;
30
    }
31
}
32