/** * @param InputInterface $input * @param OutputInterface $output * @return void */ protected function execute(InputInterface $input, OutputInterface $output) { $dependencyResolver = new DependencyResolver(); $dependencyResolver->registerDynamicType(Memcache::class)->registerNamedValue('connections'); $umlGenerator = new UmlGenerator($dependencyResolver); if (!file_exists('uml')) { mkdir('uml', 0755); } $controllerName = $input->getArgument('controllerName'); if (!class_exists($controllerName)) { echo $className . 'クラスが存在しません。'; exit(1); } foreach ($umlGenerator->generate($controllerName) as $umlTemplate) { file_put_contents('uml/' . $umlTemplate->getFileName() . '.dot', $umlTemplate->getTemplate()); } }
public function testGenerator() { $umlGenerator = new UmlGenerator(new UmlTemplate()); $umlGenerator->generate(['UmlGenerator\\TestController']); }