Skip to content

Commit 1c6b03d

Browse files
authored
Merge pull request #315 from gersonfs/atualizacao-php
Adicionando suporte a PHP 8.3 e 8.4
2 parents 28fff42 + 898d9b1 commit 1c6b03d

17 files changed

+295
-27
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
php-version: ['7.4', '8.0', '8.1', '8.2']
19+
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
2020

2121
steps:
2222
- name: Setup PHP
@@ -55,6 +55,16 @@ jobs:
5555
run: |
5656
composer stan82
5757
58+
- name: Análises estáticas PHP 8.3
59+
if: matrix.php-version == '8.3'
60+
run: |
61+
composer stan83
62+
63+
- name: Análises estáticas PHP 8.4
64+
if: matrix.php-version == '8.4'
65+
run: |
66+
composer stan84
67+
5868
- name: Rodando PHPUnit
5969
run: |
6070
composer test

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
"stan": "phpstan analyse src/",
7171
"stan80": "phpstan analyse src/ -c phpstan80.neon",
7272
"stan81": "phpstan analyse src/ -c phpstan81.neon",
73-
"stan82": "phpstan analyse src/ -c phpstan82.neon"
73+
"stan82": "phpstan analyse src/ -c phpstan82.neon",
74+
"stan83": "phpstan analyse src/ -c phpstan83.neon",
75+
"stan84": "phpstan analyse src/ -c phpstan84.neon"
7476
}
7577
}

phpstan-baseline83.neon

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
5+
count: 1
6+
path: src/Certificate.php
7+
8+
-
9+
message: "#^Binary operation \"\\*\" between 40 and string results in an error\\.$#"
10+
count: 1
11+
path: src/Certificate/Asn1.php
12+
13+
-
14+
message: "#^Parameter \\#2 \\$qIn of static method NFePHP\\\\Common\\\\Certificate\\\\Asn1\\:\\:xBase128\\(\\) expects int, float given\\.$#"
15+
count: 1
16+
path: src/Certificate/Asn1.php
17+
18+
-
19+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
20+
count: 1
21+
path: src/Certificate/PublicKey.php
22+
23+
-
24+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
25+
count: 5
26+
path: src/Exception/CertificateException.php
27+
28+
-
29+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
30+
count: 4
31+
path: src/Exception/SignerException.php
32+
33+
-
34+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
35+
count: 2
36+
path: src/Exception/SoapException.php
37+
38+
-
39+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
40+
count: 2
41+
path: src/Exception/ValidatorException.php
42+
43+
-
44+
message: "#^Method NFePHP\\\\Common\\\\Files\\:\\:listContents\\(\\) invoked with 2 parameters, 0\\-1 required\\.$#"
45+
count: 1
46+
path: src/Soap/SoapBase.php
47+
48+
-
49+
message: "#^Method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:randomName\\(\\) should return string but return statement is missing\\.$#"
50+
count: 1
51+
path: src/Soap/SoapBase.php
52+
53+
-
54+
message: "#^Method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:uid\\(\\) should return string but returns int\\.$#"
55+
count: 1
56+
path: src/Soap/SoapBase.php
57+
58+
-
59+
message: "#^Method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:uid\\(\\) should return string but returns int\\|false\\.$#"
60+
count: 1
61+
path: src/Soap/SoapBase.php
62+
63+
-
64+
message: "#^Parameter \\#8 \\$soapheader \\(null\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:send\\(\\) should be compatible with parameter \\$soapheader \\(SoapHeader\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapInterface\\:\\:send\\(\\)$#"
65+
count: 1
66+
path: src/Soap/SoapBase.php
67+
68+
-
69+
message: "#^Property NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:\\$filesystem \\(NFePHP\\\\Common\\\\Files\\) in empty\\(\\) is not falsy\\.$#"
70+
count: 2
71+
path: src/Soap/SoapBase.php
72+
73+
-
74+
message: "#^Parameter \\#5 \\$oneWay \\(int\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapClientExtended\\:\\:__doRequest\\(\\) should be compatible with parameter \\$oneWay \\(bool\\) of method SoapClient\\:\\:__doRequest\\(\\)$#"
75+
count: 1
76+
path: src/Soap/SoapClientExtended.php
77+
78+
-
79+
message: "#^Parameter \\#5 \\$oneWay of method SoapClient\\:\\:__doRequest\\(\\) expects bool, int given\\.$#"
80+
count: 1
81+
path: src/Soap/SoapClientExtended.php
82+
83+
-
84+
message: "#^Parameter \\#8 \\$soapheader \\(SoapHeader\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapCurl\\:\\:send\\(\\) should be compatible with parameter \\$soapheader \\(null\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:send\\(\\)$#"
85+
count: 1
86+
path: src/Soap/SoapCurl.php
87+
88+
-
89+
message: "#^Parameter \\#8 \\$soapheader \\(null\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapFake\\:\\:send\\(\\) should be compatible with parameter \\$soapheader \\(SoapHeader\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapInterface\\:\\:send\\(\\)$#"
90+
count: 1
91+
path: src/Soap/SoapFake.php
92+
93+
-
94+
message: "#^Parameter \\#8 \\$soapheader \\(SoapHeader\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapNative\\:\\:send\\(\\) should be compatible with parameter \\$soapheader \\(null\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:send\\(\\)$#"
95+
count: 1
96+
path: src/Soap/SoapNative.php
97+
98+
-
99+
message: "#^Static method NFePHP\\\\Common\\\\Exception\\\\SoapException\\:\\:soapFault\\(\\) invoked with 1 parameter, 2 required\\.$#"
100+
count: 4
101+
path: src/Soap/SoapNative.php
102+
103+
-
104+
message: "#^Access to an undefined property NFePHP\\\\Common\\\\Tags\\\\MakeBase\\:\\:\\$emit\\.$#"
105+
count: 1
106+
path: src/Tags/MakeBase.php
107+
108+
-
109+
message: "#^Access to an undefined property NFePHP\\\\Common\\\\Tags\\\\MakeBase\\:\\:\\$ide\\.$#"
110+
count: 9
111+
path: src/Tags/MakeBase.php
112+
113+
-
114+
message: "#^Access to an undefined property NFePHP\\\\Common\\\\Tags\\\\MakeBase\\:\\:\\$infnfe\\.$#"
115+
count: 2
116+
path: src/Tags/MakeBase.php
117+
118+
-
119+
message: "#^Parameter \\#2 \\$value of method NFePHP\\\\Common\\\\Tags\\\\MakeBase\\:\\:createProperty\\(\\) expects NFePHP\\\\Common\\\\Tags\\\\TagInterface, array given\\.$#"
120+
count: 1
121+
path: src/Tags/MakeBase.php
122+
123+
-
124+
message: "#^Undefined variable\\: \\$infId$#"
125+
count: 1
126+
path: src/Tags/MakeBase.php

