Skip to content

Commit dccbd6a

Browse files
Fix --no-backup option in EntityGenerator (#196)
1 parent 958f91c commit dccbd6a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Console/GenerateEntitiesCommand.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ class GenerateEntitiesCommand extends Command
1717
{dest-path? : Path you want entities to be generated in }
1818
{--filter=* : A string pattern used to match entities that should be processed.}
1919
{--em= : Generate getter and setter for a specific entity manager. },
20-
{--generate-annotations= : Flag to define if generator should generate annotation metadata on entities.}
21-
{--generate-methods= : Flag to define if generator should generate stub methods on entities.}
22-
{--regenerate-entities= : Flag to define if generator should regenerate entity if it exists.}
23-
{--update-entities= : Flag to define if generator should only update entity if it exists.}
20+
{--generate-annotations : Flag to define if generator should generate annotation metadata on entities.}
21+
{--generate-methods : Flag to define if generator should generate stub methods on entities.}
22+
{--regenerate-entities : Flag to define if generator should regenerate entity if it exists.}
23+
{--update-entities : Flag to define if generator should only update entity if it exists.}
2424
{--extend= : Defines a base class to be extended by generated entity classes.}
25-
{--num-spaces= : Defines the number of indentation spaces.}
26-
{--no-backup= : Flag to define if generator should avoid backuping existing entity file if it exists}';
25+
{--num-spaces=4 : Defines the number of indentation spaces.}
26+
{--no-backup : Flag to define if generator should avoid backuping existing entity file if it exists}';
2727

2828
/**
2929
* The console command description.
@@ -73,9 +73,9 @@ public function fire(ManagerRegistry $registry)
7373
$entityGenerator = new EntityGenerator();
7474

7575
$entityGenerator->setGenerateAnnotations($this->option('generate-annotations'));
76-
$entityGenerator->setGenerateStubMethods($this->option('generate-methods') === null ? true : $this->option('generate-methods'));
76+
$entityGenerator->setGenerateStubMethods($this->option('generate-methods'));
7777
$entityGenerator->setRegenerateEntityIfExists($this->option('regenerate-entities'));
78-
$entityGenerator->setUpdateEntityIfExists($this->option('update-entities') === null ? true : $this->option('update-entities'));
78+
$entityGenerator->setUpdateEntityIfExists($this->option('update-entities'));
7979
$entityGenerator->setNumSpaces($this->option('num-spaces'));
8080
$entityGenerator->setBackupExisting(!$this->option('no-backup'));
8181

0 commit comments

Comments
 (0)