Skip to content

Commit

Permalink
Merge pull request #24 from kamil-tekiela/modernization
Browse files Browse the repository at this point in the history
Code refactoring and modernization
  • Loading branch information
MauricioFauth authored Sep 12, 2023
2 parents f342e4b + 67804b2 commit d747d10
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 423 deletions.
2 changes: 0 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"/>
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification"/>
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/>
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint"/>
</rule>

<rule ref="SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition"/>
Expand Down
106 changes: 3 additions & 103 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$file of method PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:saveBBox\\(\\) expects resource, resource\\|null given\\.$#"
count: 2
path: src/ShapeFile.php

-
message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#"
message: "#^Cannot cast mixed to int\\.$#"
count: 1
path: src/ShapeFile.php

Expand All @@ -15,113 +10,18 @@ parameters:
count: 1
path: src/ShapeFile.php

-
message: "#^Parameter \\#1 \\$stream of function feof expects resource, resource\\|null given\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Parameter \\#1 \\$stream of function fread expects resource, resource\\|false given\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|null given\\.$#"
count: 10
path: src/ShapeFile.php

-
message: "#^Parameter \\#1 \\$string of function strtoupper expects string, mixed given\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|false given\\.$#"
count: 6
path: src/ShapeFile.php

-
message: "#^Parameter \\#1 \\$type of static method PhpMyAdmin\\\\ShapeFile\\\\Util\\:\\:nameShape\\(\\) expects int, int\\|false given\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Parameter \\#2 \\$length of function fread expects int\\<0, max\\>, int given\\.$#"
message: "#^Parameter \\#2 \\$shpFile of method PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:loadFromFile\\(\\) expects resource, resource\\|false given\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:\\$dbfFile \\(resource\\|null\\) does not accept resource\\|false\\.$#"
message: "#^Cannot cast mixed to int\\.$#"
count: 2
path: src/ShapeFile.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:\\$shapeType \\(int\\|false\\) does not accept mixed\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:\\$shpFile \\(resource\\|null\\) does not accept resource\\|false\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:\\$shxFile \\(resource\\|null\\) does not accept resource\\|false\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Result of && is always false\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Result of \\|\\| is always false\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Strict comparison using \\=\\=\\= between int and '' will always evaluate to false\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Strict comparison using \\=\\=\\= between int and false will always evaluate to false\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Parameter \\#2 \\$record_number of function dbase_get_record_with_names expects int, int\\|null given\\.$#"
count: 1
path: src/ShapeRecord.php

-
message: "#^Parameter \\#3 \\$record_number of function dbase_replace_record expects int, int\\|null given\\.$#"
count: 1
path: src/ShapeRecord.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$dbfFile \\(resource\\) in isset\\(\\) is not nullable\\.$#"
count: 1
path: src/ShapeRecord.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$recordNumber \\(int\\|null\\) does not accept mixed\\.$#"
count: 1
path: src/ShapeRecord.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$shapeType \\(int\\) does not accept false\\.$#"
count: 1
path: src/ShapeRecord.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$shapeType \\(int\\) does not accept mixed\\.$#"
count: 1
path: src/ShapeRecord.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$size \\(int\\) does not accept mixed\\.$#"
count: 1
path: src/ShapeRecord.php

Loading

0 comments on commit d747d10

Please sign in to comment.