Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase static analysis #37

Merged
merged 6 commits into from
Nov 28, 2024
Merged
Changes from 1 commit
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
Next Next commit
Fix broken test
  • Loading branch information
Jean85 committed Nov 22, 2024
commit 1d553a84c2b2b673688a0fd3fc74236fdd9da9cd
27 changes: 22 additions & 5 deletions tests/Rules/CallMethodRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use PHPStan\Rules\Methods\MethodCallCheck;
use PHPStan\Rules\NullsafeCheck;
use PHPStan\Rules\PhpDoc\UnresolvableTypeHelper;
use PHPStan\Rules\Properties\PropertyReflectionFinder;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleLevelHelper;
use PHPStan\Testing\RuleTestCase;
Expand All @@ -17,15 +18,31 @@ class CallMethodRuleTest extends RuleTestCase
{
protected function getRule(): Rule
{
$reflectionProvider = $this->createReflectionProvider();
$ruleLevelHelper = new RuleLevelHelper($reflectionProvider, true, true, true, false);
$reflectionProvider = self::createReflectionProvider();
$ruleLevelHelper = new RuleLevelHelper($reflectionProvider, true, true, true, true, false, true);

return new CallMethodsRule(
new MethodCallCheck($reflectionProvider, $ruleLevelHelper, true, true),
new FunctionCallParametersCheck($ruleLevelHelper, new NullsafeCheck(), new PhpVersion(PHP_VERSION_ID), new UnresolvableTypeHelper(), true, false, false, false)
new MethodCallCheck(
$reflectionProvider,
$ruleLevelHelper,
true,
true
),
new FunctionCallParametersCheck(
$ruleLevelHelper,
new NullsafeCheck(),
new PhpVersion(PHP_VERSION_ID),
new UnresolvableTypeHelper(),
new PropertyReflectionFinder(),
true,
true,
true,
true
)
);
}

public function testSafePregReplace()
public function testSafePregReplace(): void
{
// FIXME: this rule actually runs code but will always return no error because the rule executed is not the correct one.
// This provides code coverage but assert is not ok.
Expand Down
Loading