From c45935d4a6435d880fe719ae22594b902445b670 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Wed, 13 Sep 2023 16:21:06 +0200 Subject: [PATCH] Drop ignore error pattern matching `Model::getKeyName()` & `Model::getColumns()` methods --- .../Model/Behavior/ExpressionInjector.php | 5 +- phpstan-baseline.neon | 90 ------------------- 2 files changed, 4 insertions(+), 91 deletions(-) diff --git a/library/X509/Model/Behavior/ExpressionInjector.php b/library/X509/Model/Behavior/ExpressionInjector.php index afb8049f..c3fa2cbe 100644 --- a/library/X509/Model/Behavior/ExpressionInjector.php +++ b/library/X509/Model/Behavior/ExpressionInjector.php @@ -7,6 +7,7 @@ use ipl\Orm\Contract\QueryAwareBehavior; use ipl\Orm\Contract\RewriteFilterBehavior; use ipl\Orm\Query; +use ipl\Sql\ExpressionInterface; use ipl\Stdlib\Filter; /** @@ -44,7 +45,9 @@ public function rewriteCondition(Filter\Condition $condition, $relation = null) $subject = $this->query->getModel(); } - $expression = clone $subject->getColumns()[$columnName]; + /** @var ExpressionInterface $column */ + $column = $subject->getColumns()[$columnName]; + $expression = clone $column; $expression->setColumns($this->query->getResolver()->qualifyColumns( $this->query->getResolver()->requireAndResolveColumns( $expression->getColumns(), diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ea7f1157..028c8b07 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1050,16 +1050,6 @@ parameters: count: 1 path: library/X509/Model/X509Certificate.php - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Certificate\\:\\:getColumns\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509Certificate.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Certificate\\:\\:getKeyName\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509Certificate.php - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Certificate\\:\\:getSearchColumns\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -1075,16 +1065,6 @@ parameters: count: 1 path: library/X509/Model/X509CertificateChain.php - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509CertificateChain\\:\\:getColumns\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509CertificateChain.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509CertificateChain\\:\\:getKeyName\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509CertificateChain.php - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509CertificateChainLink\\:\\:createBehaviors\\(\\) has no return type specified\\.$#" count: 1 @@ -1095,16 +1075,6 @@ parameters: count: 1 path: library/X509/Model/X509CertificateChainLink.php - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509CertificateChainLink\\:\\:getColumns\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509CertificateChainLink.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509CertificateChainLink\\:\\:getKeyName\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509CertificateChainLink.php - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509CertificateSubjectAltName\\:\\:createBehaviors\\(\\) has no return type specified\\.$#" count: 1 @@ -1115,16 +1085,6 @@ parameters: count: 1 path: library/X509/Model/X509CertificateSubjectAltName.php - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509CertificateSubjectAltName\\:\\:getColumns\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509CertificateSubjectAltName.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509CertificateSubjectAltName\\:\\:getKeyName\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509CertificateSubjectAltName.php - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Dn\\:\\:createBehaviors\\(\\) has no return type specified\\.$#" count: 1 @@ -1135,46 +1095,6 @@ parameters: count: 1 path: library/X509/Model/X509Dn.php - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Dn\\:\\:getColumns\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509Dn.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Dn\\:\\:getKeyName\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509Dn.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Job\\:\\:getColumns\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509Job.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Job\\:\\:getKeyName\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509Job.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509JobRun\\:\\:getColumns\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509JobRun.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509JobRun\\:\\:getKeyName\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509JobRun.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Schedule\\:\\:getColumns\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509Schedule.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Schedule\\:\\:getKeyName\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509Schedule.php - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Target\\:\\:createBehaviors\\(\\) has no return type specified\\.$#" count: 1 @@ -1190,16 +1110,6 @@ parameters: count: 1 path: library/X509/Model/X509Target.php - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Target\\:\\:getColumns\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509Target.php - - - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Target\\:\\:getKeyName\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: library/X509/Model/X509Target.php - - message: "#^Method Icinga\\\\Module\\\\X509\\\\Model\\\\X509Target\\:\\:getSearchColumns\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1