XmlCheckSchemaSubscriber::getSubscribedEvents()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiechu\SymfonyCommonsBundle\EventListener;
6
7
use Spiechu\SymfonyCommonsBundle\Event\ResponseSchemaCheck\Events;
8
use Spiechu\SymfonyCommonsBundle\Service\SchemaValidator\SchemaValidatorFactoryInterface;
9
use Spiechu\SymfonyCommonsBundle\Service\SchemaValidator\XmlSchemaValidatorFactory;
10
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
11
12
class XmlCheckSchemaSubscriber extends AbstractCheckSchemaSubscriber implements EventSubscriberInterface
13
{
14
    /**
15
     * @var XmlSchemaValidatorFactory
16
     */
17
    protected $xmlSchemaValidatorFactory;
18
19
    /**
20
     * @param XmlSchemaValidatorFactory $xmlSchemaValidatorFactory
21
     */
22 2
    public function __construct(XmlSchemaValidatorFactory $xmlSchemaValidatorFactory)
23
    {
24 2
        $this->xmlSchemaValidatorFactory = $xmlSchemaValidatorFactory;
25 2
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 8
    public static function getSubscribedEvents(): array
31
    {
32
        return [
33 8
            Events::getCheckSchemaEventNameFor('xml') => 'validateSchema',
34
        ];
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 2
    protected function getSchemaValidatorFactory(): SchemaValidatorFactoryInterface
41
    {
42 2
        return $this->xmlSchemaValidatorFactory;
43
    }
44
}
45