diff --git a/libraries/classes/InsertEdit.php b/libraries/classes/InsertEdit.php index 8572a97fbe..5db59c5166 100644 --- a/libraries/classes/InsertEdit.php +++ b/libraries/classes/InsertEdit.php @@ -132,26 +132,6 @@ class InsertEdit return $formParams; } - /** - * Creates array of where clauses - * - * @param string[]|string|null $whereClause where clause - * - * @return string[] whereClauseArray array of where clauses - */ - private function getWhereClauseArray(array|string|null $whereClause): array - { - if ($whereClause === null) { - return []; - } - - if (is_array($whereClause)) { - return $whereClause; - } - - return [$whereClause]; - } - /** * Analysing where clauses array * @@ -1757,7 +1737,7 @@ class InsertEdit if (isset($whereClause)) { // we are editing $insertMode = false; - $whereClauseArray = $this->getWhereClauseArray($whereClause); + $whereClauseArray = (array) $whereClause; [$whereClauses, $result, $rows, $foundUniqueKey] = $this->analyzeWhereClauses( $whereClauseArray, $table, diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 1371fb7330..d7995ad5a5 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -7981,7 +7981,6 @@ $whereClause $whereClause $whereClause - $whereClause @@ -7991,6 +7990,7 @@ $thisUrlParams $urlParams $valueSets + $whereClauseArray @@ -8093,7 +8093,6 @@ $whereClause - $whereClause diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index d167bae171..f1440aaa7e 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -181,42 +181,6 @@ class InsertEditTest extends AbstractTestCase ); } - /** - * Test for getWhereClauseArray - */ - public function testGetWhereClauseArray(): void - { - $this->assertEquals( - [], - $this->callFunction( - $this->insertEdit, - InsertEdit::class, - 'getWhereClauseArray', - [null], - ), - ); - - $this->assertEquals( - [1, 2, 3], - $this->callFunction( - $this->insertEdit, - InsertEdit::class, - 'getWhereClauseArray', - [[1, 2, 3]], - ), - ); - - $this->assertEquals( - ['clause'], - $this->callFunction( - $this->insertEdit, - InsertEdit::class, - 'getWhereClauseArray', - ['clause'], - ), - ); - } - /** * Test for analyzeWhereClauses */