Skip to content

Commit 60fefb8

Browse files
Fixed bug while determining --clean-up-clover-xml
1 parent 06e52ad commit 60fefb8

File tree

3 files changed

+309
-3
lines changed

3 files changed

+309
-3
lines changed

clover.xml

Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,306 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<coverage generated="1682956204">
3+
<project timestamp="1682956204">
4+
<file name="/var/www/src/ConsoleOutput.php">
5+
<class name="RobinIngelbrecht\PHPUnitCoverageTools\ConsoleOutput" namespace="global">
6+
<metrics complexity="3" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="52" coveredstatements="52" elements="54" coveredelements="54"/>
7+
</class>
8+
<line num="17" type="method" name="__construct" visibility="public" complexity="1" crap="1" count="10"/>
9+
<line num="20" type="stmt" count="10"/>
10+
<line num="21" type="stmt" count="10"/>
11+
<line num="22" type="stmt" count="10"/>
12+
<line num="23" type="stmt" count="10"/>
13+
<line num="24" type="stmt" count="10"/>
14+
<line num="25" type="stmt" count="10"/>
15+
<line num="26" type="stmt" count="10"/>
16+
<line num="27" type="stmt" count="10"/>
17+
<line num="28" type="stmt" count="10"/>
18+
<line num="29" type="stmt" count="10"/>
19+
<line num="30" type="stmt" count="10"/>
20+
<line num="31" type="stmt" count="10"/>
21+
<line num="32" type="stmt" count="10"/>
22+
<line num="33" type="stmt" count="10"/>
23+
<line num="34" type="stmt" count="10"/>
24+
<line num="35" type="stmt" count="10"/>
25+
<line num="36" type="stmt" count="10"/>
26+
<line num="42" type="method" name="print" visibility="public" complexity="2" crap="2" count="5"/>
27+
<line num="44" type="stmt" count="5"/>
28+
<line num="45" type="stmt" count="5"/>
29+
<line num="46" type="stmt" count="5"/>
30+
<line num="47" type="stmt" count="5"/>
31+
<line num="48" type="stmt" count="5"/>
32+
<line num="50" type="stmt" count="5"/>
33+
<line num="51" type="stmt" count="5"/>
34+
<line num="52" type="stmt" count="5"/>
35+
<line num="53" type="stmt" count="5"/>
36+
<line num="54" type="stmt" count="5"/>
37+
<line num="55" type="stmt" count="5"/>
38+
<line num="56" type="stmt" count="5"/>
39+
<line num="57" type="stmt" count="5"/>
40+
<line num="58" type="stmt" count="5"/>
41+
<line num="59" type="stmt" count="5"/>
42+
<line num="60" type="stmt" count="5"/>
43+
<line num="61" type="stmt" count="5"/>
44+
<line num="62" type="stmt" count="5"/>
45+
<line num="63" type="stmt" count="5"/>
46+
<line num="64" type="stmt" count="5"/>
47+
<line num="65" type="stmt" count="5"/>
48+
<line num="66" type="stmt" count="5"/>
49+
<line num="67" type="stmt" count="5"/>
50+
<line num="68" type="stmt" count="5"/>
51+
<line num="69" type="stmt" count="5"/>
52+
<line num="70" type="stmt" count="5"/>
53+
<line num="71" type="stmt" count="5"/>
54+
<line num="72" type="stmt" count="5"/>
55+
<line num="73" type="stmt" count="5"/>
56+
<line num="74" type="stmt" count="5"/>
57+
<line num="75" type="stmt" count="5"/>
58+
<line num="76" type="stmt" count="5"/>
59+
<line num="77" type="stmt" count="5"/>
60+
<line num="78" type="stmt" count="5"/>
61+
<line num="79" type="stmt" count="5"/>
62+
<metrics loc="82" ncloc="79" classes="1" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="52" coveredstatements="52" elements="54" coveredelements="54"/>
63+
</file>
64+
<file name="/var/www/src/MinCoverage/CoverageMetric.php">
65+
<class name="RobinIngelbrecht\PHPUnitCoverageTools\MinCoverage\CoverageMetric" namespace="global">
66+
<metrics complexity="12" methods="12" coveredmethods="12" conditionals="0" coveredconditionals="0" statements="24" coveredstatements="24" elements="36" coveredelements="36"/>
67+
</class>
68+
<line num="7" type="method" name="__construct" visibility="private" complexity="1" crap="1" count="5"/>
69+
<line num="18" type="stmt" count="5"/>
70+
<line num="20" type="method" name="getForClass" visibility="public" complexity="1" crap="1" count="4"/>
71+
<line num="22" type="stmt" count="4"/>
72+
<line num="25" type="method" name="getNumberOfMethods" visibility="public" complexity="1" crap="1" count="5"/>
73+
<line num="27" type="stmt" count="5"/>
74+
<line num="30" type="method" name="getNumberOfCoveredMethods" visibility="public" complexity="1" crap="1" count="5"/>
75+
<line num="32" type="stmt" count="5"/>
76+
<line num="35" type="method" name="getNumberOfStatements" visibility="public" complexity="1" crap="1" count="5"/>
77+
<line num="37" type="stmt" count="5"/>
78+
<line num="40" type="method" name="getNumberOfCoveredStatements" visibility="public" complexity="1" crap="1" count="5"/>
79+
<line num="42" type="stmt" count="5"/>
80+
<line num="45" type="method" name="getNumberOfConditionals" visibility="public" complexity="1" crap="1" count="5"/>
81+
<line num="47" type="stmt" count="5"/>
82+
<line num="50" type="method" name="getNumberOfCoveredConditionals" visibility="public" complexity="1" crap="1" count="5"/>
83+
<line num="52" type="stmt" count="5"/>
84+
<line num="55" type="method" name="getNumberOfTrackedLines" visibility="public" complexity="1" crap="1" count="5"/>
85+
<line num="57" type="stmt" count="5"/>
86+
<line num="60" type="method" name="getNumberOfCoveredLines" visibility="public" complexity="1" crap="1" count="5"/>
87+
<line num="62" type="stmt" count="5"/>
88+
<line num="65" type="method" name="getTotalPercentageCoverage" visibility="public" complexity="1" crap="1" count="5"/>
89+
<line num="70" type="stmt" count="5"/>
90+
<line num="71" type="stmt" count="5"/>
91+
<line num="74" type="method" name="fromCloverXmlNode" visibility="public" complexity="1" crap="1" count="5"/>
92+
<line num="77" type="stmt" count="5"/>
93+
<line num="79" type="stmt" count="5"/>
94+
<line num="80" type="stmt" count="5"/>
95+
<line num="81" type="stmt" count="5"/>
96+
<line num="82" type="stmt" count="5"/>
97+
<line num="83" type="stmt" count="5"/>
98+
<line num="84" type="stmt" count="5"/>
99+
<line num="85" type="stmt" count="5"/>
100+
<line num="86" type="stmt" count="5"/>
101+
<line num="87" type="stmt" count="5"/>
102+
<line num="88" type="stmt" count="5"/>
103+
<line num="89" type="stmt" count="5"/>
104+
<metrics loc="92" ncloc="89" classes="1" methods="12" coveredmethods="12" conditionals="0" coveredconditionals="0" statements="24" coveredstatements="24" elements="36" coveredelements="36"/>
105+
</file>
106+
<file name="/var/www/src/MinCoverage/MinCoverageResult.php">
107+
<class name="RobinIngelbrecht\PHPUnitCoverageTools\MinCoverage\MinCoverageResult" namespace="global">
108+
<metrics complexity="18" methods="9" coveredmethods="9" conditionals="0" coveredconditionals="0" statements="49" coveredstatements="49" elements="58" coveredelements="58"/>
109+
</class>
110+
<line num="7" type="method" name="__construct" visibility="private" complexity="1" crap="1" count="5"/>
111+
<line num="14" type="stmt" count="5"/>
112+
<line num="16" type="method" name="getPattern" visibility="public" complexity="1" crap="1" count="5"/>
113+
<line num="18" type="stmt" count="5"/>
114+
<line num="21" type="method" name="getStatus" visibility="public" complexity="3" crap="3" count="5"/>
115+
<line num="23" type="stmt" count="5"/>
116+
<line num="24" type="stmt" count="3"/>
117+
<line num="27" type="stmt" count="5"/>
118+
<line num="30" type="method" name="getExpectedMinCoverage" visibility="public" complexity="1" crap="1" count="5"/>
119+
<line num="32" type="stmt" count="5"/>
120+
<line num="35" type="method" name="getActualMinCoverage" visibility="public" complexity="1" crap="1" count="5"/>
121+
<line num="37" type="stmt" count="5"/>
122+
<line num="40" type="method" name="getNumberOfTrackedLines" visibility="public" complexity="1" crap="1" count="5"/>
123+
<line num="42" type="stmt" count="5"/>
124+
<line num="45" type="method" name="getNumberOfCoveredLines" visibility="public" complexity="1" crap="1" count="5"/>
125+
<line num="47" type="stmt" count="5"/>
126+
<line num="50" type="method" name="fromPatternAndNumbers" visibility="public" complexity="1" crap="1" count="5"/>
127+
<line num="57" type="stmt" count="5"/>
128+
<line num="58" type="stmt" count="5"/>
129+
<line num="59" type="stmt" count="5"/>
130+
<line num="60" type="stmt" count="5"/>
131+
<line num="61" type="stmt" count="5"/>
132+
<line num="62" type="stmt" count="5"/>
133+
<line num="63" type="stmt" count="5"/>
134+
<line num="71" type="method" name="mapFromRulesAndMetrics" visibility="public" complexity="8" crap="8" count="5"/>
135+
<line num="76" type="stmt" count="5"/>
136+
<line num="77" type="stmt" count="5"/>
137+
<line num="78" type="stmt" count="5"/>
138+
<line num="79" type="stmt" count="5"/>
139+
<line num="80" type="stmt" count="5"/>
140+
<line num="81" type="stmt" count="5"/>
141+
<line num="82" type="stmt" count="5"/>
142+
<line num="83" type="stmt" count="5"/>
143+
<line num="84" type="stmt" count="5"/>
144+
<line num="85" type="stmt" count="5"/>
145+
<line num="86" type="stmt" count="5"/>
146+
<line num="89" type="stmt" count="4"/>
147+
<line num="90" type="stmt" count="4"/>
148+
<line num="91" type="stmt" count="4"/>
149+
<line num="93" type="stmt" count="4"/>
150+
<line num="94" type="stmt" count="4"/>
151+
<line num="95" type="stmt" count="3"/>
152+
<line num="96" type="stmt" count="3"/>
153+
<line num="99" type="stmt" count="4"/>
154+
<line num="100" type="stmt" count="4"/>
155+
<line num="101" type="stmt" count="4"/>
156+
<line num="102" type="stmt" count="4"/>
157+
<line num="103" type="stmt" count="4"/>
158+
<line num="104" type="stmt" count="4"/>
159+
<line num="105" type="stmt" count="4"/>
160+
<line num="108" type="stmt" count="5"/>
161+
<line num="109" type="stmt" count="4"/>
162+
<line num="110" type="stmt" count="4"/>
163+
<line num="112" type="stmt" count="2"/>
164+
<line num="113" type="stmt" count="2"/>
165+
<line num="116" type="stmt" count="2"/>
166+
<line num="117" type="stmt" count="5"/>
167+
<line num="119" type="stmt" count="5"/>
168+
<metrics loc="122" ncloc="117" classes="1" methods="9" coveredmethods="9" conditionals="0" coveredconditionals="0" statements="49" coveredstatements="49" elements="58" coveredelements="58"/>
169+
</file>
170+
<file name="/var/www/src/MinCoverage/MinCoverageRules.php">
171+
<class name="RobinIngelbrecht\PHPUnitCoverageTools\MinCoverage\MinCoverageRules" namespace="global">
172+
<metrics complexity="14" methods="6" coveredmethods="6" conditionals="0" coveredconditionals="0" statements="21" coveredstatements="21" elements="27" coveredelements="27"/>
173+
</class>
174+
<line num="11" type="method" name="__construct" visibility="private" complexity="1" crap="1" count="11"/>
175+
<line num="15" type="stmt" count="11"/>
176+
<line num="20" type="method" name="getRules" visibility="public" complexity="1" crap="1" count="9"/>
177+
<line num="22" type="stmt" count="9"/>
178+
<line num="25" type="method" name="hasTotalRule" visibility="public" complexity="1" crap="1" count="6"/>
179+
<line num="27" type="stmt" count="6"/>
180+
<line num="30" type="method" name="hasOtherRulesThanTotalRule" visibility="public" complexity="3" crap="3" count="6"/>
181+
<line num="32" type="stmt" count="6"/>
182+
<line num="33" type="stmt" count="6"/>
183+
<line num="34" type="stmt" count="5"/>
184+
<line num="38" type="stmt" count="1"/>
185+
<line num="41" type="method" name="fromInt" visibility="public" complexity="3" crap="3" count="3"/>
186+
<line num="43" type="stmt" count="3"/>
187+
<line num="44" type="stmt" count="1"/>
188+
<line num="47" type="stmt" count="2"/>
189+
<line num="48" type="stmt" count="2"/>
190+
<line num="49" type="stmt" count="2"/>
191+
<line num="52" type="method" name="fromConfigFile" visibility="public" complexity="5" crap="5" count="11"/>
192+
<line num="55" type="stmt" count="11"/>
193+
<line num="56" type="stmt" count="11"/>
194+
<line num="58" type="stmt" count="11"/>
195+
<line num="59" type="stmt" count="1"/>
196+
<line num="62" type="stmt" count="10"/>
197+
<line num="63" type="stmt" count="10"/>
198+
<line num="64" type="stmt" count="9"/>
199+
<line num="65" type="stmt" count="1"/>
200+
<line num="69" type="stmt" count="9"/>
201+
<metrics loc="72" ncloc="67" classes="1" methods="6" coveredmethods="6" conditionals="0" coveredconditionals="0" statements="21" coveredstatements="21" elements="27" coveredelements="27"/>
202+
</file>
203+
<file name="/var/www/src/MinCoverage/ResultStatus.php">
204+
<class name="RobinIngelbrecht\PHPUnitCoverageTools\MinCoverage\ResultStatus" namespace="global">
205+
<metrics complexity="2" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="10" elements="12" coveredelements="12"/>
206+
</class>
207+
<line num="11" type="method" name="getWeight" visibility="public" complexity="1" crap="1" count="2"/>
208+
<line num="13" type="stmt" count="2"/>
209+
<line num="14" type="stmt" count="2"/>
210+
<line num="15" type="stmt" count="2"/>
211+
<line num="16" type="stmt" count="2"/>
212+
<line num="17" type="stmt" count="2"/>
213+
<line num="20" type="method" name="getMessage" visibility="public" complexity="1" crap="1" count="5"/>
214+
<line num="22" type="stmt" count="5"/>
215+
<line num="23" type="stmt" count="5"/>
216+
<line num="24" type="stmt" count="5"/>
217+
<line num="25" type="stmt" count="5"/>
218+
<line num="26" type="stmt" count="5"/>
219+
<metrics loc="29" ncloc="29" classes="1" methods="2" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="10" elements="12" coveredelements="12"/>
220+
</file>
221+
<file name="/var/www/src/PhpUnitExtension.php">
222+
<class name="RobinIngelbrecht\PHPUnitCoverageTools\PhpUnitExtension" namespace="global">
223+
<metrics complexity="2" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="9" coveredstatements="9" elements="10" coveredelements="10"/>
224+
</class>
225+
<line num="13" type="method" name="bootstrap" visibility="public" complexity="2" crap="2" count="3"/>
226+
<line num="18" type="stmt" count="3"/>
227+
<line num="19" type="stmt" count="3"/>
228+
<line num="20" type="stmt" count="3"/>
229+
<line num="21" type="stmt" count="3"/>
230+
<line num="22" type="stmt" count="3"/>
231+
<line num="23" type="stmt" count="2"/>
232+
<line num="26" type="stmt" count="1"/>
233+
<line num="27" type="stmt" count="1"/>
234+
<line num="28" type="stmt" count="1"/>
235+
<metrics loc="31" ncloc="31" classes="1" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="9" coveredstatements="9" elements="10" coveredelements="10"/>
236+
</file>
237+
<file name="/var/www/src/Subscriber/Application/ApplicationFinishedSubscriber.php">
238+
<class name="RobinIngelbrecht\PHPUnitCoverageTools\Subscriber\Application\ApplicationFinishedSubscriber" namespace="global">
239+
<metrics complexity="29" methods="3" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="58" coveredstatements="58" elements="61" coveredelements="61"/>
240+
</class>
241+
<line num="20" type="method" name="__construct" visibility="public" complexity="1" crap="1" count="10"/>
242+
<line num="28" type="stmt" count="10"/>
243+
<line num="30" type="method" name="notify" visibility="public" complexity="16" crap="16" count="7"/>
244+
<line num="33" type="stmt" count="7"/>
245+
<line num="34" type="stmt" count="7"/>
246+
<line num="36" type="stmt" count="7"/>
247+
<line num="37" type="stmt" count="1"/>
248+
<line num="41" type="stmt" count="6"/>
249+
<line num="42" type="stmt" count="6"/>
250+
<line num="45" type="stmt" count="6"/>
251+
<line num="46" type="stmt" count="6"/>
252+
<line num="47" type="stmt" count="6"/>
253+
<line num="48" type="stmt" count="6"/>
254+
<line num="50" type="stmt" count="5"/>
255+
<line num="51" type="stmt" count="5"/>
256+
<line num="52" type="stmt" count="5"/>
257+
<line num="55" type="stmt" count="6"/>
258+
<line num="57" type="stmt" count="4"/>
259+
<line num="59" type="stmt" count="4"/>
260+
<line num="60" type="stmt" count="4"/>
261+
<line num="63" type="stmt" count="6"/>
262+
<line num="65" type="stmt" count="6"/>
263+
<line num="66" type="stmt" count="1"/>
264+
<line num="69" type="stmt" count="6"/>
265+
<line num="70" type="stmt" count="1"/>
266+
<line num="73" type="stmt" count="5"/>
267+
<line num="74" type="stmt" count="5"/>
268+
<line num="75" type="stmt" count="5"/>
269+
<line num="76" type="stmt" count="5"/>
270+
<line num="77" type="stmt" count="5"/>
271+
<line num="78" type="stmt" count="5"/>
272+
<line num="80" type="stmt" count="5"/>
273+
<line num="82" type="stmt" count="5"/>
274+
<line num="83" type="stmt" count="2"/>
275+
<line num="90" type="method" name="fromConfigurationAndParameters" visibility="public" complexity="12" crap="12" count="8"/>
276+
<line num="95" type="stmt" count="8"/>
277+
<line num="96" type="stmt" count="1"/>
278+
<line num="99" type="stmt" count="7"/>
279+
<line num="100" type="stmt" count="7"/>
280+
<line num="101" type="stmt" count="7"/>
281+
<line num="102" type="stmt" count="2"/>
282+
<line num="106" type="stmt" count="6"/>
283+
<line num="107" type="stmt" count="3"/>
284+
<line num="108" type="stmt" count="2"/>
285+
<line num="111" type="stmt" count="3"/>
286+
<line num="112" type="stmt" count="3"/>
287+
<line num="113" type="stmt" count="2"/>
288+
<line num="115" type="stmt" count="2"/>
289+
<line num="116" type="stmt" count="2"/>
290+
<line num="120" type="stmt" count="5"/>
291+
<line num="121" type="stmt" count="2"/>
292+
<line num="124" type="stmt" count="3"/>
293+
<line num="125" type="stmt" count="2"/>
294+
<line num="128" type="stmt" count="3"/>
295+
<line num="129" type="stmt" count="3"/>
296+
<line num="130" type="stmt" count="3"/>
297+
<line num="131" type="stmt" count="3"/>
298+
<line num="132" type="stmt" count="3"/>
299+
<line num="133" type="stmt" count="3"/>
300+
<line num="134" type="stmt" count="3"/>
301+
<line num="135" type="stmt" count="3"/>
302+
<metrics loc="138" ncloc="129" classes="1" methods="3" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="58" coveredstatements="58" elements="61" coveredelements="61"/>
303+
</file>
304+
<metrics files="7" loc="566" ncloc="541" classes="7" methods="35" coveredmethods="35" conditionals="0" coveredconditionals="0" statements="223" coveredstatements="223" elements="258" coveredelements="258"/>
305+
</project>
306+
</coverage>

