src/Psecio/Iniscan/Command/ListCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $format = $input->getOption('format');
        $scan = new \Psecio\Iniscan\Scan();
        $rules = $scan->getRules();
        $options = array();

        $format = ($format === null) ? 'console' : $format;
        $formatClass = "\\Psecio\\Iniscan\\Command\\ListCommand\\Output\\".ucwords(strtolower($format));
        if (!class_exists($formatClass)) {
            throw new \Psecio\Iniscan\Exceptions\FormatNotFoundException('Output format "'.$format.'" not found');
        }
        $outputHandler = new $formatClass($output, $options);
        return $outputHandler->render($rules);
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $format = $input->getOption('format');
        $scan = new \Psecio\Iniscan\Scan();
        $rules = $scan->getRules();
        $options = array();

        $format = ($format === null) ? 'console' : $format;
        $formatClass = "\\Psecio\\Iniscan\\Command\\ListCommand\\Output\\".ucwords(strtolower($format));
        if (!class_exists($formatClass)) {
            throw new \Psecio\Iniscan\Exceptions\FormatNotFoundException('Output format "'.$format.'" not found');
        }
        $outputHandler = new $formatClass($output, $options);
        return $outputHandler->render($rules);
    }
protected function execute ( InputInterface $ input , OutputInterface $ output ) { $ format = $ input -> getOption ( 'format' ) ; $ scan = new \ Psecio \ Iniscan \ Scan ( ) ; $ rules = $ scan -> getRules ( ) ; $ options = array ( ) ; $ format = ( $ format === null ) ? 'console' : $ format ; $ formatClass = "\\Psecio\\Iniscan\\Command\\ListCommand\\Output\\" . ucwords ( strtolower ( $ format ) ) ; if ( ! class_exists ( $ formatClass ) ) { throw new \ Psecio \ Iniscan \ Exceptions \ FormatNotFoundException ( 'Output format "' . $ format . '" not found' ) ; } $ outputHandler = new $ formatClass ( $ output , $ options ) ; return $ outputHandler -> render ( $ rules ) ; }
Execute the "list" command

@param  InputInterface $input Input object
@param  OutputInterface $output Output object
@throws \Psecio\Iniscan\Exceptions\FormatNotFoundException
@return null
Execute the list command