Skip to content
Browse files

Don't write warnings to reports and don't print report if written to …

…file
  • Loading branch information...
1 parent ec146ed commit bce6a9d344e895d12aff9f3e98f72ec705dc6ece @vrana committed Apr 25, 2012
Showing with 9 additions and 10 deletions.
  1. +9 −10 PHP/CompatInfo/Report.php
View
19 PHP/CompatInfo/Report.php
@@ -77,6 +77,15 @@ public function __construct($source, $options, $warnings)
$this->generate($report, $base, $options['verbose']);
+ if (isset($options['reportFile'])) {
+ $generatedReport = ob_get_clean();
+
+ file_put_contents(
+ $options['reportFile'], $generatedReport,
+ $options['reportFileFlags']
+ );
+ }
+
if (count($allWarnings) > 0 && $options['verbose'] > 0) {
echo 'Warning messages : (' . count($allWarnings) . ')' . PHP_EOL;
echo PHP_EOL;
@@ -88,16 +97,6 @@ public function __construct($source, $options, $warnings)
echo ' ' . $warn . PHP_EOL;
}
}
-
- if (isset($options['reportFile'])) {
- $generatedReport = ob_get_contents();
- ob_end_flush();
-
- file_put_contents(
- $options['reportFile'], $generatedReport,
- $options['reportFileFlags']
- );
- }
}
/**

1 comment on commit bce6a9d

@llaville

thanks for contribution

Please sign in to comment.
Something went wrong with that request. Please try again.