Skip to content

Commit

Permalink
Don't write warnings to reports and don't print report if written to …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
vrana committed Apr 25, 2012
1 parent ec146ed commit bce6a9d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions PHP/CompatInfo/Report.php
Expand Up @@ -77,6 +77,15 @@ public function __construct($source, $options, $warnings)


$this->generate($report, $base, $options['verbose']); $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) { if (count($allWarnings) > 0 && $options['verbose'] > 0) {
echo 'Warning messages : (' . count($allWarnings) . ')' . PHP_EOL; echo 'Warning messages : (' . count($allWarnings) . ')' . PHP_EOL;
echo PHP_EOL; echo PHP_EOL;
Expand All @@ -88,16 +97,6 @@ public function __construct($source, $options, $warnings)
echo ' ' . $warn . PHP_EOL; echo ' ' . $warn . PHP_EOL;
} }
} }

if (isset($options['reportFile'])) {
$generatedReport = ob_get_contents();
ob_end_flush();

file_put_contents(
$options['reportFile'], $generatedReport,
$options['reportFileFlags']
);
}
} }


/** /**
Expand Down

1 comment on commit bce6a9d

@llaville
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for contribution

Please sign in to comment.