/** * Get data and pass to command handler. * * @return mixed */ public function handle() { $name = $this->argument('name'); $filler_path = getcwd() . '/app/Petrol/Fillers/'; $file = $this->option('file'); $root_namespace = $this->getAppNamespace(); $namespace = $root_namespace . 'Petrol'; $petrol_path = getcwd() . '/vendor/zachleigh/petrol/'; $data = new NewData($name, $filler_path, $file, $namespace, $petrol_path); $handler = new NewHandler(new ArgvInput(), new ConsoleOutput(), $this->filesystem); $handler->handle($data); }
/** * Get data and pass to command handler. * * @param InputInterface $input * @param OutputInterface $output */ public function execute(InputInterface $input, OutputInterface $output) { $name = $input->getArgument('name'); $path = $input->getOption('path'); $filler_path = $this->findFillerDirectory($path); $file = $input->getOption('file'); $namespace = 'Petrol'; $petrol_path = $this->findPetrolPath(); $data = new NewData($name, $filler_path, $file, $namespace, $petrol_path); $handler = new NewHandler($input, $output, $this->filesystem); $handler->handle($data); }