Skip to content

Fix Psalm

Fix Psalm #237

Triggered via pull request September 28, 2023 07:35
Status Failure
Total duration 6m 41s
Artifacts

mutation.yml

on: pull_request
Matrix: mutation / roave-infection
Fit to window
Zoom out
Zoom in

Annotations

1 error and 6 warnings
mutation / PHP 8.1-ubuntu-latest
Process completed with exit code 1.
mutation / PHP 8.1-ubuntu-latest: src/AssignmentsStorage.php#L103
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ public function get(string $itemName, string $userId) : ?Assignment { /** @psalm-var RawAssignment|null $row */ - $row = (new Query($this->database))->select(['createdAt'])->from($this->tableName)->where(['itemName' => $itemName, 'userId' => $userId])->one(); + $row = (new Query($this->database))->select([])->from($this->tableName)->where(['itemName' => $itemName, 'userId' => $userId])->one(); return $row === null ? null : new Assignment($userId, $itemName, (int) $row['createdAt']); } public function exists(string $itemName, string $userId) : bool
mutation / PHP 8.1-ubuntu-latest: src/AssignmentsStorage.php#L105
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ public function get(string $itemName, string $userId) : ?Assignment { /** @psalm-var RawAssignment|null $row */ - $row = (new Query($this->database))->select(['createdAt'])->from($this->tableName)->where(['itemName' => $itemName, 'userId' => $userId])->one(); + $row = (new Query($this->database))->select(['createdAt'])->from($this->tableName)->where(['userId' => $userId])->one(); return $row === null ? null : new Assignment($userId, $itemName, (int) $row['createdAt']); } public function exists(string $itemName, string $userId) : bool
mutation / PHP 8.1-ubuntu-latest: src/AssignmentsStorage.php#L178
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function removeByUserId(string $userId) : void { - $this->database->createCommand()->delete($this->tableName, ['userId' => $userId])->execute(); + $this->database->createCommand()->delete($this->tableName, [])->execute(); } public function removeByItemName(string $itemName) : void {
mutation / PHP 8.1-ubuntu-latest: src/AssignmentsStorage.php#L184
Escaped Mutant for Mutator "MethodCallRemoval": --- Original +++ New @@ @@ } public function removeByItemName(string $itemName) : void { - $this->database->createCommand()->delete($this->tableName, ['itemName' => $itemName])->execute(); + } public function clear() : void {
mutation / PHP 8.1-ubuntu-latest: src/AssignmentsStorage.php#L187
Escaped Mutant for Mutator "ArrayItemRemoval": --- Original +++ New @@ @@ } public function removeByItemName(string $itemName) : void { - $this->database->createCommand()->delete($this->tableName, ['itemName' => $itemName])->execute(); + $this->database->createCommand()->delete($this->tableName, [])->execute(); } public function clear() : void {
mutation / PHP 8.1-ubuntu-latest: src/ItemTreeTraversal/CteItemTreeTraversal.php#L128
Escaped Mutant for Mutator "TrueValue": --- Original +++ New @@ @@ $cteParameterName = 'parent_name'; } $cteSelectRelationQuery = (new Query($this->database))->select($cteSelectRelationName)->from(['item_child_recursive' => $this->childrenTableName])->innerJoin($cteName, ["item_child_recursive.{$cteConditionRelationName}" => new Expression("{{{$cteName}}}.[[{$cteParameterName}]]")]); - $cteSelectItemQuery = (new Query($this->database))->select('name')->from($this->tableName)->where(['name' => $name])->union($cteSelectRelationQuery, all: true); + $cteSelectItemQuery = (new Query($this->database))->select('name')->from($this->tableName)->where(['name' => $name])->union($cteSelectRelationQuery, all: false); $quoter = $this->database->getQuoter(); $outerQuery = $baseOuterQuery->withQuery($cteSelectItemQuery, $quoter->quoteTableName($cteName) . '(' . $quoter->quoteColumnName($cteParameterName) . ')', recursive: $this->useRecursiveInWith)->from($cteName)->leftJoin(['item' => $this->tableName], ['item.name' => new Expression("{{{$cteName}}}.[[{$cteParameterName}]]")]); return $outerQuery->createCommand(); } }