public function testFieldsDefault() { $optionReader = new OptionReader([]); $this->assertFalse($optionReader->isGenerationForced()); $this->assertEquals($optionReader->getArchitecture(), GeneratorDelegateFactory::ARCH_HEXAGONAL); $this->assertEquals($optionReader->getFields(), []); }
/** * Primary method to make a generator delegate, finds * the architecture required and calls a subsequent * method to handle the details. * * @param GenerateCommand $cmd cli command that was run * @param array $args cmmand arguments * @param \Console\OptionReader $optionReader command options * @return Delegates\GeneratorDelegate */ public function make(GenerateCommand $cmd, array $args, OptionReader $optionReader) { $architecture = $optionReader->getArchitecture(); switch ($architecture) { case static::ARCH_HEXAGONAL: $delegate = $this->makeHexagonalGeneratorDelegate($cmd, $args, $optionReader); break; default: throw new \InvalidArgumentException("[{$architecture}] is not a valid architecture option"); break; } //end switch return $delegate; }