phpstan-baseline84.neon

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
5+
count: 1
6+
path: src/Certificate.php
7+
8+
-
9+
message: "#^Binary operation \"\\*\" between 40 and string results in an error\\.$#"
10+
count: 1
11+
path: src/Certificate/Asn1.php
12+
13+
-
14+
message: "#^Parameter \\#2 \\$qIn of static method NFePHP\\\\Common\\\\Certificate\\\\Asn1\\:\\:xBase128\\(\\) expects int, float given\\.$#"
15+
count: 1
16+
path: src/Certificate/Asn1.php
17+
18+
-
19+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
20+
count: 1
21+
path: src/Certificate/PublicKey.php
22+
23+
-
24+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
25+
count: 5
26+
path: src/Exception/CertificateException.php
27+
28+
-
29+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
30+
count: 4
31+
path: src/Exception/SignerException.php
32+
33+
-
34+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
35+
count: 2
36+
path: src/Exception/SoapException.php
37+
38+
-
39+
message: "#^Unsafe usage of new static\\(\\)\\.$#"
40+
count: 2
41+
path: src/Exception/ValidatorException.php
42+
43+
-
44+
message: "#^Method NFePHP\\\\Common\\\\Files\\:\\:listContents\\(\\) invoked with 2 parameters, 0\\-1 required\\.$#"
45+
count: 1
46+
path: src/Soap/SoapBase.php
47+
48+
-
49+
message: "#^Method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:randomName\\(\\) should return string but return statement is missing\\.$#"
50+
count: 1
51+
path: src/Soap/SoapBase.php
52+
53+
-
54+
message: "#^Method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:uid\\(\\) should return string but returns int\\.$#"
55+
count: 1
56+
path: src/Soap/SoapBase.php
57+
58+
-
59+
message: "#^Method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:uid\\(\\) should return string but returns int\\|false\\.$#"
60+
count: 1
61+
path: src/Soap/SoapBase.php
62+
63+
-
64+
message: "#^Parameter \\#8 \\$soapheader \\(null\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:send\\(\\) should be compatible with parameter \\$soapheader \\(SoapHeader\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapInterface\\:\\:send\\(\\)$#"
65+
count: 1
66+
path: src/Soap/SoapBase.php
67+
68+
-
69+
message: "#^Property NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:\\$filesystem \\(NFePHP\\\\Common\\\\Files\\) in empty\\(\\) is not falsy\\.$#"
70+
count: 2
71+
path: src/Soap/SoapBase.php
72+
73+
-
74+
message: "#^Parameter \\#5 \\$oneWay \\(int\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapClientExtended\\:\\:__doRequest\\(\\) should be compatible with parameter \\$oneWay \\(bool\\) of method SoapClient\\:\\:__doRequest\\(\\)$#"
75+
count: 1
76+
path: src/Soap/SoapClientExtended.php
77+
78+
-
79+
message: "#^Parameter \\#5 \\$oneWay of method SoapClient\\:\\:__doRequest\\(\\) expects bool, int given\\.$#"
80+
count: 1
81+
path: src/Soap/SoapClientExtended.php
82+
83+
-
84+
message: "#^Parameter \\#8 \\$soapheader \\(SoapHeader\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapCurl\\:\\:send\\(\\) should be compatible with parameter \\$soapheader \\(null\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:send\\(\\)$#"
85+
count: 1
86+
path: src/Soap/SoapCurl.php
87+
88+
-
89+
message: "#^Parameter \\#8 \\$soapheader \\(null\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapFake\\:\\:send\\(\\) should be compatible with parameter \\$soapheader \\(SoapHeader\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapInterface\\:\\:send\\(\\)$#"
90+
count: 1
91+
path: src/Soap/SoapFake.php
92+
93+
-
94+
message: "#^Parameter \\#8 \\$soapheader \\(SoapHeader\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapNative\\:\\:send\\(\\) should be compatible with parameter \\$soapheader \\(null\\) of method NFePHP\\\\Common\\\\Soap\\\\SoapBase\\:\\:send\\(\\)$#"
95+
count: 1
96+
path: src/Soap/SoapNative.php
97+
98+
-
99+
message: "#^Static method NFePHP\\\\Common\\\\Exception\\\\SoapException\\:\\:soapFault\\(\\) invoked with 1 parameter, 2 required\\.$#"
100+
count: 4
101+
path: src/Soap/SoapNative.php
102+
103+
-
104+
message: "#^Access to an undefined property NFePHP\\\\Common\\\\Tags\\\\MakeBase\\:\\:\\$emit\\.$#"
105+
count: 1
106+
path: src/Tags/MakeBase.php
107+
108+
-
109+
message: "#^Access to an undefined property NFePHP\\\\Common\\\\Tags\\\\MakeBase\\:\\:\\$ide\\.$#"
110+
count: 9
111+
path: src/Tags/MakeBase.php
112+
113+
-
114+
message: "#^Access to an undefined property NFePHP\\\\Common\\\\Tags\\\\MakeBase\\:\\:\\$infnfe\\.$#"
115+
count: 2
116+
path: src/Tags/MakeBase.php
117+
118+
-
119+
message: "#^Parameter \\#2 \\$value of method NFePHP\\\\Common\\\\Tags\\\\MakeBase\\:\\:createProperty\\(\\) expects NFePHP\\\\Common\\\\Tags\\\\TagInterface, array given\\.$#"
120+
count: 1
121+
path: src/Tags/MakeBase.php
122+
123+
-
124+
message: "#^Undefined variable\\: \\$infId$#"
125+
count: 1
126+
path: src/Tags/MakeBase.php

phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ includes:
33

44
parameters:
55
level: 5
6-
checkMissingIterableValueType: false
7-
checkGenericClassInNonGenericObjectType: false
86
treatPhpDocTypesAsCertain: false

phpstan80.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ includes:
33

44
parameters:
55
level: 5
6-
checkMissingIterableValueType: false
7-
checkGenericClassInNonGenericObjectType: false
86
treatPhpDocTypesAsCertain: false

phpstan81.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ includes:
33

44
parameters:
55
level: 5
6-
checkMissingIterableValueType: false
7-
checkGenericClassInNonGenericObjectType: false
86
treatPhpDocTypesAsCertain: false

phpstan82.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ includes:
33

44
parameters:
55
level: 5
6-
checkMissingIterableValueType: false
7-
checkGenericClassInNonGenericObjectType: false
86
treatPhpDocTypesAsCertain: false

phpstan83.neon

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

phpstan84.neon

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

0 commit comments

Comments
 (0)