public function afterFormat($source)
 {
     asort($this->timings, SORT_NUMERIC);
     $total = array_sum($this->timings);
     $lines = [];
     foreach ($this->timings as $pass => $timing) {
         $lines[] = [$pass, $timing, str_pad(round($timing / $total * 100, 3) . '%', 8, ' ', STR_PAD_LEFT)];
     }
     echo tabwriter($lines);
 }
Example #2
0
            $helpLines[] = ["\t- " . $className, $pass->getDescription()];
        }
    }
    echo tabwriter($helpLines);
    die;
}
if (isset($opts['list-simple'])) {
    $classes = get_declared_classes();
    $helpLines = [];
    foreach ($classes as $className) {
        if (is_subclass_of($className, 'AdditionalPass')) {
            $pass = new $className();
            $helpLines[] = [$className, $pass->getDescription()];
        }
    }
    echo tabwriter($helpLines);
    die;
}
if (isset($opts['selfupdate'])) {
    selfupdate($argv, $inPhar);
}
if (isset($opts['version'])) {
    if ($inPhar) {
        echo $argv[0], ' ', VERSION, PHP_EOL;
    }
    exit(0);
}
if (isset($opts['config'])) {
    $argv = extractFromArgv($argv, 'config');
    if ('scan' == $opts['config']) {
        $cfgfn = getcwd() . DIRECTORY_SEPARATOR . '.php.tools.ini';