src/Subscriber/Application/ApplicationFinishedSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public static function fromConfigurationAndParameters(
121121
return null;
122122
}
123123

124-
if (!$cleanUpCloverXml = in_array('--clean-up-clover-xml', $_SERVER['argv'], true)) {
124+
if (!$cleanUpCloverXml = in_array('--clean-up-clover-xml', $args, true)) {
125125
$cleanUpCloverXml = $parameters->has('cleanUpCloverXml') && (int) $parameters->get('cleanUpCloverXml');
126126
}
127127

tests/Subscriber/Application/ApplicationFinishedSubscriberTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public function testFromConfigurationAndParameters(): void
280280
'tests/clover.xml',
281281
MinCoverageRules::fromInt(90),
282282
false,
283-
false,
283+
true,
284284
new Exitter(),
285285
new ConsoleOutput(new \Symfony\Component\Console\Output\ConsoleOutput()),
286286
),
@@ -289,7 +289,7 @@ public function testFromConfigurationAndParameters(): void
289289
'--coverage-clover=tests/clover.xml',
290290
]),
291291
ParameterCollection::fromArray([]),
292-
['--min-coverage=90']
292+
['--min-coverage=90', '--clean-up-clover-xml']
293293
),
294294
);
295295
}

0 commit comments

Comments
 (0)