Passed
Push — master ( 92667b...7880ed )
by Aleksei
03:34
created

AnnotatedSchemaConveyor::addEntityPaths()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Cycle\Schema\Conveyor;
6
7
use Doctrine\Common\Annotations\AnnotationRegistry;
8
use Spiral\Attributes\AnnotationReader;
9
10
final class AnnotatedSchemaConveyor extends MetadataSchemaConveyor
11
{
12
    private bool $isAutoloadRegistered = false;
13
14 9
    public function getGenerators(): array
15
    {
16 9
        if (!$this->isAutoloadRegistered) {
17
            /**
18
             * autoload annotations
19
             *
20
             * @psalm-suppress DeprecatedMethod
21
             */
22 9
            AnnotationRegistry::registerLoader('class_exists');
0 ignored issues
show
Deprecated Code introduced by
The function Doctrine\Common\Annotati...istry::registerLoader() has been deprecated: This method is deprecated and will be removed in doctrine/annotations 2.0. Annotations will be autoloaded in 2.0. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

22
            /** @scrutinizer ignore-deprecated */ AnnotationRegistry::registerLoader('class_exists');

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
23 9
            $this->isAutoloadRegistered = true;
24
        }
25
26 9
        return parent::getGenerators();
27
    }
28
29 8
    protected function getMetadataReader(): AnnotationReader
30
    {
31 8
        return new AnnotationReader();
32
    }
33
}
34