@@ -373,7 +373,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
373373 if ($ this ->addUniqueEntityConstraint ) {
374374 $ classDetails = new ClassDetails ($ this ->userClass );
375375 $ userManipulator = new ClassSourceManipulator (
376- file_get_contents ($ classDetails ->getPath ())
376+ sourceCode: file_get_contents ($ classDetails ->getPath ())
377377 );
378378 $ userManipulator ->setIo ($ io );
379379
@@ -382,34 +382,24 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
382382 UniqueEntity::class,
383383 ['fields ' => [$ usernameField ], 'message ' => sprintf ('There is already an account with this %s ' , $ usernameField )]
384384 );
385- } else {
386- $ userManipulator ->addAnnotationToClass (
387- UniqueEntity::class,
388- [
389- 'fields ' => [$ usernameField ],
390- 'message ' => sprintf ('There is already an account with this %s ' , $ usernameField ),
391- ]
392- );
393385 }
386+
394387 $ this ->fileManager ->dumpFile ($ classDetails ->getPath (), $ userManipulator ->getSourceCode ());
395388 }
396389
397390 if ($ this ->willVerifyEmail ) {
398391 $ classDetails = new ClassDetails ($ this ->userClass );
399392 $ userManipulator = new ClassSourceManipulator (
400- file_get_contents ($ classDetails ->getPath ()),
401- false ,
402- false ,
403- true ,
404- true
393+ sourceCode: file_get_contents ($ classDetails ->getPath ()),
394+ overwrite: false ,
395+ useAttributesForDoctrineMapping: true
405396 );
406397 $ userManipulator ->setIo ($ io );
407398
408399 $ userManipulator ->addProperty (
409- 'isVerified ' ,
410- ['@ORM\Column(type="boolean") ' ],
411- false ,
412- [$ userManipulator ->buildAttributeNode (Column::class, ['type ' => 'boolean ' ], 'ORM ' )]
400+ name: 'isVerified ' ,
401+ defaultValue: false ,
402+ attributes: [$ userManipulator ->buildAttributeNode (Column::class, ['type ' => 'boolean ' ], 'ORM ' )]
413403 );
414404 $ userManipulator ->addAccessorMethod ('isVerified ' , 'isVerified ' , 'bool ' , false );
415405 $ userManipulator ->addSetter ('isVerified ' , 'bool ' , false );
0 commit comments