LoggableContextFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 11
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A create() 0 5 1
1
<?php
2
3
namespace Locastic\Loggastic\Metadata\LoggableContext\Factory;
4
5
final class LoggableContextFactory implements LoggableContextFactoryInterface
6
{
7
    public function __construct(private readonly LoggableContextCollectionFactoryInterface $loggableContextCollectionFactory)
8
    {
9
    }
10
11
    public function create(string $loggableClass): ?array
12
    {
13
        $loggableContextCollection = $this->loggableContextCollectionFactory->create();
14
15
        return $loggableContextCollection->getByClass($loggableClass);
16
    }
17
}
18