Skip to content

Commit

Permalink
Dev: Update phpstan for PHP 8.4 and regen base line, fixing a couple …
Browse files Browse the repository at this point in the history
…of errors in Options for phpstan
  • Loading branch information
AllanJard committed Dec 23, 2024
1 parent 7900e10 commit 35625cf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 163 deletions.
4 changes: 2 additions & 2 deletions Editor/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Options extends Ext
/**
* Constructor.
*
* @param string $table As a string this is the database table name - see `->table()`. If given as a function, then it is passed to `->fn()` as a custom function.
* @param string|callable $table As a string this is the database table name - see `->table()`. If given as a function, then it is passed to `->fn()` as a custom function.
* @param string $value The database column name to use as the value for the options - see `->value()`
* @param string $label The database column name to use as the label for the options - see `->label()`.
*/
Expand Down Expand Up @@ -423,7 +423,7 @@ public function exec($db, $refresh, $search = null, $find = null)
for ($j = 0; $j < count($this->_includes); ++$j) {
$inc = $this->_includes[$j];

if (isset($rows[$i][$inc])) {
if (isset($options[$i][$inc])) {
$option[$inc] = $options[$i][$inc];
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "~3.41.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "~1.10.47",
"phpstan/phpstan": "~1.11",
"phpstan/phpstan-deprecation-rules": "^1.0"
},
"autoload": {
Expand Down
160 changes: 0 additions & 160 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ parameters:
count: 1
path: Database/Driver/PostgresResult.php

-
message: "#^Method DataTables\\\\Database\\\\Query\\:\\:_where_group\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: Database/Query.php

-
message: "#^Method DataTables\\\\Database\\\\Query\\:\\:connect\\(\\) should return PDO but return statement is missing\\.$#"
count: 1
Expand Down Expand Up @@ -120,16 +115,6 @@ parameters:
count: 1
path: Editor.php

-
message: "#^Parameter \\#3 \\$pkey of method DataTables\\\\Editor\\:\\:_remove_table\\(\\) expects string\\|null, array\\<int, mixed\\> given\\.$#"
count: 1
path: Editor.php

-
message: "#^Property DataTables\\\\Editor\\:\\:\\$_db is never written, only read\\.$#"
count: 1
path: Editor.php

-
message: "#^Property DataTables\\\\Editor\\:\\:\\$_formData is never read, only written\\.$#"
count: 1
Expand All @@ -140,11 +125,6 @@ parameters:
count: 1
path: Editor.php

-
message: "#^Strict comparison using \\!\\=\\= between array and null will always evaluate to true\\.$#"
count: 1
path: Editor.php

-
message: "#^Strict comparison using \\!\\=\\= between string and null will always evaluate to true\\.$#"
count: 1
Expand Down Expand Up @@ -180,31 +160,6 @@ parameters:
count: 1
path: Editor/Field.php

-
message: "#^Property DataTables\\\\Editor\\\\Field\\:\\:\\$_getFormatter is never written, only read\\.$#"
count: 1
path: Editor/Field.php

-
message: "#^Property DataTables\\\\Editor\\\\Field\\:\\:\\$_getValue is never written, only read\\.$#"
count: 1
path: Editor/Field.php

-
message: "#^Property DataTables\\\\Editor\\\\Field\\:\\:\\$_setFormatter is never written, only read\\.$#"
count: 1
path: Editor/Field.php

-
message: "#^Property DataTables\\\\Editor\\\\Field\\:\\:\\$_setValue is never written, only read\\.$#"
count: 1
path: Editor/Field.php

-
message: "#^Property DataTables\\\\Editor\\\\Field\\:\\:\\$_upload is never written, only read\\.$#"
count: 1
path: Editor/Field.php

-
message: "#^Strict comparison using \\=\\=\\= between \\(callable\\(mixed\\)\\: string\\)\\|false and true will always evaluate to false\\.$#"
count: 1
Expand Down Expand Up @@ -295,26 +250,6 @@ parameters:
count: 1
path: Editor/Join.php

-
message: "#^Parameter \\#3 \\$data of method DataTables\\\\Editor\\\\Join\\:\\:_validateFields\\(\\) expects array\\<string\\>, string given\\.$#"
count: 1
path: Editor/Join.php

-
message: "#^Property DataTables\\\\Editor\\\\Join\\:\\:\\$_customOrder is never written, only read\\.$#"
count: 1
path: Editor/Join.php

-
message: "#^Property DataTables\\\\Editor\\\\Join\\:\\:\\$_table is never written, only read\\.$#"
count: 1
path: Editor/Join.php

-
message: "#^Property DataTables\\\\Editor\\\\Join\\:\\:\\$_type is never written, only read\\.$#"
count: 1
path: Editor/Join.php

-
message: "#^Variable \\$readField might not be defined\\.$#"
count: 2
Expand All @@ -325,41 +260,6 @@ parameters:
count: 1
path: Editor/Options.php

-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_customFn is never written, only read\\.$#"
count: 1
path: Editor/Options.php

-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_limit is never written, only read\\.$#"
count: 1
path: Editor/Options.php

-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_renderer is never written, only read\\.$#"
count: 1
path: Editor/Options.php

-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_table is never written, only read\\.$#"
count: 1
path: Editor/Options.php

-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_value is never written, only read\\.$#"
count: 1
path: Editor/Options.php

-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_where is never written, only read\\.$#"
count: 1
path: Editor/Options.php

-
message: "#^Cannot call method where\\(\\) on string\\.$#"
count: 1
path: Editor/SearchBuilderOptions.php

-
message: "#^Method DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:_get_where\\(\\) is unused\\.$#"
count: 1
Expand All @@ -370,71 +270,16 @@ parameters:
count: 1
path: Editor/SearchBuilderOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:\\$_order is never written, only read\\.$#"
count: 1
path: Editor/SearchBuilderOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:\\$_renderer is never written, only read\\.$#"
count: 1
path: Editor/SearchBuilderOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:\\$_table is never written, only read\\.$#"
count: 1
path: Editor/SearchBuilderOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:\\$_value is never written, only read\\.$#"
count: 1
path: Editor/SearchBuilderOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:\\$_where is never written, only read\\.$#"
count: 1
path: Editor/SearchBuilderOptions.php

-
message: "#^Strict comparison using \\=\\=\\= between 'array' and 'array' will always evaluate to true\\.$#"
count: 1
path: Editor/SearchBuilderOptions.php

-
message: "#^Cannot call method where\\(\\) on string\\.$#"
count: 1
path: Editor/SearchPaneOptions.php

-
message: "#^Method DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:_get_where\\(\\) is unused\\.$#"
count: 1
path: Editor/SearchPaneOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_order is never written, only read\\.$#"
count: 1
path: Editor/SearchPaneOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_renderer is never written, only read\\.$#"
count: 1
path: Editor/SearchPaneOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_table is never written, only read\\.$#"
count: 1
path: Editor/SearchPaneOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_value is never written, only read\\.$#"
count: 1
path: Editor/SearchPaneOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_where is never written, only read\\.$#"
count: 1
path: Editor/SearchPaneOptions.php

-
message: "#^Strict comparison using \\=\\=\\= between 'array' and 'array' will always evaluate to true\\.$#"
count: 1
Expand All @@ -455,11 +300,6 @@ parameters:
count: 1
path: Editor/Upload.php

-
message: "#^Method DataTables\\\\Editor\\\\Upload\\:\\:data\\(\\) should return array but returns null\\.$#"
count: 1
path: Editor/Upload.php

-
message: "#^Method DataTables\\\\Editor\\\\Upload\\:\\:exec\\(\\) should return int but returns false\\.$#"
count: 4
Expand Down

0 comments on commit 35625cf

Please sign in to comment.