Skip to content

Commit d49aff7

Browse files
authored
[PHPStan 2.1.18] Fix NeonAdapter construct on MaximumIgnoredErrorCountRule (#231)
* [PHPStan 2.1.18] Fix NeonAdapter construct on MaximumIgnoredErrorCountRule * eol * Fix
1 parent ba149dd commit d49aff7

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

.github/workflows/code_analysis.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ jobs:
2020
name: 'Composer Validate'
2121
run: composer validate --ansi
2222

23-
-
24-
name: 'Rector'
25-
run: composer rector --ansi
23+
# temporary disable due to missing method PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode::getSealedTagValues() due requirement of latest phpdoc-parser
24+
# -
25+
# name: 'Rector'
26+
# run: composer rector --ansi
2627

2728
-
2829
name: 'Coding Standard'

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"require": {
77
"php": ">=8.2",
88
"webmozart/assert": "^1.11",
9-
"phpstan/phpstan": "^2.1.8",
9+
"phpstan/phpstan": "^2.1.18",
1010
"nette/utils": "^3.2|^4.0",
1111
"phpstan/phpdoc-parser": "^2.1"
1212
},

src/Rules/MaximumIgnoredErrorCountRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
public function __construct(
2828
private int $limit = 0
2929
) {
30-
$this->neonAdapter = new NeonAdapter();
30+
$this->neonAdapter = new NeonAdapter([]);
3131
}
3232

3333
/**
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Symplify\PHPStanRules\Tests\Issues;
6+
7+
use PHPUnit\Framework\TestCase;
8+
9+
final class InstantiateMaximumIgnoredErrorCountRuleTest extends TestCase
10+
{
11+
public function testInstantiation(): void
12+
{
13+
$rule = new \Symplify\PHPStanRules\Rules\MaximumIgnoredErrorCountRule(10);
14+
$this->assertInstanceOf(\Symplify\PHPStanRules\Rules\MaximumIgnoredErrorCountRule::class, $rule);
15+
}
16+
}

0 commit comments

Comments
 (0)