From dccbd6ad1aa651a59a9ffbc6c3d557d7e9662fd6 Mon Sep 17 00:00:00 2001 From: Patrick Brouwers Date: Sun, 29 Jan 2017 14:20:29 +0100 Subject: [PATCH] Fix --no-backup option in EntityGenerator (#196) --- src/Console/GenerateEntitiesCommand.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Console/GenerateEntitiesCommand.php b/src/Console/GenerateEntitiesCommand.php index 4df20ccd..6e64537e 100644 --- a/src/Console/GenerateEntitiesCommand.php +++ b/src/Console/GenerateEntitiesCommand.php @@ -17,13 +17,13 @@ class GenerateEntitiesCommand extends Command {dest-path? : Path you want entities to be generated in } {--filter=* : A string pattern used to match entities that should be processed.} {--em= : Generate getter and setter for a specific entity manager. }, - {--generate-annotations= : Flag to define if generator should generate annotation metadata on entities.} - {--generate-methods= : Flag to define if generator should generate stub methods on entities.} - {--regenerate-entities= : Flag to define if generator should regenerate entity if it exists.} - {--update-entities= : Flag to define if generator should only update entity if it exists.} + {--generate-annotations : Flag to define if generator should generate annotation metadata on entities.} + {--generate-methods : Flag to define if generator should generate stub methods on entities.} + {--regenerate-entities : Flag to define if generator should regenerate entity if it exists.} + {--update-entities : Flag to define if generator should only update entity if it exists.} {--extend= : Defines a base class to be extended by generated entity classes.} - {--num-spaces= : Defines the number of indentation spaces.} - {--no-backup= : Flag to define if generator should avoid backuping existing entity file if it exists}'; + {--num-spaces=4 : Defines the number of indentation spaces.} + {--no-backup : Flag to define if generator should avoid backuping existing entity file if it exists}'; /** * The console command description. @@ -73,9 +73,9 @@ public function fire(ManagerRegistry $registry) $entityGenerator = new EntityGenerator(); $entityGenerator->setGenerateAnnotations($this->option('generate-annotations')); - $entityGenerator->setGenerateStubMethods($this->option('generate-methods') === null ? true : $this->option('generate-methods')); + $entityGenerator->setGenerateStubMethods($this->option('generate-methods')); $entityGenerator->setRegenerateEntityIfExists($this->option('regenerate-entities')); - $entityGenerator->setUpdateEntityIfExists($this->option('update-entities') === null ? true : $this->option('update-entities')); + $entityGenerator->setUpdateEntityIfExists($this->option('update-entities')); $entityGenerator->setNumSpaces($this->option('num-spaces')); $entityGenerator->setBackupExisting(!$this->option('no-backup'));