/** * Execute the console command. * * @return mixed */ public function handle(InheritanceFinderInterface $inheritanceFinder) { $includeCommand = new ClassSelector($inheritanceFinder); $laravelConsoleInteraction = new LaravelConsoleInteraction(); $laravelConsoleInteraction->setCommand($this); $includeCommand->setOutput($laravelConsoleInteraction); $includeCommand->includeCommand(base_path()); }
/** * @param $applicationRoot */ public function generate($applicationRoot) { $classes = $this->classSelector->getClasses($applicationRoot); $factory = new BuilderFactory(); foreach ($classes['included'] as $class) { try { $class = $this->inheritanceFinder->findClass($class); /* @var $object \Synga\PhpStormMeta\PhpStormMetaExtensionInterface */ $object = $this->resolver->resolve($class->getFullQualifiedNamespace()); $object->execute($factory); $this->output->info('Class' . $class->getFullQualifiedNamespace() . ' added to .phpstorm.meta.php'); } catch (\Exception $e) { $this->output->warn('Class ' . $class->getFullQualifiedNamespace() . ' could not be initiated.'); } } $builder = $factory->getAndRemoveBuilder(); file_put_contents($applicationRoot . '/.phpstorm.meta.php', $builder->build()); $this->output->info('.phpstorm.meta.php file written in application root.'); }