Failed Conditions
Pull Request — master (#6886)
by Grégoire
09:46
created

ClassMetadataInfoTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 26
rs 10
wmc 3

5 Methods

Rating   Name   Duplication   Size   Complexity  
testExtendingClassWithOldSignatureStillWorks() 0 9 ?
A hp$0 ➔ testExtendingClassWithOldSignatureStillWorks() 0 9 1
A testTheClassIsDeprecated() 0 3 1
A hp$0 ➔ whatever() 0 3 1
whatever() 0 3 ?
1
<?php
2
3
namespace Doctrine\Tests\ORM\Mapping;
4
5
use Doctrine\ORM\Mapping\ClassMetadata;
6
use Doctrine\ORM\Mapping\ClassMetadataInfo;
7
use PHPUnit\Framework\TestCase;
8
9
class ClassMetadataInfoTest extends TestCase
10
{
11
    /**
12
     * @runInSeparateProcess
13
     * @group legacy
14
     * @expectedDeprecation Doctrine\ORM\Mapping\ClassMetadataInfo is deprecated since 2.x and will be removed in 3.0. Use Doctrine\ORM\Mapping\ClassMetadata instead.
15
     */
16
    public function testTheClassIsDeprecated() : void
17
    {
18
        $this->assertTrue(class_exists(ClassMetadataInfo::class));
19
    }
20
21
    public function testExtendingClassWithOldSignatureStillWorks() : void
22
    {
23
        $object = new class () extends ClassMetadataInfoTest {
24
            public function whatever(ClassMetadataInfo $cm) : bool
25
            {
26
                return true;
27
            }
28
        };
29
        $this->assertTrue($object->whatever(new ClassMetadata('MyEntity')));
30
    }
31
32
    public function whatever(ClassMetadata $cm) : bool
0 ignored issues
show
Unused Code introduced by
The parameter $cm is not used and could be removed. ( Ignorable by Annotation )

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

32
    public function whatever(/** @scrutinizer ignore-unused */ ClassMetadata $cm) : bool

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
    {
34
        return true;
35
    }
36
}
37