UpdateTableHandler::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
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