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

StaticPHPDriver::getAllClassNames()   B

Complexity

Conditions 10
Paths 15

Size

Total Lines 49
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 25
CRAP Score 10.1228

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 27
c 1
b 0
f 0
dl 0
loc 49
rs 7.6666
ccs 25
cts 28
cp 0.8929
cc 10
nc 15
nop 0
crap 10.1228

How to fix   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 1
if (! class_exists(\Doctrine\Persistence\Mapping\Driver\StaticPHPDriver::class, false)) {
12
    @trigger_error(sprintf(
13
        'The %s\Driver\StaticPHPDriver class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0.'
14
        . ' Use \Doctrine\Persistence\Mapping\Driver\StaticPHPDriver instead.',
15
        __NAMESPACE__
16
    ), E_USER_DEPRECATED);
17
}
18
19 1
class_alias(
20 1
    \Doctrine\Persistence\Mapping\Driver\StaticPHPDriver::class,
21 1
    __NAMESPACE__ . '\StaticPHPDriver'
22
);
23
24 1
if (false) {
25
    /**
26
     * @deprecated 1.3 Use Doctrine\Persistence\Mapping\Driver\StaticPHPDriver
27
     */
28
    class StaticPHPDriver extends \Doctrine\Persistence\Mapping\Driver\StaticPHPDriver
29
    {
30
    }
31
}
32