@@ -47,21 +47,15 @@ final class CodeCoverage
47
47
48
48
private Filter $ filter ;
49
49
50
- /**
51
- * @var Wizard
52
- */
53
- private $ wizard ;
50
+ private Wizard $ wizard ;
54
51
55
52
private bool $ checkForUnintentionallyCoveredCode = false ;
56
53
57
54
private bool $ includeUncoveredFiles = true ;
58
55
59
56
private bool $ ignoreDeprecatedCode = false ;
60
57
61
- /**
62
- * @var PhptTestCase|string|TestCase
63
- */
64
- private $ currentId ;
58
+ private PhptTestCase |string |TestCase |null $ currentId ;
65
59
66
60
private ProcessedCodeCoverageData $ data ;
67
61
@@ -150,12 +144,7 @@ public function setTests(array $tests): void
150
144
$ this ->tests = $ tests ;
151
145
}
152
146
153
- /**
154
- * Start collection of code coverage information.
155
- *
156
- * @param PhptTestCase|string|TestCase $id
157
- */
158
- public function start ($ id , bool $ clear = false ): void
147
+ public function start (PhptTestCase |string |TestCase $ id , bool $ clear = false ): void
159
148
{
160
149
if ($ clear ) {
161
150
$ this ->clear ();
@@ -166,12 +155,7 @@ public function start($id, bool $clear = false): void
166
155
$ this ->driver ->start ();
167
156
}
168
157
169
- /**
170
- * Stop collection of code coverage information.
171
- *
172
- * @param array|false $linesToBeCovered
173
- */
174
- public function stop (bool $ append = true , $ linesToBeCovered = [], array $ linesToBeUsed = []): RawCodeCoverageData
158
+ public function stop (bool $ append = true , array |false $ linesToBeCovered = [], array $ linesToBeUsed = []): RawCodeCoverageData
175
159
{
176
160
if (!is_array ($ linesToBeCovered ) && $ linesToBeCovered !== false ) {
177
161
throw new InvalidArgumentException (
@@ -188,16 +172,11 @@ public function stop(bool $append = true, $linesToBeCovered = [], array $linesTo
188
172
}
189
173
190
174
/**
191
- * Appends code coverage data.
192
- *
193
- * @param PhptTestCase|string|TestCase $id
194
- * @param array|false $linesToBeCovered
195
- *
196
175
* @throws ReflectionException
197
176
* @throws TestIdMissingException
198
177
* @throws UnintentionallyCoveredCodeException
199
178
*/
200
- public function append (RawCodeCoverageData $ rawData , $ id = null , bool $ append = true , $ linesToBeCovered = [], array $ linesToBeUsed = []): void
179
+ public function append (RawCodeCoverageData $ rawData , PhptTestCase | string | TestCase | null $ id = null , bool $ append = true , array | false $ linesToBeCovered = [], array $ linesToBeUsed = []): void
201
180
{
202
181
if ($ id === null ) {
203
182
$ id = $ this ->currentId ;
@@ -367,14 +346,10 @@ public function detectsDeadCode(): bool
367
346
}
368
347
369
348
/**
370
- * Applies the @covers annotation filtering.
371
- *
372
- * @param array|false $linesToBeCovered
373
- *
374
349
* @throws ReflectionException
375
350
* @throws UnintentionallyCoveredCodeException
376
351
*/
377
- private function applyCoversAnnotationFilter (RawCodeCoverageData $ rawData , $ linesToBeCovered , array $ linesToBeUsed ): void
352
+ private function applyCoversAnnotationFilter (RawCodeCoverageData $ rawData , array | false $ linesToBeCovered , array $ linesToBeUsed ): void
378
353
{
379
354
if ($ linesToBeCovered === false ) {
380
355
$ rawData ->clear ();
0 commit comments