Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

-
name: 'Class Leak'
run: vendor/bin/class-leak check src tests --skip-path=Fixture --skip-path=Source
run: vendor/bin/class-leak check src tests --skip-path=Fixture --skip-path=Source --skip-type="Rector\\ArgTyper\\PHPStan\\IgnoreAllErrorsExceptArgTyperErrorExtension"

-
name: 'Tests'
Expand All @@ -46,7 +46,7 @@ jobs:

-
name: 'Check Active Classes'
run: vendor/bin/class-leak check src bin tests --ansi --skip-path=Fixture --skip-path=Source
run: vendor/bin/class-leak check src bin tests --ansi --skip-path=Fixture --skip-path=Source --skip-type="Rector\\ArgTyper\\PHPStan\\IgnoreAllErrorsExceptArgTyperErrorExtension"

name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions config/phpstan-collecting-data.neon
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ parameters:
rules:
- Rector\ArgTyper\PHPStan\Rule\CollectFuncCallArgTypesRule
- Rector\ArgTyper\PHPStan\Rule\CollectCallLikeArgTypesRule

services:
-
class: Rector\ArgTyper\PHPStan\IgnoreAllErrorsExceptArgTyperErrorExtension
tags:
- phpstan.ignoreErrorExtension
19 changes: 19 additions & 0 deletions src/PHPStan/IgnoreAllErrorsExceptArgTyperErrorExtension.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace Rector\ArgTyper\PHPStan;

use PhpParser\Node;
use PHPStan\Analyser\Error;
use PHPStan\Analyser\IgnoreErrorExtension;
use PHPStan\Analyser\Scope;

final class IgnoreAllErrorsExceptArgTyperErrorExtension implements IgnoreErrorExtension
{
public function shouldIgnore(Error $error, Node $node, Scope $scope): bool
{
// Ignore all errors since ArgTyper only collects types and doesn't throw errors
return true;
}
}
Loading