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

ClassMetadataInfoTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testTheClassIsDeprecated() 0 3 1
testExtendingClassWithOldSignatureStillWorks() 0 9 ?
A hp$0 ➔ testExtendingClassWithOldSignatureStillWorks() 0 9 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
     * @group legacy
13
     * @expectedDeprecation Doctrine\ORM\Mapping\ClassMetadataInfo is deprecated since 2.x and will be removed in 3.0. Use Doctrine\ORM\Mapping\ClassMetadata instead.
14
     */
15
    public function testTheClassIsDeprecated() : void
16
    {
17
        $this->assertTrue(class_exists(ClassMetadataInfo::class));
18
    }
19
20
    public function testExtendingClassWithOldSignatureStillWorks() : void
21
    {
22
        $object = new class () extends ClassMetadataInfoTest {
23
            public function whatever(ClassMetadataInfo $cm) : bool
24
            {
25
                return true;
26
            }
27
        };
28
        $this->assertTrue($object->whatever(new ClassMetadata('MyEntity')));
29
    }
30
31
    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

31
    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...
32
    {
33
        return true;
34
    }
35
}
36