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

AbstractClassMetadataFactory::getMetadataFor()   B

Complexity

Conditions 10
Paths 61

Size

Total Lines 56
Code Lines 31

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 26
CRAP Score 10.0363

Importance

Changes 7
Bugs 0 Features 1
Metric Value
eloc 31
c 7
b 0
f 1
dl 0
loc 56
rs 7.6666
ccs 26
cts 28
cp 0.9286
cc 10
nc 61
nop 1
crap 10.0363

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