mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-05 02:40:50 +00:00
53742c371b
70fa502a59
[CodeQuality] Skip private static call from static:: on LocallyCalledStaticMethodToNonStaticRector (#5620)
27 lines
937 B
PHP
27 lines
937 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Doctrine\CodeQuality\AttributeTransformer\ClassAttributeTransformer;
|
|
|
|
use PhpParser\Node\Stmt\Class_;
|
|
use Rector\Doctrine\CodeQuality\Contract\ClassAttributeTransformerInterface;
|
|
use Rector\Doctrine\CodeQuality\NodeFactory\AttributeFactory;
|
|
use Rector\Doctrine\CodeQuality\ValueObject\EntityMapping;
|
|
use Rector\Doctrine\Enum\MappingClass;
|
|
final class EmbeddableClassAttributeTransformer implements ClassAttributeTransformerInterface
|
|
{
|
|
public function transform(EntityMapping $entityMapping, Class_ $class) : void
|
|
{
|
|
$classMapping = $entityMapping->getClassMapping();
|
|
$type = $classMapping['type'] ?? null;
|
|
if ($type !== 'embeddable') {
|
|
return;
|
|
}
|
|
$class->attrGroups[] = AttributeFactory::createGroup($this->getClassName());
|
|
}
|
|
public function getClassName() : string
|
|
{
|
|
return MappingClass::EMBEDDABLE;
|
|
}
|
|
}
|