Skip to content

Commit 0822c02

Browse files
Revert "Refactor."
This reverts commit 04c983b.
1 parent 04c983b commit 0822c02

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

PHP/CodeCoverage/Report/HTML.php

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function __construct($title = '', $charset = 'UTF-8', $yui = TRUE, $highl
129129
*/
130130
public function process(PHP_CodeCoverage $coverage, $target)
131131
{
132-
$target = $this->getDirectory($target);
132+
$target = PHP_CodeCoverage_Util::getDirectory($target);
133133
$report = $coverage->getReport();
134134
unset($coverage);
135135

@@ -213,31 +213,4 @@ protected function copyFiles($target)
213213
copy($this->templatePath . $file, $target . $file);
214214
}
215215
}
216-
217-
/**
218-
* @param string $directory
219-
* @return string
220-
* @throws PHP_CodeCoverage_Exception
221-
*/
222-
protected function getDirectory($directory)
223-
{
224-
if (substr($directory, -1, 1) != DIRECTORY_SEPARATOR) {
225-
$directory .= DIRECTORY_SEPARATOR;
226-
}
227-
228-
if (is_dir($directory)) {
229-
return $directory;
230-
}
231-
232-
if (mkdir($directory, 0777, TRUE)) {
233-
return $directory;
234-
}
235-
236-
throw new PHP_CodeCoverage_Exception(
237-
sprintf(
238-
'Directory "%s" does not exist.',
239-
$directory
240-
)
241-
);
242-
}
243216
}

PHP/CodeCoverage/Util.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,33 @@ public static function crap($ccn, $coverage)
115115
);
116116
}
117117

118+
/**
119+
* @param string $directory
120+
* @return string
121+
* @throws PHP_CodeCoverage_Exception
122+
*/
123+
public static function getDirectory($directory)
124+
{
125+
if (substr($directory, -1, 1) != DIRECTORY_SEPARATOR) {
126+
$directory .= DIRECTORY_SEPARATOR;
127+
}
128+
129+
if (is_dir($directory)) {
130+
return $directory;
131+
}
132+
133+
if (mkdir($directory, 0777, TRUE)) {
134+
return $directory;
135+
}
136+
137+
throw new PHP_CodeCoverage_Exception(
138+
sprintf(
139+
'Directory "%s" does not exist.',
140+
$directory
141+
)
142+
);
143+
}
144+
118145
/**
119146
* Returns the files and lines a test method wants to cover.
120147
*

0 commit comments

Comments
 (0)