Skip to content

Commit 5c93364

Browse files
Make PHP_CodeCoverage_Report_Factory non-static.
1 parent 44f1951 commit 5c93364

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

PHP/CodeCoverage.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ function_exists('php_timer_autoload')) {
172172
*/
173173
public function getReport()
174174
{
175-
return PHP_CodeCoverage_Report_Factory::create($this);
175+
$factory = new PHP_CodeCoverage_Report_Factory;
176+
177+
return $factory->create($this);
176178
}
177179

178180
/**

PHP/CodeCoverage/Report/Factory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ class PHP_CodeCoverage_Report_Factory
6060
/**
6161
* @param PHP_CodeCoverage $coverage
6262
*/
63-
public static function create(PHP_CodeCoverage $coverage)
63+
public function create(PHP_CodeCoverage $coverage)
6464
{
6565
$files = $coverage->getData();
6666
$commonPath = PHP_CodeCoverage_Util::reducePaths($files);
6767
$root = new PHP_CodeCoverage_Report_Node_Directory(
6868
$commonPath, NULL
6969
);
7070

71-
self::addItems(
71+
$this->addItems(
7272
$root,
7373
PHP_CodeCoverage_Util::buildDirectoryStructure($files),
7474
$coverage->getTests(),
@@ -84,15 +84,15 @@ public static function create(PHP_CodeCoverage $coverage)
8484
* @param array $tests
8585
* @param boolean $cacheTokens
8686
*/
87-
protected static function addItems(PHP_CodeCoverage_Report_Node_Directory $root, array $items, array $tests, $cacheTokens)
87+
protected function addItems(PHP_CodeCoverage_Report_Node_Directory $root, array $items, array $tests, $cacheTokens)
8888
{
8989
foreach ($items as $key => $value) {
9090
if (substr($key, -2) == '/f') {
9191
$key = substr($key, 0, -2);
9292
$root->addFile($key, $value, $tests, $cacheTokens);
9393
} else {
9494
$child = $root->addDirectory($key);
95-
self::addItems($child, $value, $tests, $cacheTokens);
95+
$this->addItems($child, $value, $tests, $cacheTokens);
9696
}
9797
}
9898
}

0 commit comments

Comments
 (0)