@@ -63,46 +63,54 @@ class PHP_CodeCoverage_Report_HTML
63
63
protected $ templatePath ;
64
64
65
65
/**
66
- * @var array
66
+ * @var string
67
67
*/
68
- protected $ options ;
68
+ protected $ charset ;
69
69
70
70
/**
71
- * Constructor.
72
- *
73
- * @param array $options
71
+ * @var string
74
72
*/
75
- public function __construct (array $ options = array ())
76
- {
77
- if (!isset ($ options ['title ' ])) {
78
- $ options ['title ' ] = '' ;
79
- }
80
-
81
- if (!isset ($ options ['charset ' ])) {
82
- $ options ['charset ' ] = 'UTF-8 ' ;
83
- }
73
+ protected $ generator ;
84
74
85
- if (!isset ($ options ['yui ' ])) {
86
- $ options ['yui ' ] = TRUE ;
87
- }
75
+ /**
76
+ * @var integer
77
+ */
78
+ protected $ lowUpperBound ;
88
79
89
- if (!isset ($ options ['highlight ' ])) {
90
- $ options ['highlight ' ] = FALSE ;
91
- }
80
+ /**
81
+ * @var integer
82
+ */
83
+ protected $ highLowerBound ;
92
84
93
- if (!isset ($ options ['lowUpperBound ' ])) {
94
- $ options ['lowUpperBound ' ] = 35 ;
95
- }
85
+ /**
86
+ * @var boolean
87
+ */
88
+ protected $ highlight ;
96
89
97
- if (!isset ($ options ['highLowerBound ' ])) {
98
- $ options ['highLowerBound ' ] = 70 ;
99
- }
90
+ /**
91
+ * @var string
92
+ */
93
+ protected $ title ;
100
94
101
- if (!isset ($ options ['generator ' ])) {
102
- $ options ['generator ' ] = '' ;
103
- }
95
+ /**
96
+ * @var boolean
97
+ */
98
+ protected $ yui ;
104
99
105
- $ this ->options = $ options ;
100
+ /**
101
+ * Constructor.
102
+ *
103
+ * @param array $options
104
+ */
105
+ public function __construct ($ title = '' , $ charset = 'UTF-8 ' , $ yui = TRUE , $ highlight = FALSE , $ lowUpperBound = 35 , $ highLowerBound = 70 , $ generator = '' )
106
+ {
107
+ $ this ->charset = $ charset ;
108
+ $ this ->generator = $ generator ;
109
+ $ this ->highLowerBound = $ highLowerBound ;
110
+ $ this ->highlight = $ highlight ;
111
+ $ this ->lowUpperBound = $ lowUpperBound ;
112
+ $ this ->title = $ title ;
113
+ $ this ->yui = $ yui ;
106
114
107
115
$ this ->templatePath = sprintf (
108
116
'%s%sHTML%sTemplate%s ' ,
@@ -125,31 +133,29 @@ public function process(PHP_CodeCoverage $coverage, $target)
125
133
unset($ coverage );
126
134
127
135
$ dashboard = new PHP_CodeCoverage_Report_HTML_Dashboard (
128
- $ this ->templatePath ,
129
- $ this ->options ['charset ' ],
130
- $ this ->options ['generator ' ]
136
+ $ this ->templatePath , $ this ->charset , $ this ->generator
131
137
);
132
138
133
139
$ directory = new PHP_CodeCoverage_Report_HTML_Directory (
134
140
$ this ->templatePath ,
135
- $ this ->options [ ' charset ' ] ,
136
- $ this ->options [ ' generator ' ] ,
137
- $ this ->options [ ' lowUpperBound ' ] ,
138
- $ this ->options [ ' highLowerBound ' ]
141
+ $ this ->charset ,
142
+ $ this ->generator ,
143
+ $ this ->lowUpperBound ,
144
+ $ this ->highLowerBound
139
145
);
140
146
141
147
$ file = new PHP_CodeCoverage_Report_HTML_File (
142
148
$ this ->templatePath ,
143
- $ this ->options [ ' charset ' ] ,
144
- $ this ->options [ ' generator ' ] ,
145
- $ this ->options [ ' lowUpperBound ' ] ,
146
- $ this ->options [ ' highLowerBound ' ] ,
147
- $ this ->options [ ' highlight ' ] ,
148
- $ this ->options [ ' yui ' ]
149
+ $ this ->charset ,
150
+ $ this ->generator ,
151
+ $ this ->lowUpperBound ,
152
+ $ this ->highLowerBound ,
153
+ $ this ->highlight ,
154
+ $ this ->yui
149
155
);
150
156
151
157
$ dashboard ->render (
152
- $ report , $ target . 'index.dashboard.html ' , $ this ->options [ ' title ' ]
158
+ $ report , $ target . 'index.dashboard.html ' , $ this ->title
153
159
);
154
160
155
161
foreach ($ report as $ node ) {
0 commit comments