UpdateTableHandler   A
last analyzed

Complexity

Total Complexity 2

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 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VideoGamesRecords\DwhBundle\Scheduler\Handler;
6
7
use Symfony\Component\DependencyInjection\Attribute\Autowire;
8
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
9
use VideoGamesRecords\DwhBundle\Manager\TableManager;
10
use VideoGamesRecords\DwhBundle\Scheduler\Message\UpdateTable;
11
12
#[AsMessageHandler]
13
class UpdateTableHandler
14
{
15
    public function __construct(
16
        #[Autowire(service: 'vgr.dwh.manager.table')]
17
        private readonly TableManager $tableManager
18
    ) {
19
    }
20
21
    public function __invoke(UpdateTable $message): void
22
    {
23
        $target = $message->getTarget();
24
        $function = $message->getFunction();
25
26
        $this->tableManager->getStrategy($target)->$function();
27
    }
28
}
29