Skip to content

Commit

Permalink
fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 7, 2023
1 parent d2393c5 commit 4bf9e88
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 82 deletions.
2 changes: 1 addition & 1 deletion Editor/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ public function upload($_ = null)
* date formatting string, or a required flag. The actual options available
* depend upon the validation function used.
*
* @return ($_ is null ? callable|string : $this) The validation method if no parameter is given.
* @return ($_ is null ? array[] : $this) The validation method if no parameter is given.
*/
public function validator($_ = null, $opts = null)
{
Expand Down
2 changes: 1 addition & 1 deletion Editor/Join.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function get($_ = null)
* link table.
* @param string $table Join table name, if using a link table
*
* @return ($parent is null ? Join : $this)
* @return ($parent is null ? array : $this)
*
* @deprecated 1.5 Please use the {@see Join->link()} method rather than this
* method now.
Expand Down
4 changes: 2 additions & 2 deletions Ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Ext
* If using PHP 5.4 or later, simply create a 'new' instance of the
* target class and chain methods as normal.
*
* @return \DataTables\Editor|\DataTables\Editor\Field|\DataTables\Editor\Join|\DataTables\Editor\Upload Instantiated class
* @return static Instantiated class
*/
public static function instantiate()
{
Expand All @@ -44,7 +44,7 @@ public static function instantiate()
* This method performs exactly the same actions as the 'instantiate'
* static method, but is simply shorter and easier to type!
*
* @return \DataTables\Editor|\DataTables\Editor\Field|\DataTables\Editor\Join|\DataTables\Editor\Upload class
* @return static class
*/
public static function inst()
{
Expand Down
86 changes: 8 additions & 78 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parameters:
path: Database/Driver/Db2Query.php

-
message: "#^Method DataTables\\\\Database\\\\Driver\\\\Db2Query\\:\\:connect\\(\\) should return DataTables\\\\Database\\\\Query but returns resource\\.$#"
message: "#^Method DataTables\\\\Database\\\\Driver\\\\Db2Query\\:\\:connect\\(\\) should return PDO but returns resource\\.$#"
count: 1
path: Database/Driver/Db2Query.php

Expand All @@ -26,7 +26,7 @@ parameters:
path: Database/Driver/Db2Result.php

-
message: "#^Method DataTables\\\\Database\\\\Driver\\\\FirebirdQuery\\:\\:connect\\(\\) should return DataTables\\\\Database\\\\Query but returns PDO\\.$#"
message: "#^Call to function is_array\\(\\) with non\\-empty\\-array\\<string\\> will always evaluate to true\\.$#"
count: 1
path: Database/Driver/FirebirdQuery.php

Expand All @@ -41,12 +41,12 @@ parameters:
path: Database/Driver/FirebirdResult.php

-
message: "#^Method DataTables\\\\Database\\\\Driver\\\\MysqlQuery\\:\\:connect\\(\\) should return DataTables\\\\Database\\\\Query but returns PDO\\.$#"
message: "#^Call to function is_array\\(\\) with non\\-empty\\-array\\<string\\> will always evaluate to true\\.$#"
count: 1
path: Database/Driver/MysqlQuery.php
path: Database/Driver/OracleQuery.php

-
message: "#^Method DataTables\\\\Database\\\\Driver\\\\OracleQuery\\:\\:connect\\(\\) should return DataTables\\\\Database\\\\Query but returns resource\\.$#"
message: "#^Method DataTables\\\\Database\\\\Driver\\\\OracleQuery\\:\\:connect\\(\\) should return PDO but returns resource\\.$#"
count: 1
path: Database/Driver/OracleQuery.php

Expand Down Expand Up @@ -80,11 +80,6 @@ parameters:
count: 1
path: Database/Driver/OracleResult.php

-
message: "#^Method DataTables\\\\Database\\\\Driver\\\\PostgresQuery\\:\\:connect\\(\\) should return DataTables\\\\Database\\\\Query but returns PDO\\.$#"
count: 1
path: Database/Driver/PostgresQuery.php

-
message: "#^Property DataTables\\\\Database\\\\Driver\\\\PostgresQuery\\:\\:\\$_identifier_limiter \\(string\\) does not accept default value of type array\\<int, string\\>\\.$#"
count: 1
Expand All @@ -95,16 +90,6 @@ parameters:
count: 1
path: Database/Driver/PostgresResult.php

-
message: "#^Method DataTables\\\\Database\\\\Driver\\\\SqliteQuery\\:\\:connect\\(\\) should return DataTables\\\\Database\\\\Query but returns PDO\\.$#"
count: 1
path: Database/Driver/SqliteQuery.php

-
message: "#^Method DataTables\\\\Database\\\\Driver\\\\SqlserverQuery\\:\\:connect\\(\\) should return DataTables\\\\Database\\\\Query but returns PDO\\.$#"
count: 1
path: Database/Driver/SqlserverQuery.php

-
message: "#^Property DataTables\\\\Database\\\\Driver\\\\SqlserverQuery\\:\\:\\$_identifier_limiter \\(string\\) does not accept default value of type array\\<int, string\\>\\.$#"
count: 1
Expand All @@ -116,7 +101,7 @@ parameters:
path: Database/Query.php

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

Expand Down Expand Up @@ -162,7 +147,7 @@ parameters:

-
message: "#^If condition is always true\\.$#"
count: 4
count: 3
path: Editor.php

-
Expand Down Expand Up @@ -245,11 +230,6 @@ parameters:
count: 1
path: Editor.php

-
message: "#^Property DataTables\\\\Editor\\:\\:\\$_validator \\(callable\\(\\)\\: mixed\\) does not accept default value of type array\\{\\}\\.$#"
count: 1
path: Editor.php

-
message: "#^Result of && is always false\\.$#"
count: 2
Expand All @@ -276,7 +256,7 @@ parameters:
path: Editor.php

-
message: "#^Strict comparison using \\=\\=\\= between \\(callable\\(\\)\\: mixed\\)\\|DataTables\\\\Editor\\\\Field\\|string and null will always evaluate to false\\.$#"
message: "#^Strict comparison using \\=\\=\\= between \\(callable\\(\\)\\: mixed\\)\\|string and null will always evaluate to false\\.$#"
count: 1
path: Editor.php

Expand All @@ -300,26 +280,6 @@ parameters:
count: 1
path: Editor.php

-
message: "#^Call to function is_callable\\(\\) with callable\\(\\)\\: mixed will always evaluate to true\\.$#"
count: 2
path: Editor/Field.php

-
message: "#^Cannot call method value\\(\\) on array\\<string\\>\\|DataTables\\\\Editor\\|DataTables\\\\Editor\\\\Join\\|string\\.$#"
count: 1
path: Editor/Field.php

-
message: "#^Method DataTables\\\\Editor\\\\Field\\:\\:options\\(\\) should return DataTables\\\\Editor\\\\Field but returns DataTables\\\\Editor\\\\Options\\|null\\.$#"
count: 1
path: Editor/Field.php

-
message: "#^Method DataTables\\\\Editor\\\\Field\\:\\:searchBuilderOptions\\(\\) should return DataTables\\\\Editor\\\\Field but returns DataTables\\\\Editor\\\\SearchBuilderOptions\\|null\\.$#"
count: 1
path: Editor/Field.php

-
message: "#^Method DataTables\\\\Editor\\\\Field\\:\\:searchBuilderOptionsExec\\(\\) has invalid return type DataTables\\\\Editor\\\\IOption\\.$#"
count: 1
Expand All @@ -335,11 +295,6 @@ parameters:
count: 1
path: Editor/Field.php

-
message: "#^Method DataTables\\\\Editor\\\\Field\\:\\:searchPaneOptions\\(\\) should return DataTables\\\\Editor\\\\Field but returns DataTables\\\\Editor\\\\SearchPaneOptions\\|null\\.$#"
count: 1
path: Editor/Field.php

-
message: "#^Method DataTables\\\\Editor\\\\Field\\:\\:xssSafety\\(\\) should return string but returns array\\<int, mixed\\>\\.$#"
count: 1
Expand Down Expand Up @@ -575,11 +530,6 @@ parameters:
count: 1
path: Editor/SearchBuilderOptions.php

-
message: "#^Method DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:label\\(\\) should return array\\<string\\>\\|DataTables\\\\Editor\\\\Options but returns \\$this\\(DataTables\\\\Editor\\\\SearchBuilderOptions\\)\\.$#"
count: 2
path: Editor/SearchBuilderOptions.php

-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
Expand Down Expand Up @@ -625,11 +575,6 @@ parameters:
count: 1
path: Editor/SearchPaneOptions.php

-
message: "#^Method DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:label\\(\\) should return array\\<string\\>\\|DataTables\\\\Editor\\\\Options but returns \\$this\\(DataTables\\\\Editor\\\\SearchPaneOptions\\)\\.$#"
count: 2
path: Editor/SearchPaneOptions.php

-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_order is never written, only read\\.$#"
count: 1
Expand Down Expand Up @@ -790,18 +735,3 @@ parameters:
count: 1
path: Editor/Validate.php

-
message: "#^Method DataTables\\\\Editor\\\\ValidateOptions\\:\\:__construct\\(\\) with return type void returns \\$this\\(DataTables\\\\Editor\\\\ValidateOptions\\) but should not return anything\\.$#"
count: 1
path: Editor/ValidateOptions.php

-
message: "#^Method DataTables\\\\Ext\\:\\:inst\\(\\) should return DataTables\\\\Editor\\|DataTables\\\\Editor\\\\Field\\|DataTables\\\\Editor\\\\Join\\|DataTables\\\\Editor\\\\Upload but returns static\\(DataTables\\\\Ext\\)\\.$#"
count: 1
path: Ext.php

-
message: "#^Method DataTables\\\\Ext\\:\\:instantiate\\(\\) should return DataTables\\\\Editor\\|DataTables\\\\Editor\\\\Field\\|DataTables\\\\Editor\\\\Join\\|DataTables\\\\Editor\\\\Upload but returns static\\(DataTables\\\\Ext\\)\\.$#"
count: 1
path: Ext.php

0 comments on commit 4bf9e88

Please sign in to comment.