Skip to content
Browse files

- Pass code coverage data array by reference.

  • Loading branch information...
1 parent 3c466a3 commit 72dd09eb5a92394ef3be36be264479b12a6b9bd5 @sebastianbergmann committed Mar 4, 2007
Showing with 9 additions and 9 deletions.
  1. +9 −9 PHPUnit/Util/CodeCoverage.php
View
18 PHPUnit/Util/CodeCoverage.php
@@ -68,16 +68,16 @@
/**
* Returns the names of the covered files.
*
- * @param array $codeCoverageInformation
+ * @param array $data
* @return array
* @access public
* @static
*/
- public static function getCoveredFiles(array $codeCoverageInformation)
+ public static function getCoveredFiles(array &$data)
{
$files = array();
- foreach ($codeCoverageInformation as $test) {
+ foreach ($data as $test) {
$_files = array_keys($test['files']);
foreach ($_files as $file) {
@@ -93,18 +93,18 @@ public static function getCoveredFiles(array $codeCoverageInformation)
/**
* Returns the tests that cover a given line.
*
- * @param array $codeCoverageInformation
+ * @param array $data
* @param string $file
* @param string $line
* @param boolean $clear
* @return array
* @access public
* @static
*/
- public static function getCoveringTests(array $codeCoverageInformation, $file, $line, $clear = FALSE)
+ public static function getCoveringTests(array &$data, $file, $line, $clear = FALSE)
{
if (empty(self::$lineToTestMap) || $clear) {
- foreach ($codeCoverageInformation as $test) {
+ foreach ($data as $test) {
foreach ($test['files'] as $_file => $lines) {
foreach ($lines as $_line => $flag) {
if ($flag > 0) {
@@ -139,16 +139,16 @@ public static function getCoveringTests(array $codeCoverageInformation, $file, $
* )
* </code>
*
- * @param array $codeCoverageInformation
+ * @param array $data
* @return array
* @access public
* @static
*/
- public static function getSummary(array $codeCoverageInformation)
+ public static function getSummary(array &$data)
{
$summary = array();
- foreach ($codeCoverageInformation as $test) {
+ foreach ($data as $test) {
foreach ($test['files'] as $file => $lines) {
if (!self::isFile($file)) {
continue;

0 comments on commit 72dd09e

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