for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Doctrine\Tests\ORM\Mapping;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use PHPUnit\Framework\TestCase;
class ClassMetadataInfoTest extends TestCase
{
/**
* @runInSeparateProcess
* @group legacy
* @expectedDeprecation Doctrine\ORM\Mapping\ClassMetadataInfo is deprecated since 2.x and will be removed in 3.0. Use Doctrine\ORM\Mapping\ClassMetadata instead.
*/
public function testTheClassIsDeprecated() : void
$this->assertTrue(class_exists(ClassMetadataInfo::class));
}
public function testExtendingClassWithOldSignatureStillWorks() : void
$object = new class () extends ClassMetadataInfoTest {
public function whatever(ClassMetadataInfo $cm) : bool
return true;
};
$this->assertTrue($object->whatever(new ClassMetadata('MyEntity')));
public function whatever(ClassMetadata $cm) : bool
$cm
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
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.
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.