Skip to content

Commit dfc5a99

Browse files
committed
WIP - only support entities with attributes
1 parent dbf3c69 commit dfc5a99

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/Maker/MakeEntity.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
173173
'Entity\\'
174174
);
175175

176-
if (!$this->doctrineHelper->isDoctrineSupportingAttributes() && $this->doctrineHelper->doesClassUsesAttributes($entityClassDetails->getFullName())) {
177-
throw new RuntimeCommandException('To use Doctrine entity attributes you\'ll need PHP 8, doctrine/orm 2.9, doctrine/doctrine-bundle 2.4 and symfony/framework-bundle 5.2.');
176+
if (!$this->doctrineHelper->isDoctrineSupportingAttributes() && !$this->doctrineHelper->doesClassUsesAttributes($entityClassDetails->getFullName())) {
177+
throw new RuntimeCommandException('MakerBundle only support entities using attributes. To use Doctrine entity attributes you\'ll need doctrine/doctrine-bundle 2.4.');
178178
}
179179

180180
$classExists = class_exists($entityClassDetails->getFullName());
@@ -203,11 +203,8 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
203203
$generator->writeChanges();
204204
}
205205

206-
if (
207-
!$this->doesEntityUseAnnotationMapping($entityClassDetails->getFullName())
208-
&& !$this->doesEntityUseAttributeMapping($entityClassDetails->getFullName())
209-
) {
210-
throw new RuntimeCommandException(sprintf('Only annotation or attribute mapping is supported by make:entity, but the <info>%s</info> class uses a different format. If you would like this command to generate the properties & getter/setter methods, add your mapping configuration, and then re-run this command with the <info>--regenerate</info> flag.', $entityClassDetails->getFullName()));
206+
if (!$this->doesEntityUseAttributeMapping($entityClassDetails->getFullName())) {
207+
throw new RuntimeCommandException(sprintf('Only attribute mapping is supported by make:entity, but the <info>%s</info> class uses a different format. If you would like this command to generate the properties & getter/setter methods, add your mapping configuration, and then re-run this command with the <info>--regenerate</info> flag.', $entityClassDetails->getFullName()));
211208
}
212209

213210
if ($classExists) {

0 commit comments

Comments
 (0)