Skip to content

Commit 6ac9cd7

Browse files
Merge branch '11.0'
2 parents 086553c + 4f7722a commit 6ac9cd7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+189
-128
lines changed

.phive/phars.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="php-cs-fixer" version="^3.70" installed="3.84.0" location="./tools/php-cs-fixer" copy="true"/>
4-
<phar name="composer" version="^2.8" installed="2.8.10" location="./tools/composer" copy="true"/>
3+
<phar name="php-cs-fixer" version="^3.86" installed="3.86.0" location="./tools/php-cs-fixer" copy="true"/>
4+
<phar name="composer" version="^2.8" installed="2.8.11" location="./tools/composer" copy="true"/>
55
</phive>

phpstan.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
parameters:
22
level: 5
3+
34
paths:
45
- src
56
- tests/tests
67
- tests/bootstrap.php
78

9+
resultCachePath: %tmpDir%/php-code-coverage-12.3.php
10+
811
checkTooWideReturnTypesInProtectedAndPublicMethods: true
912
reportAlwaysTrueInLastCondition: true
1013
reportPossiblyNonexistentConstantArrayOffset: true

src/CodeCoverage.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,15 +418,15 @@ private function applyCoversAndUsesFilter(RawCodeCoverageData $rawData, array|fa
418418

419419
private function applyFilter(RawCodeCoverageData $data): void
420420
{
421-
if ($this->filter->isEmpty()) {
422-
return;
423-
}
424-
425-
foreach (array_keys($data->lineCoverage()) as $filename) {
426-
if ($this->filter->isExcluded($filename)) {
427-
$data->removeCoverageDataForFile($filename);
421+
if (!$this->filter->isEmpty()) {
422+
foreach (array_keys($data->lineCoverage()) as $filename) {
423+
if ($this->filter->isExcluded($filename)) {
424+
$data->removeCoverageDataForFile($filename);
425+
}
428426
}
429427
}
428+
429+
$data->skipEmptyLines();
430430
}
431431

432432
private function applyExecutableLinesFilter(RawCodeCoverageData $data): void

src/Data/RawCodeCoverageData.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ private function __construct(array $lineCoverage, array $functionCoverage)
104104
{
105105
$this->lineCoverage = $lineCoverage;
106106
$this->functionCoverage = $functionCoverage;
107-
108-
$this->skipEmptyLines();
109107
}
110108

111109
public function clear(): void
@@ -252,7 +250,7 @@ public function removeCoverageDataForLines(string $filename, array $lines): void
252250
*
253251
* @see https://github.com/sebastianbergmann/php-code-coverage/issues/799
254252
*/
255-
private function skipEmptyLines(): void
253+
public function skipEmptyLines(): void
256254
{
257255
foreach ($this->lineCoverage as $filename => $coverage) {
258256
foreach ($this->getEmptyLinesForFile($filename) as $emptyLine) {

tests/tests/Data/RawCodeCoverageDataTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ public function testCoverageForFileWithInlineAnnotations(): void
327327
],
328328
);
329329

330+
$coverage->skipEmptyLines();
331+
330332
$this->assertEquals(
331333
[
332334
13 => -1,

tools/.phpstan/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"require-dev": {
3-
"phpstan/phpstan": "^2.1.21",
3+
"phpstan/phpstan": "^2.1.22",
44
"phpstan/extension-installer": "^1.4.3",
55
"phpstan/phpstan-strict-rules": "^2.0.6",
66
"tomasvotruba/type-coverage": "^2.0.2",
7-
"ergebnis/phpstan-rules": "^2.10.5"
7+
"ergebnis/phpstan-rules": "^2.11.0"
88
},
99
"config": {
1010
"allow-plugins": {

tools/.phpstan/composer.lock

Lines changed: 27 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/.phpstan/vendor/composer/autoload_psr4.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
'TomasVotruba\\TypeCoverage\\' => array($vendorDir . '/tomasvotruba/type-coverage/src'),
1010
'PHPStan\\ExtensionInstaller\\' => array($vendorDir . '/phpstan/extension-installer/src'),
1111
'PHPStan\\' => array($vendorDir . '/phpstan/phpstan-strict-rules/src'),
12+
'Nette\\' => array($vendorDir . '/nette/utils/src'),
1213
'Ergebnis\\PHPStan\\Rules\\' => array($vendorDir . '/ergebnis/phpstan-rules/src'),
1314
);

tools/.phpstan/vendor/composer/autoload_static.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class ComposerStaticInitf9e7218f71d5874b5632927df4f72bd7
2020
'PHPStan\\ExtensionInstaller\\' => 27,
2121
'PHPStan\\' => 8,
2222
),
23+
'N' =>
24+
array (
25+
'Nette\\' => 6,
26+
),
2327
'E' =>
2428
array (
2529
'Ergebnis\\PHPStan\\Rules\\' => 23,
@@ -39,6 +43,10 @@ class ComposerStaticInitf9e7218f71d5874b5632927df4f72bd7
3943
array (
4044
0 => __DIR__ . '/..' . '/phpstan/phpstan-strict-rules/src',
4145
),
46+
'Nette\\' =>
47+
array (
48+
0 => __DIR__ . '/..' . '/nette/utils/src',
49+
),
4250
'Ergebnis\\PHPStan\\Rules\\' =>
4351
array (
4452
0 => __DIR__ . '/..' . '/ergebnis/phpstan-rules/src',

0 commit comments

Comments
 (0)