Skip to content

Commit d747d10

Browse files
Merge pull request #24 from kamil-tekiela/modernization
Code refactoring and modernization
2 parents f342e4b + 67804b2 commit d747d10

File tree

7 files changed

+189
-423
lines changed

7 files changed

+189
-423
lines changed

phpcs.xml.dist

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"/>
1818
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification"/>
1919
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/>
20-
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint"/>
21-
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint"/>
2220
</rule>
2321

2422
<rule ref="SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition"/>

phpstan-baseline.neon

+3-103
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Parameter \\#1 \\$file of method PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:saveBBox\\(\\) expects resource, resource\\|null given\\.$#"
5-
count: 2
6-
path: src/ShapeFile.php
7-
8-
-
9-
message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#"
4+
message: "#^Cannot cast mixed to int\\.$#"
105
count: 1
116
path: src/ShapeFile.php
127

@@ -15,113 +10,18 @@ parameters:
1510
count: 1
1611
path: src/ShapeFile.php
1712

18-
-
19-
message: "#^Parameter \\#1 \\$stream of function feof expects resource, resource\\|null given\\.$#"
20-
count: 1
21-
path: src/ShapeFile.php
22-
23-
-
24-
message: "#^Parameter \\#1 \\$stream of function fread expects resource, resource\\|false given\\.$#"
25-
count: 1
26-
path: src/ShapeFile.php
27-
28-
-
29-
message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|null given\\.$#"
30-
count: 10
31-
path: src/ShapeFile.php
32-
33-
-
34-
message: "#^Parameter \\#1 \\$string of function strtoupper expects string, mixed given\\.$#"
35-
count: 1
36-
path: src/ShapeFile.php
37-
3813
-
3914
message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|false given\\.$#"
4015
count: 6
4116
path: src/ShapeFile.php
4217

4318
-
44-
message: "#^Parameter \\#1 \\$type of static method PhpMyAdmin\\\\ShapeFile\\\\Util\\:\\:nameShape\\(\\) expects int, int\\|false given\\.$#"
45-
count: 1
46-
path: src/ShapeFile.php
47-
48-
-
49-
message: "#^Parameter \\#2 \\$length of function fread expects int\\<0, max\\>, int given\\.$#"
19+
message: "#^Parameter \\#2 \\$shpFile of method PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:loadFromFile\\(\\) expects resource, resource\\|false given\\.$#"
5020
count: 1
5121
path: src/ShapeFile.php
5222

5323
-
54-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:\\$dbfFile \\(resource\\|null\\) does not accept resource\\|false\\.$#"
24+
message: "#^Cannot cast mixed to int\\.$#"
5525
count: 2
56-
path: src/ShapeFile.php
57-
58-
-
59-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:\\$shapeType \\(int\\|false\\) does not accept mixed\\.$#"
60-
count: 1
61-
path: src/ShapeFile.php
62-
63-
-
64-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:\\$shpFile \\(resource\\|null\\) does not accept resource\\|false\\.$#"
65-
count: 1
66-
path: src/ShapeFile.php
67-
68-
-
69-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:\\$shxFile \\(resource\\|null\\) does not accept resource\\|false\\.$#"
70-
count: 1
71-
path: src/ShapeFile.php
72-
73-
-
74-
message: "#^Result of && is always false\\.$#"
75-
count: 1
76-
path: src/ShapeFile.php
77-
78-
-
79-
message: "#^Result of \\|\\| is always false\\.$#"
80-
count: 1
81-
path: src/ShapeFile.php
82-
83-
-
84-
message: "#^Strict comparison using \\=\\=\\= between int and '' will always evaluate to false\\.$#"
85-
count: 1
86-
path: src/ShapeFile.php
87-
88-
-
89-
message: "#^Strict comparison using \\=\\=\\= between int and false will always evaluate to false\\.$#"
90-
count: 1
91-
path: src/ShapeFile.php
92-
93-
-
94-
message: "#^Parameter \\#2 \\$record_number of function dbase_get_record_with_names expects int, int\\|null given\\.$#"
95-
count: 1
96-
path: src/ShapeRecord.php
97-
98-
-
99-
message: "#^Parameter \\#3 \\$record_number of function dbase_replace_record expects int, int\\|null given\\.$#"
100-
count: 1
101-
path: src/ShapeRecord.php
102-
103-
-
104-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$dbfFile \\(resource\\) in isset\\(\\) is not nullable\\.$#"
105-
count: 1
106-
path: src/ShapeRecord.php
107-
108-
-
109-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$recordNumber \\(int\\|null\\) does not accept mixed\\.$#"
110-
count: 1
111-
path: src/ShapeRecord.php
112-
113-
-
114-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$shapeType \\(int\\) does not accept false\\.$#"
115-
count: 1
116-
path: src/ShapeRecord.php
117-
118-
-
119-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$shapeType \\(int\\) does not accept mixed\\.$#"
120-
count: 1
121-
path: src/ShapeRecord.php
122-
123-
-
124-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$size \\(int\\) does not accept mixed\\.$#"
125-
count: 1
12626
path: src/ShapeRecord.php
12727

0 commit comments

Comments
 (0)