Skip to content

Commit

Permalink
Update phpstan to 1.x
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Jun 29, 2023
1 parent 648a16e commit 16cb2b8
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 20 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"ext-dbase": "For dbf files parsing"
},
"require-dev": {
"phpstan/phpstan": "^0.12.37",
"phpstan/phpstan": "^1.10",
"phpmyadmin/coding-standard": "^3.0.0",
"phpstan/phpstan-phpunit": "^0.12.6",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^7.4 || ^8 || ^9"
},
"autoload": {
Expand Down
71 changes: 53 additions & 18 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$fp of function feof expects resource, resource\\|false given\\.$#"
message: "#^Parameter \\#1 \\$file of method PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:saveBBox\\(\\) expects resource, resource\\|null given\\.$#"
count: 2
path: src/ShapeFile.php

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

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

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

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

Expand All @@ -26,27 +31,32 @@ parameters:
path: src/ShapeFile.php

-
message: "#^Parameter \\#1 \\$file of method PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:saveBBox\\(\\) expects resource, resource\\|null given\\.$#"
count: 2
message: "#^Parameter \\#1 \\$str of function strtoupper expects string, mixed given\\.$#"
count: 1
path: src/ShapeFile.php

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

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

-
message: "#^Strict comparison using \\=\\=\\= between int and '' will always evaluate to false\\.$#"
message: "#^Parameter \\#2 \\$length of function fread expects int\\<0, max\\>, int given\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Strict comparison using \\=\\=\\= between int and false will always evaluate to false\\.$#"
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:\\$dbfFile \\(resource\\|null\\) does not accept resource\\|false\\.$#"
count: 2
path: src/ShapeFile.php

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

Expand All @@ -61,24 +71,24 @@ parameters:
path: src/ShapeFile.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeFile\\:\\:\\$dbfFile \\(resource\\|null\\) does not accept resource\\|false\\.$#"
count: 2
message: "#^Result of && is always false\\.$#"
count: 1
path: src/ShapeFile.php

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

-
message: "#^Parameter \\#1 \\$type of static method PhpMyAdmin\\\\ShapeFile\\\\Util\\:\\:nameShape\\(\\) expects int, int\\|false given\\.$#"
message: "#^Strict comparison using \\=\\=\\= between int and '' will always evaluate to false\\.$#"
count: 1
path: src/ShapeFile.php

-
message: "#^Property PhpMyAdmin\\\\ShapeFile\\\\ShapeRecord\\:\\:\\$shapeType \\(int\\) does not accept false\\.$#"
message: "#^Strict comparison using \\=\\=\\= between int and false will always evaluate to false\\.$#"
count: 1
path: src/ShapeRecord.php
path: src/ShapeFile.php

-
message: "#^Parameter \\#2 \\$record_number of function dbase_get_record_with_names expects int, int\\|null given\\.$#"
Expand All @@ -90,3 +100,28 @@ parameters:
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

0 comments on commit 16cb2b8

Please sign in to comment.