breakpointManager = $breakpointManager; $this->appRoot = $appRoot; parent::__construct(); } /** * {@inheritdoc} */ protected function configure() { $this ->setName('debug:breakpoints') ->setDescription($this->trans('commands.debug.breakpoints.description')) ->addArgument( 'group', InputArgument::OPTIONAL, $this->trans('commands.debug.breakpoints.options.group-name') )->setAliases(['dbre']); } /** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $group = $input->getArgument('group'); if ($group) { $breakPointData = $this->getBreakpointByName($group); foreach ($breakPointData as $key => $breakPoint) { $this->getIo()->comment($key, false); $this->getIo()->block(Yaml::dump($breakPoint)); } return 0; } $groups = array_keys($this->breakpointManager->getGroups()); $tableHeader = [ $this->trans('commands.debug.breakpoints.messages.name'), ]; $this->getIo()->table($tableHeader, $groups, 'compact'); return 0; } /** * @param $group String * @return mixed */ private function getBreakpointByName($group) { $typeExtension = implode( ',', array_values($this->breakpointManager->getGroupProviders($group)) ); $projectPath = drupal_get_path($typeExtension, $group); $extensionFile = sprintf( '%s/%s/%s.breakpoints.yml', $this->appRoot, $projectPath, $group ); return Yaml::parse( file_get_contents($extensionFile) ); } }