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

testExtendingClassWithOldSignatureStillWorks()

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
nc 1
nop 0
dl 0
loc 9
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ClassMetadataInfoTest.php$0 ➔ whatever() 0 3 1
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