GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 458c25...71cecb )
by Edi
09:51
created

BuildSchemaListener   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSubscribedEvents() 0 6 1
A onBuildSchema() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Netgen\Bundle\EnhancedSelectionBundle\Installer;
6
7
use EzSystems\DoctrineSchema\API\Event\SchemaBuilderEvent;
8
use EzSystems\DoctrineSchema\API\Event\SchemaBuilderEvents;
9
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
10
11
final class BuildSchemaListener implements EventSubscriberInterface
12
{
13
    /**
14
     * @var string
15
     */
16
    private $schemaPath;
17
18
    public function __construct(string $schemaPath)
19
    {
20
        $this->schemaPath = $schemaPath;
21
    }
22
23
    public static function getSubscribedEvents(): array
24
    {
25
        return [
26
            SchemaBuilderEvents::BUILD_SCHEMA => 'onBuildSchema',
27
        ];
28
    }
29
30
    public function onBuildSchema(SchemaBuilderEvent $event): void
31
    {
32
        $event
33
            ->getSchemaBuilder()
34
            ->importSchemaFromFile($this->schemaPath);
35
    }
36
}
37