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
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.6"
},
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ includes:
- extension.neon
- rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- phar://phpstan.phar/conf/bleedingEdge.neon
- phpstan-baseline.neon

Expand Down
2 changes: 1 addition & 1 deletion src/Rules/PHPUnit/ClassCoversExistsRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function processNode(Node $node, Scope $scope): array
{
$classReflection = $node->getClassReflection();

if (!$classReflection->isSubclassOf(TestCase::class)) {
if (!$classReflection->is(TestCase::class)) {
return [];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Rules/PHPUnit/ClassMethodCoversExistsRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function processNode(Node $node, Scope $scope): array
return [];
}

if (!$classReflection->isSubclassOf(TestCase::class)) {
if (!$classReflection->is(TestCase::class)) {
return [];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Rules/PHPUnit/DataProviderDeclarationRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function processNode(Node $node, Scope $scope): array
{
$classReflection = $scope->getClassReflection();

if ($classReflection === null || !$classReflection->isSubclassOf(TestCase::class)) {
if ($classReflection === null || !$classReflection->is(TestCase::class)) {
return [];
}

Expand Down
6 changes: 3 additions & 3 deletions src/Rules/PHPUnit/DataProviderHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getDataProviderMethods(
}

$dataProviderMethod = $this->parseDataProviderAnnotationValue($scope, $dataProviderValue);
$dataProviderMethod[] = $node->getLine();
$dataProviderMethod[] = $node->getStartLine();

yield $dataProviderValue => $dataProviderMethod;
}
Expand Down Expand Up @@ -257,7 +257,7 @@ private function parseDataProviderExternalAttribute(Attribute $attribute): ?arra
sprintf('%s::%s', $className, $methodNameArg->value) => [
$dataProviderClassReflection,
$methodNameArg->value,
$attribute->getLine(),
$attribute->getStartLine(),
],
];
}
Expand All @@ -279,7 +279,7 @@ private function parseDataProviderAttribute(Attribute $attribute, ClassReflectio
$methodNameArg->value => [
$classReflection,
$methodNameArg->value,
$attribute->getLine(),
$attribute->getStartLine(),
],
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Rules/PHPUnit/NoMissingSpaceInClassAnnotationRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getNodeType(): string
public function processNode(Node $node, Scope $scope): array
{
$classReflection = $scope->getClassReflection();
if ($classReflection === null || $classReflection->isSubclassOf(TestCase::class) === false) {
if ($classReflection === null || $classReflection->is(TestCase::class) === false) {
return [];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Rules/PHPUnit/NoMissingSpaceInMethodAnnotationRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getNodeType(): string
public function processNode(Node $node, Scope $scope): array
{
$classReflection = $scope->getClassReflection();
if ($classReflection === null || $classReflection->isSubclassOf(TestCase::class) === false) {
if ($classReflection === null || $classReflection->is(TestCase::class) === false) {
return [];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Rules/PHPUnit/ShouldCallParentMethodsRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function processNode(Node $node, Scope $scope): array
return [];
}

if (!$scope->getClassReflection()->isSubclassOf(TestCase::class)) {
if (!$scope->getClassReflection()->is(TestCase::class)) {
return [];
}

Expand Down