Skip to content

Commit

Permalink
Dev: Tweaks for PHPStan
Browse files Browse the repository at this point in the history
It is frustrating that it can't see the write on null default properties
which are _getSet(), but psr12 means that you can't initialise a
property with `null` (which would remove the error) since properties are
null by default!
  • Loading branch information
AllanJard committed Nov 13, 2024
1 parent 2cc648d commit a70aff1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Editor/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public function where($_ = null)
*
* @internal
*/
public function exec($db, $refresh, $search = null)
public function exec($db, $refresh, $search=null)
{
// If search only, and not a search action, then just return false
if ($this->searchOnly() && !$search) {
Expand Down
10 changes: 10 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ parameters:
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 @@ -320,6 +325,11 @@ 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
Expand Down

0 comments on commit a70aff1

Please sign in to comment.