Skip to content

Commit 8b7a598

Browse files
committed
Integrated phpstan-phpunit and phpstan-php-parser extensions
1 parent 2d93d16 commit 8b7a598

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"consistence/coding-standard": "~0.13.0",
2222
"jakub-onderka/php-parallel-lint": "^0.9.2",
2323
"phing/phing": "^2.13.0",
24+
"phpstan/phpstan-php-parser": "^0.9",
25+
"phpstan/phpstan-phpunit": "^0.9",
2426
"phpunit/phpunit": "^6.2",
2527
"satooshi/php-coveralls": "^1.0",
2628
"slevomat/coding-standard": "^2.0"

phpstan.neon

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
includes:
2+
- vendor/phpstan/phpstan-php-parser/extension.neon
3+
- vendor/phpstan/phpstan-phpunit/extension.neon
4+
- vendor/phpstan/phpstan-phpunit/rules.neon
5+
16
parameters:
27
excludes_analyse:
38
- %rootDir%/../../../tests/notAutoloaded/*
4-
5-
ignoreErrors:
6-
- '#PHPUnit_Framework_MockObject_MockObject given#'
7-
- '# but returns PHPUnit_Framework_MockObject_MockObject.#'
8-
- '#Access to an undefined property PHPUnit_Framework_MockObject_MockObject::\$[a-zA-Z0-9_]+#'

tests/Rule/Nette/DoNotExtendNetteObjectRuleTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ protected function setUp()
3030
public function testSmartObjectChild()
3131
{
3232
$scope = $this->createMock(Scope::class);
33-
$node = $this->createMock(Node::class);
34-
$node->namespacedName = 'PHPStan\Tests\SmartObjectChild';
33+
$node = $this->createMock(Node\Stmt\Class_::class);
34+
$node->namespacedName = new Node\Name('PHPStan\Tests\SmartObjectChild');
3535

3636
$result = $this->rule->processNode($node, $scope);
3737

@@ -44,8 +44,8 @@ public function testNetteObjectChild()
4444
$this->markTestSkipped('PHP 7.2 is incompatible with Nette\Object.');
4545
}
4646
$scope = $this->createMock(Scope::class);
47-
$node = $this->createMock(Node::class);
48-
$node->namespacedName = 'PHPStan\Tests\NetteObjectChild';
47+
$node = $this->createMock(Node\Stmt\Class_::class);
48+
$node->namespacedName = new Node\Name('PHPStan\Tests\NetteObjectChild');
4949

5050
$result = $this->rule->processNode($node, $scope);
5151

0 commit comments

Comments
 (0)