private function getMethods($className, &$rows)
 {
     foreach ($this->metrics['methods'] as $method => $versions) {
         if (strpos($method, "{$className}::") === 0) {
             $rows[] = array(' ', sprintf('<info>function</info> %s', str_replace("{$className}::", '', $method)), $versions['matches'] > 0 ? $versions['matches'] : '', isset($versions['ext.name']) ? $versions['ext.name'] : '', Version::ext($versions), Version::php($versions), Version::all($versions));
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Show information about a reference.
  *
  * @param OutputInterface $output   Console Output concrete instance
  * @param array           $response Reference informations
  *
  * @return void
  */
 public function show(OutputInterface $output, $response)
 {
     if (array_key_exists('summary', $response)) {
         $summary = $response['summary'];
         $output->writeln(sprintf('%s<info>Reference Summary</info>', PHP_EOL));
         $summary['releases'] = array('  Releases                                  %10d', array($summary['releases']));
         $summary['iniEntries'] = array('  INI entries                               %10d', array($summary['iniEntries']));
         $summary['constants'] = array('  Constants                                 %10d', array($summary['constants']));
         $summary['functions'] = array('  Functions                                 %10d', array($summary['functions']));
         $summary['interfaces'] = array('  Interfaces                                %10d', array($summary['interfaces']));
         $summary['classes'] = array('  Classes                                   %10d', array($summary['classes']));
         $summary['methods'] = array('  Methods                                   %10d', array($summary['methods']));
         $summary['static methods'] = array('  Static Methods                            %10d', array($summary['static methods']));
         $this->printFormattedLines($output, $summary);
         return;
     }
     foreach ($response as $title => $values) {
         $args = array();
         foreach ($values as $key => $val) {
             if (strcasecmp($title, 'releases') == 0) {
                 $key = sprintf('%s (%s)', $val['date'], $val['state']);
             } elseif (strcasecmp($title, 'methods') == 0 || strcasecmp($title, 'static methods') == 0) {
                 foreach ($val as $meth => $v) {
                     $k = sprintf('%s::%s', $key, $meth);
                     $args[$k] = $v;
                 }
                 continue;
             }
             $args[$key] = $val;
         }
         $rows = array();
         ksort($args);
         foreach ($args as $arg => $versions) {
             $row = array($arg, Version::ext($versions), Version::php($versions), Version::deprecated($versions));
             $rows[] = $row;
         }
         $headers = array(ucfirst($title), 'EXT min/Max', 'PHP min/Max', 'Deprecated');
         $footers = array(sprintf('<info>Total [%d]</info>', count($args)), '', '', '');
         $rows[] = new TableSeparator();
         $rows[] = $footers;
         $this->tableHelper($output, $headers, $rows);
         $output->writeln('');
     }
 }