From a70aff1fda8f09f3d694b09ae4cb1eac8170c277 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Wed, 13 Nov 2024 10:03:45 +0000 Subject: [PATCH] Dev: Tweaks for PHPStan 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! --- Editor/Options.php | 2 +- phpstan-baseline.neon | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Editor/Options.php b/Editor/Options.php index 37768d1..95ed201 100644 --- a/Editor/Options.php +++ b/Editor/Options.php @@ -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) { diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f8c8755..d8fa29c 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -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 @@ -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