Passed
Push — master ( 77290b...f3fb78 )
by Marcel
09:09
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1
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 1
rs 10
1
<?php
2
3
namespace App\Security\Session;
4
5
use Doctrine\Common\EventSubscriber;
6
use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs;
7
use Doctrine\ORM\Tools\ToolEvents;
8
9
/**
10
 * Extends the database schema to allow storing user
11
 */
12
class ActiveSessionsDoctrineSchemaSubscriber implements EventSubscriber {
13
14
    public function __construct(private readonly ActiveSessionsResolver $sessionsResolver) {
15
16
    }
17
18
    public function postGenerateSchema(GenerateSchemaEventArgs $event): void {
19
        $this->sessionsResolver->configureSchema($event->getSchema(), $event->getEntityManager()->getConnection());
20
    }
21
22
    public function getSubscribedEvents(): array {
23
        return [
24
            ToolEvents::postGenerateSchema
25
        ];
26
    }
27
}