@@ -8,21 +8,21 @@ class Reporter
8
8
{
9
9
/** @var array */
10
10
private $ config ;
11
-
11
+
12
12
/**
13
13
* @param array $config
14
14
*/
15
15
public function __construct (array $ config )
16
16
{
17
17
$ this ->config = $ config ;
18
18
}
19
-
20
-
19
+
20
+
21
21
public function generate (RouteCoverage $ result )
22
22
{
23
23
$ content = '<html><title>Route coverage report</title><link rel="stylesheet" href="css/style.css"><body> ' ;
24
- $ content .= '<h2>Covarage ' . $ result ->getCoveragePercent () . '% </h2> ' ;
25
-
24
+ $ content .= '<h2>Coverage ' . $ result ->getCoveragePercent () . '% </h2> ' ;
25
+
26
26
$ content .= '<table> ' ;
27
27
$ content .= '<thead><td>URL</td><td>Methods</td><td>Controller</td><td>Action</td><td>Count</td></thead> ' ;
28
28
$ content .= '<tbody> ' ;
@@ -34,8 +34,8 @@ public function generate(RouteCoverage $result)
34
34
} else {
35
35
$ class = 'error ' ;
36
36
}
37
-
38
-
37
+
38
+
39
39
$ content .= '<tr class=" ' . $ class . '"> ' ;
40
40
$ content .= '<td> ' . $ route ['url ' ] . ' </td> ' ;
41
41
$ content .= '<td class="methods"> ' . implode (', ' , $ route ['methods ' ]) . ' </td> ' ;
@@ -45,17 +45,17 @@ public function generate(RouteCoverage $result)
45
45
$ content .= '</tr> ' ;
46
46
}
47
47
$ content .= '</tbody></table> ' ;
48
-
48
+
49
49
$ content .= '</body></html> ' ;
50
-
50
+
51
51
if (!file_exists ($ this ->config ['app_path ' ] . '/../public/route-coverage ' )) {
52
52
mkdir ($ this ->config ['app_path ' ] . '/../public/route-coverage ' , 0755 );
53
53
}
54
54
if (!file_exists ($ this ->config ['app_path ' ] . '/../public/route-coverage/css ' )) {
55
55
mkdir ($ this ->config ['app_path ' ] . '/../public/route-coverage/css ' , 0755 );
56
56
}
57
57
copy (__DIR__ . '/../../../template/html/style.css ' , $ this ->config ['app_path ' ] . '/../public/route-coverage/css/style.css ' );
58
-
58
+
59
59
$ myFile = $ this ->config ['app_path ' ] . '/../public/route-coverage/report.html ' ;
60
60
$ fh = fopen ($ myFile , 'w ' );
61
61
fwrite ($ fh , $ content );
0 commit comments