@@ -132,7 +132,7 @@ private function logging(string $filename, DOMXPath $xpath): Logging
132
132
$ junit = null ;
133
133
$ element = $ this ->element ($ xpath , 'logging/junit ' );
134
134
135
- if ($ element ) {
135
+ if ($ element !== null ) {
136
136
$ junit = new Junit (
137
137
new File (
138
138
$ this ->toAbsolutePath (
@@ -146,7 +146,7 @@ private function logging(string $filename, DOMXPath $xpath): Logging
146
146
$ teamCity = null ;
147
147
$ element = $ this ->element ($ xpath , 'logging/teamcity ' );
148
148
149
- if ($ element ) {
149
+ if ($ element !== null ) {
150
150
$ teamCity = new TeamCity (
151
151
new File (
152
152
$ this ->toAbsolutePath (
@@ -160,7 +160,7 @@ private function logging(string $filename, DOMXPath $xpath): Logging
160
160
$ testDoxHtml = null ;
161
161
$ element = $ this ->element ($ xpath , 'logging/testdoxHtml ' );
162
162
163
- if ($ element ) {
163
+ if ($ element !== null ) {
164
164
$ testDoxHtml = new TestDoxHtml (
165
165
new File (
166
166
$ this ->toAbsolutePath (
@@ -174,7 +174,7 @@ private function logging(string $filename, DOMXPath $xpath): Logging
174
174
$ testDoxText = null ;
175
175
$ element = $ this ->element ($ xpath , 'logging/testdoxText ' );
176
176
177
- if ($ element ) {
177
+ if ($ element !== null ) {
178
178
$ testDoxText = new TestDoxText (
179
179
new File (
180
180
$ this ->toAbsolutePath (
@@ -279,7 +279,7 @@ private function source(string $filename, DOMXPath $xpath): Source
279
279
280
280
$ element = $ this ->element ($ xpath , 'source ' );
281
281
282
- if ($ element ) {
282
+ if ($ element !== null ) {
283
283
$ baseline = $ this ->parseStringAttribute ($ element , 'baseline ' );
284
284
285
285
if ($ baseline !== null ) {
@@ -357,7 +357,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath): CodeCoverage
357
357
358
358
$ element = $ this ->element ($ xpath , 'coverage ' );
359
359
360
- if ($ element ) {
360
+ if ($ element !== null ) {
361
361
$ pathCoverage = $ this ->parseBooleanAttribute (
362
362
$ element ,
363
363
'pathCoverage ' ,
@@ -386,7 +386,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath): CodeCoverage
386
386
$ clover = null ;
387
387
$ element = $ this ->element ($ xpath , 'coverage/report/clover ' );
388
388
389
- if ($ element ) {
389
+ if ($ element !== null ) {
390
390
$ clover = new Clover (
391
391
new File (
392
392
$ this ->toAbsolutePath (
@@ -400,7 +400,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath): CodeCoverage
400
400
$ cobertura = null ;
401
401
$ element = $ this ->element ($ xpath , 'coverage/report/cobertura ' );
402
402
403
- if ($ element ) {
403
+ if ($ element !== null ) {
404
404
$ cobertura = new Cobertura (
405
405
new File (
406
406
$ this ->toAbsolutePath (
@@ -414,7 +414,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath): CodeCoverage
414
414
$ crap4j = null ;
415
415
$ element = $ this ->element ($ xpath , 'coverage/report/crap4j ' );
416
416
417
- if ($ element ) {
417
+ if ($ element !== null ) {
418
418
$ crap4j = new Crap4j (
419
419
new File (
420
420
$ this ->toAbsolutePath (
@@ -429,7 +429,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath): CodeCoverage
429
429
$ html = null ;
430
430
$ element = $ this ->element ($ xpath , 'coverage/report/html ' );
431
431
432
- if ($ element ) {
432
+ if ($ element !== null ) {
433
433
$ defaultColors = Colors::default ();
434
434
$ defaultThresholds = Thresholds::default ();
435
435
@@ -454,7 +454,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath): CodeCoverage
454
454
$ php = null ;
455
455
$ element = $ this ->element ($ xpath , 'coverage/report/php ' );
456
456
457
- if ($ element ) {
457
+ if ($ element !== null ) {
458
458
$ php = new CodeCoveragePhp (
459
459
new File (
460
460
$ this ->toAbsolutePath (
@@ -468,7 +468,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath): CodeCoverage
468
468
$ text = null ;
469
469
$ element = $ this ->element ($ xpath , 'coverage/report/text ' );
470
470
471
- if ($ element ) {
471
+ if ($ element !== null ) {
472
472
$ text = new CodeCoverageText (
473
473
new File (
474
474
$ this ->toAbsolutePath (
@@ -484,7 +484,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath): CodeCoverage
484
484
$ xml = null ;
485
485
$ element = $ this ->element ($ xpath , 'coverage/report/xml ' );
486
486
487
- if ($ element ) {
487
+ if ($ element !== null ) {
488
488
$ xml = new CodeCoverageXml (
489
489
new Directory (
490
490
$ this ->toAbsolutePath (
@@ -549,7 +549,7 @@ private function readFilterDirectories(string $filename, DOMXPath $xpath, string
549
549
550
550
$ directoryPath = $ directoryNode ->textContent ;
551
551
552
- if (! $ directoryPath ) {
552
+ if ($ directoryPath === '' ) {
553
553
continue ;
554
554
}
555
555
@@ -576,7 +576,7 @@ private function readFilterFiles(string $filename, DOMXPath $xpath, string $quer
576
576
577
577
$ filePath = $ fileNode ->textContent ;
578
578
579
- if ($ filePath ) {
579
+ if ($ filePath !== '' ) {
580
580
$ files [] = new File ($ this ->toAbsolutePath ($ filename , $ filePath ));
581
581
}
582
582
}
@@ -679,7 +679,7 @@ private function php(string $filename, DOMXPath $xpath): Php
679
679
680
680
$ path = $ includePath ->textContent ;
681
681
682
- if ($ path ) {
682
+ if ($ path !== '' ) {
683
683
$ includePaths [] = new Directory ($ this ->toAbsolutePath ($ filename , $ path ));
684
684
}
685
685
}
@@ -967,7 +967,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti
967
967
foreach ($ element ->getElementsByTagName ('exclude ' ) as $ excludeNode ) {
968
968
$ excludeFile = $ excludeNode ->textContent ;
969
969
970
- if ($ excludeFile ) {
970
+ if ($ excludeFile !== '' ) {
971
971
$ exclude [] = new File ($ this ->toAbsolutePath ($ filename , $ excludeFile ));
972
972
}
973
973
}
0 commit comments