Skip to content

Disable check for function/class/path/folder/... is not working #104

@VincentLanglet

Description

@VincentLanglet

I use phpstan for both my src/ and test/ folder.
But I want to use this extension only for my src folder.

I was expecting solving the issue with

exceptionRules:
        methodWhitelist:
            PHPUnit\Framework\TestCase: '##'

But I still getting error in my tests files.

Missing @throws ... annotation

I create a PR with failing tests #103 for the rule introduced by @marcospassos

        public function testFoo(): void
	{
		throw new RuntimeException();
	}

        public function testFooBis(): void
	{
		$this->bar(); // throwing exceptions
	}

SHOULD NOT return an error by phpstan

Plus, I don't agree with the Unused @throws RuntimeException annotation error for whitelist method. If I whitelist the method, I don't expect error if I'm a good guy who annotate the function.

That's why I add my proposal to fix the tests in the PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions