File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -62,13 +62,12 @@ class PHP_CodeCoverage
62
62
const STORAGE_ARRAY = 0 ;
63
63
const STORAGE_SPLOBJECTSTORAGE = 1 ;
64
64
65
+ protected $ filter ;
65
66
protected $ storageType ;
66
67
67
68
protected $ currentId ;
68
69
protected $ data ;
69
70
70
- public $ filter ;
71
-
72
71
/**
73
72
* List of covered files.
74
73
*
@@ -79,13 +78,19 @@ class PHP_CodeCoverage
79
78
/**
80
79
* Constructor.
81
80
*
82
- * @param integer $storageType
81
+ * @param PHP_CodeCoverage_Filter $filter
82
+ * @param integer $storageType
83
83
*/
84
- public function __construct ($ storageType = self ::STORAGE_SPLOBJECTSTORAGE )
84
+ public function __construct (PHP_CodeCoverage_Filter $ filter = NULL , $ storageType = self ::STORAGE_SPLOBJECTSTORAGE )
85
85
{
86
+ if ($ filter === NULL ) {
87
+ $ filter = new PHP_CodeCoverage_Filter ;
88
+ }
89
+
90
+ $ this ->filter = $ filter ;
86
91
$ this ->storageType = $ storageType ;
92
+
87
93
$ this ->clear ();
88
- $ this ->filter = new PHP_CodeCoverage_Filter ;
89
94
}
90
95
91
96
/**
@@ -247,6 +252,16 @@ public function getDeadLines(array $data)
247
252
return $ this ->getLinesByStatus ($ data , -2 );
248
253
}
249
254
255
+ /**
256
+ * Returns the PHP_CodeCoverage_Filter used.
257
+ *
258
+ * @return PHP_CodeCoverage_Filter
259
+ */
260
+ public function filter ()
261
+ {
262
+ return $ this ->filter ;
263
+ }
264
+
250
265
/**
251
266
* Filters lines by status.
252
267
*
You can’t perform that action at this time.
0 commit comments