Skip to content

Commit 1702792

Browse files
committed
add phpstan support
1 parent ccc4c1a commit 1702792

File tree

5 files changed

+65
-5
lines changed

5 files changed

+65
-5
lines changed

composer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"require-dev": {
2525
"ergebnis/composer-normalize": "^2.9",
2626
"phpcompatibility/php-compatibility": "^9.3",
27+
"phpstan/phpstan": "^0.12.54",
2728
"phpunit/phpunit": "6.5",
2829
"squizlabs/php_codesniffer": "^3.5"
2930
},
@@ -34,6 +35,7 @@
3435
}
3536
},
3637
"scripts": {
37-
"run-test": "vendor/bin/phpunit tests"
38+
"run-test": "vendor/bin/phpunit tests",
39+
"phpstan": "vendor/bin/phpstan analyse --level=8 --memory-limit=2G src tests"
3840
}
3941
}

composer.lock

+57-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
checkMissingIterableValueType: false

tests/Various/EnumTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class EnumTest extends TestCase {
4141
* @throws NullNotAllowedException
4242
* @throws ValueNotAllowedException
4343
*/
44-
public function testEnum() {
44+
public function testEnum(): void {
4545
$enum = new Enum([
4646
"1"
4747
, "2"

tests/Various/PermutationTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
class PermutationTest extends TestCase {
3333

3434

35-
public function testStringPermutation() {
35+
public function testStringPermutation(): void {
3636
$permutation = new Permutation();
3737
$permutations = $permutation->stringPermutations("abcd");
3838
$this->assertTrue(24 === \count($permutations));
@@ -46,7 +46,7 @@ public function testStringPermutation() {
4646
$this->assertTrue(1 === \count($permutations));
4747
}
4848

49-
public function testNumberPermutation() {
49+
public function testNumberPermutation(): void {
5050
$permutation = new Permutation();
5151
$permutations = $permutation->numberPermutations(1234);
5252
$this->assertTrue(24 === \count($permutations));

0 commit comments

Comments
 (0)