Skip to content

Commit 61b63a7

Browse files
authored
Reintroduce phpstan, add baseline (#433)
* Reintroduce phpstan, add baseline * add baseline into stan * add phpstan to workflow build
1 parent 9d8189e commit 61b63a7

File tree

4 files changed

+88
-2
lines changed

4 files changed

+88
-2
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@ jobs:
4545
- name: Analyze & test
4646
run: composer test -- -v --coverage-clover=coverage.xml
4747

48+
- name: Run PHPStan
49+
run: ./vendor/bin/phpstan
50+
4851
- name: Run codecov
4952
uses: codecov/codecov-action@v1

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"squizlabs/php_codesniffer": "^3.5",
3131
"softcreatr/jsonpath": "^0.7 || ^0.8",
3232
"phpspec/prophecy-phpunit": "^2.0",
33-
"phpstan/phpstan": "^1.9",
34-
"rector/rector": "^0.14.8"
33+
"rector/rector": "^0.14.8",
34+
"phpstan/phpstan": "^1.10"
3535
},
3636
"config": {
3737
"optimize-autoloader": true,

phpstan-baseline.neon

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Access to an undefined property Vonage\\\\Account\\\\Price\\:\\:\\$priceMethod\\.$#"
5+
count: 1
6+
path: src/Account/Price.php
7+
8+
-
9+
message: "#^Result of method Vonage\\\\Account\\\\Price\\:\\:getResponse\\(\\) \\(void\\) is used\\.$#"
10+
count: 1
11+
path: src/Account/Price.php
12+
13+
-
14+
message: "#^Access to an undefined property Vonage\\\\Application\\\\Application\\:\\:\\$data\\.$#"
15+
count: 1
16+
path: src/Application/Application.php
17+
18+
-
19+
message: "#^Call to an undefined method Vonage\\\\Application\\\\Client\\:\\:fromArray\\(\\)\\.$#"
20+
count: 1
21+
path: src/Application/Client.php
22+
23+
-
24+
message: "#^Instantiated class Http\\\\Adapter\\\\Guzzle6\\\\Client not found\\.$#"
25+
count: 1
26+
path: src/Client.php
27+
28+
-
29+
message: "#^Method Vonage\\\\Client\\:\\:setLogger\\(\\) should return Vonage\\\\Logger\\\\LoggerAwareInterface but return statement is missing\\.$#"
30+
count: 1
31+
path: src/Client.php
32+
33+
-
34+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
35+
count: 1
36+
path: src/Client/Callback/Callback.php
37+
38+
-
39+
message: "#^Access to an undefined property Vonage\\\\Client\\\\Exception\\\\Request\\:\\:\\$data\\.$#"
40+
count: 1
41+
path: src/Client/Exception/Request.php
42+
43+
-
44+
message: "#^Call to an undefined method \\$this\\(Vonage\\\\Client\\\\Exception\\\\Request\\)&Vonage\\\\Entity\\\\Hydrator\\\\ArrayHydrateInterface\\:\\:getResponseData\\(\\)\\.$#"
45+
count: 1
46+
path: src/Client/Exception/Request.php
47+
48+
-
49+
message: "#^Access to an undefined property Vonage\\\\Client\\\\Exception\\\\Server\\:\\:\\$data\\.$#"
50+
count: 1
51+
path: src/Client/Exception/Server.php
52+
53+
-
54+
message: "#^Call to an undefined method \\$this\\(Vonage\\\\Client\\\\Exception\\\\Server\\)&Vonage\\\\Entity\\\\Hydrator\\\\ArrayHydrateInterface\\:\\:getResponseData\\(\\)\\.$#"
55+
count: 1
56+
path: src/Client/Exception/Server.php
57+
58+
-
59+
message: "#^Result of method Vonage\\\\Network\\:\\:getResponse\\(\\) \\(void\\) is used\\.$#"
60+
count: 1
61+
path: src/Network.php
62+
63+
-
64+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
65+
count: 1
66+
path: src/Network/Number/Response.php
67+
68+
-
69+
message: "#^Result of method Vonage\\\\Numbers\\\\Number\\:\\:getResponse\\(\\) \\(void\\) is used\\.$#"
70+
count: 1
71+
path: src/Numbers/Number.php
72+
73+
-
74+
message: "#^Access to an undefined property Vonage\\\\Verify\\\\Verification\\:\\:\\$data\\.$#"
75+
count: 1
76+
path: src/Verify/Verification.php

phpstan.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
4+
parameters:
5+
level: 0
6+
paths:
7+
- src

0 commit comments

Comments
 (0)