Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Commit d1845b1

Browse files
Use PHPStan (#26)
1 parent bbee214 commit d1845b1

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ jobs:
3030
script:
3131
- vendor/bin/phpcs -p
3232

33+
- stage: Code Quality
34+
env: STATIC_ANALYSIS
35+
script:
36+
- vendor/bin/phpstan analyse
37+
3338
stages:
3439
- Test
3540
- name: Code Quality

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"ext-mbstring": "*",
1919
"ext-tokenizer": "*",
2020
"lstrojny/functional-php": "^1.8",
21+
"phpstan/phpstan": "^0.10",
22+
"phpstan/phpstan-phpunit": "^0.10",
2123
"phpunit/phpunit": "^7.3",
2224
"symfony/finder": "^4.1"
2325
},

phpstan.neon.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
parameters:
2+
autoload_files:
3+
- vendor/squizlabs/php_codesniffer/autoload.php
4+
level: max
5+
paths:
6+
- src
7+
- tests
8+
9+
includes:
10+
- vendor/phpstan/phpstan-phpunit/extension.neon
11+
- vendor/phpstan/phpstan-phpunit/rules.neon

tests/RulesetTests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function it_finds_and_fixes_violations(
5959
sort($actual);
6060
sort($messages);
6161

62-
$this->assertSame($messages, $actual, $description);
62+
$this->assertSame($messages, $actual, $description ?? '');
6363
if ($fixedEncoding) {
6464
$this->assertSame($fixedEncoding, mb_detect_encoding($file->fixer->getContents(), 'UTF-8', true));
6565
}

0 commit comments

Comments
 (0)