Skip to content

Commit b002ae7

Browse files
committed
use attributes or annotations. not both
1 parent 2d8c998 commit b002ae7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Util/ClassSourceManipulator.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,16 @@ public function addProperty(string $name, array $annotationLines = [], $defaultV
345345

346346
$newPropertyBuilder = (new Builder\Property($name))->makePrivate();
347347

348-
if ($annotationLines && $this->useAnnotations) {
349-
$newPropertyBuilder->setDocComment($this->createDocBlock($annotationLines));
350-
}
348+
// if ($annotationLines && $this->useAnnotations) {
349+
// $newPropertyBuilder->setDocComment($this->createDocBlock($annotationLines));
350+
// }
351351

352-
foreach ($attributes as $attribute) {
353-
$newPropertyBuilder->addAttribute($attribute);
352+
if ($this->useAttributesForDoctrineMapping) {
353+
foreach ($attributes as $attribute) {
354+
$newPropertyBuilder->addAttribute($attribute);
355+
}
356+
} elseif($annotationLines && $this->useAnnotations) {
357+
$newPropertyBuilder->setDocComment($this->createDocBlock($annotationLines));
354358
}
355359

356360
if (null !== $defaultValue) {

0 commit comments

Comments
 (0)