Failed Conditions
Pull Request — 1.3.x (#71)
by Grégoire
02:19
created

AnnotationDriver::getAllClassNames()   C

Complexity

Conditions 12
Paths 27

Size

Total Lines 64
Code Lines 35

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 29
CRAP Score 13.0579

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 35
c 3
b 0
f 0
dl 0
loc 64
rs 6.9666
ccs 29
cts 36
cp 0.8056
cc 12
nc 27
nop 0
crap 13.0579

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace Doctrine\Common\Persistence\Mapping\Driver;
4
5
use const E_USER_DEPRECATED;
6
use function class_alias;
7
use function class_exists;
8
use function sprintf;
9
use function trigger_error;
10
11
if (! class_exists(\Doctrine\Persistence\Mapping\Driver\AnnotationDriver::class, false)) {
12
    @trigger_error(sprintf(
13
        'The %s\AnnotationDriver class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0.'
14
        . ' Use \Doctrine\Persistence\Mapping\Driver\AnnotationDriver instead.',
15
        __NAMESPACE__
16
    ), E_USER_DEPRECATED);
17
}
18
19
class_alias(
20
    \Doctrine\Persistence\Mapping\Driver\AnnotationDriver::class,
21
    __NAMESPACE__ . '\AnnotationDriver'
22
);
23
24
if (false) {
25
    /**
26
     * @deprecated 1.3 Use Doctrine\Persistence\Mapping\Driver\AnnotationDriver
27
     */
28
    abstract class AnnotationDriver extends \Doctrine\Persistence\Mapping\Driver\AnnotationDriver
29
    {
30
    }
31
}
32