src/Expose/Console/Command/FilterCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $col = new \Expose\FilterCollection();
        $col->load();
        $filters = $col->getFilterData();

        $id = $input->getOption('id');
        if ($id !== false) {
            $idList = explode(',', $id);
            foreach ($idList as $id) {
                if (array_key_exists($id, $filters)) {
                    $detail = "[".$id."] ".$filters[$id]->getDescription()."\n";
                    $detail .= "\tRule: ".$filters[$id]->getRule()."\n";
                    $detail .= "\tTags: ".implode(', ', $filters[$id]->getTags())."\n";
                    $detail .= "\tImpact: ".$filters[$id]->getImpact()."\n";

                    $output->writeLn($detail);
                } else {
                    $output->writeLn('Filter ID '.$id.' not found!');
                }
            }
            return;
        }

        foreach ($filters as $filter) {
            echo $filter->getId().': '. $filter->getDescription()."\n";
        }
        return;
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $col = new \Expose\FilterCollection();
        $col->load();
        $filters = $col->getFilterData();

        $id = $input->getOption('id');
        if ($id !== false) {
            $idList = explode(',', $id);
            foreach ($idList as $id) {
                if (array_key_exists($id, $filters)) {
                    $detail = "[".$id."] ".$filters[$id]->getDescription()."\n";
                    $detail .= "\tRule: ".$filters[$id]->getRule()."\n";
                    $detail .= "\tTags: ".implode(', ', $filters[$id]->getTags())."\n";
                    $detail .= "\tImpact: ".$filters[$id]->getImpact()."\n";

                    $output->writeLn($detail);
                } else {
                    $output->writeLn('Filter ID '.$id.' not found!');
                }
            }
            return;
        }

        foreach ($filters as $filter) {
            echo $filter->getId().': '. $filter->getDescription()."\n";
        }
        return;
    }
protected function execute ( InputInterface $ input , OutputInterface $ output ) { $ col = new \ Expose \ FilterCollection ( ) ; $ col -> load ( ) ; $ filters = $ col -> getFilterData ( ) ; $ id = $ input -> getOption ( 'id' ) ; if ( $ id !== false ) { $ idList = explode ( ',' , $ id ) ; foreach ( $ idList as $ id ) { if ( array_key_exists ( $ id , $ filters ) ) { $ detail = "[" . $ id . "] " . $ filters [ $ id ] -> getDescription ( ) . "\n" ; $ detail .= "\tRule: " . $ filters [ $ id ] -> getRule ( ) . "\n" ; $ detail .= "\tTags: " . implode ( ', ' , $ filters [ $ id ] -> getTags ( ) ) . "\n" ; $ detail .= "\tImpact: " . $ filters [ $ id ] -> getImpact ( ) . "\n" ; $ output -> writeLn ( $ detail ) ; } else { $ output -> writeLn ( 'Filter ID ' . $ id . ' not found!' ) ; } } return ; } foreach ( $ filters as $ filter ) { echo $ filter -> getId ( ) . ': ' . $ filter -> getDescription ( ) . "\n" ; } return ; }
Execute the filter command

@param  InputInterface  $input  Input object
@param  OutputInterface $output Output object
@return null
Execute the filter command