| Total Complexity | 4 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 8 | class EntityUpserterCreator extends AbstractCreator |
||
| 9 | { |
||
| 10 | public const FIND_NAME = 'TemplateEntityUpserter'; |
||
| 11 | |||
| 12 | public const TEMPLATE_PATH = self::ROOT_TEMPLATE_PATH . '/src/Entity/Savers/' . self::FIND_NAME . '.php'; |
||
| 13 | /** |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | private $entityFqn; |
||
| 17 | |||
| 18 | 8 | public function configurePipeline(): void |
|
| 19 | { |
||
| 20 | 8 | parent::configurePipeline(); |
|
| 21 | 8 | $this->registerReplaceEntitiesNamespaceProcess(); |
|
| 22 | 8 | $this->registerEntityReplaceName($this->getEntityFqn()); |
|
| 23 | 8 | } |
|
| 24 | |||
| 25 | 8 | protected function registerReplaceEntitiesNamespaceProcess(): void |
|
| 26 | { |
||
| 27 | 8 | $process = new ReplaceEntitiesSubNamespaceProcess(); |
|
| 28 | 8 | $process->setProjectRootNamespace($this->projectRootNamespace); |
|
|
|
|||
| 29 | 8 | $process->setEntityFqn($this->getEntityFqn()); |
|
| 30 | 8 | $this->pipeline->register($process); |
|
| 31 | 8 | } |
|
| 32 | |||
| 33 | 8 | private function getEntityFqn(): string |
|
| 34 | { |
||
| 35 | 8 | return $this->entityFqn ?? $this->namespaceHelper->getEntityFqnFromEntityUpserterFqn($this->newObjectFqn); |
|
| 36 | } |
||
| 37 | |||
| 38 | 4 | public function setNewObjectFqnFromEntityFqn(string $entityFqn): self |
|
| 44 | } |
||
| 45 | } |
||
| 46 |