llaville/php-compat-info — pull request #41 by siwinski (2012-06-17 04:32:33+00:00)
Title: Prevent division by zero PHP warning from progressbar when nothing parsed

Example:

$ mkdir /tmp/newdir
$ phpci print /tmp/newdir/
PHP Warning: Division by zero in /usr/share/pear/ezc/ConsoleTools/progressbar.php on line 367
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpci:0
PHP 2. PHP_CompatInfo_CLI::main() /usr/bin/phpci:6
PHP 3. PHP_CompatInfo_CLI::factory() /usr/share/pear/Bartlett/PHP/CompatInfo/CLI.php:580
PHP 4. PHP_CompatInfo_Report->__construct() /usr/share/pear/Bartlett/PHP/CompatInfo/CLI.php:615
PHP 5. PHP_CompatInfo->parse() /usr/share/pear/Bartlett/PHP/CompatInfo/Report.php:59
PHP 6. ezcConsoleProgressbar->finish() /usr/share/pear/Bartlett/PHP/CompatInfo.php.orig:491
PHP 7. ezcConsoleProgressbar->output() /usr/share/pear/ezc/ConsoleTools/progressbar.php:356
PHP 8. ezcConsoleProgressbar->generateValues() /usr/share/pear/ezc/ConsoleTools/progressbar.php:323
PHP Warning: Division by zero in /usr/share/pear/ezc/ConsoleTools/progressbar.php on line 386
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpci:0
PHP 2. PHP_CompatInfo_CLI::main() /usr/bin/phpci:6
PHP 3. PHP_CompatInfo_CLI::factory() /usr/share/pear/Bartlett/PHP/CompatInfo/CLI.php:580
PHP 4. PHP_CompatInfo_Report->__construct() /usr/share/pear/Bartlett/PHP/CompatInfo/CLI.php:615
PHP 5. PHP_CompatInfo->parse() /usr/share/pear/Bartlett/PHP/CompatInfo/Report.php:59
PHP 6. ezcConsoleProgressbar->finish() /usr/share/pear/Bartlett/PHP/CompatInfo.php.orig:491
PHP 7. ezcConsoleProgressbar->output() /usr/share/pear/ezc/ConsoleTools/progressbar.php:356
PHP 8. ezcConsoleProgressbar->generateValues() /usr/share/pear/ezc/ConsoleTools/progressbar.php:323
0 / 0 [>-------------------------------------------------------------] 0.00%
PHP COMPAT INFO REPORT SUMMARY
-------------------------------------------------------------------------------
FILES EXTENSIONS INTERFACES CLASSES FUNCTIONS CONSTANTS
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
Time: 1 second, Memory: 8.50Mb
-------------------------------------------------------------------------------