Passed
Pull Request — 2.7 (#6886)
by Grégoire
10:40
created

ClassMetadataInfoTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 27
c 0
b 0
f 0
rs 10
wmc 4

6 Methods

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

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