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.

ConfirmableListener::loadClassMetadata()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
rs 10
c 0
b 0
f 0
cc 3
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\Doctrine\EventListener\ORM;
13
14
use Core23\Doctrine\Model\Traits\ConfirmableTrait;
15
use Core23\Doctrine\Util\ClassUtils;
16
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
17
use Doctrine\ORM\Events;
18
use Doctrine\ORM\Mapping\MappingException;
19
20
final class ConfirmableListener extends AbstractListener
21
{
22
    public function getSubscribedEvents()
23
    {
24
        return [
25
            Events::loadClassMetadata,
26
        ];
27
    }
28
29
    /**
30
     * @throws MappingException
31
     */
32
    public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void
33
    {
34
        $meta = $eventArgs->getClassMetadata();
35
36
        $reflClass = $meta->getReflectionClass();
37
38
        if (null === $reflClass || !ClassUtils::containsTrait($reflClass, ConfirmableTrait::class)) {
39
            return;
40
        }
41
42
        $this->createDateTimeField($meta, 'confirmedAt', true);
43
    }
44
}
45