Skip to content

Commit b70e8be

Browse files
committed
WIP - fix isVerified attribute
1 parent 387c24d commit b70e8be

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/Maker/MakeRegistrationForm.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,16 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
387387
);
388388
$userManipulator->setIo($io);
389389

390-
$userManipulator->addProperty('isVerified', ['@ORM\Column(type="boolean")'], false);
390+
$annotation = [];
391+
$attrNode = [];
392+
393+
if ($userManipulator->useAnnotations) {
394+
$attrNode = [$userManipulator->buildAttributeNode('ORM\Column', ['type' => 'boolean'])];
395+
} else {
396+
$annotation = ['@ORM\Column(type="boolean")'];
397+
}
398+
399+
$userManipulator->addProperty('isVerified', $annotation, false, $attrNode);
391400
$userManipulator->addAccessorMethod('isVerified', 'isVerified', 'bool', false);
392401
$userManipulator->addSetter('isVerified', 'bool', false);
393402

src/Util/ClassSourceManipulator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class ClassSourceManipulator
4040
private const CONTEXT_CLASS_METHOD = 'class_method';
4141

4242
private $overwrite;
43-
private $useAnnotations;
43+
public $useAnnotations;
4444
private $fluentMutators;
4545
private $useAttributesForDoctrineMapping;
4646
private $parser;
@@ -1427,7 +1427,7 @@ private function buildNodeExprByValue($value): Node\Expr
14271427
* @param string $attributeClass the attribute class which should be used for the attribute
14281428
* @param array $options the named arguments for the attribute ($key = argument name, $value = argument value)
14291429
*/
1430-
private function buildAttributeNode(string $attributeClass, array $options): Node\Attribute
1430+
public function buildAttributeNode(string $attributeClass, array $options): Node\Attribute
14311431
{
14321432
$options = $this->sortOptionsByClassConstructorParameters($options, $attributeClass);
14331433

0 commit comments

Comments
 (0)