diff --git a/src/Subscriber/MismatchBranchDescriptionSubscriber.php b/src/Subscriber/MismatchBranchDescriptionSubscriber.php index c4aec69..43161a0 100644 --- a/src/Subscriber/MismatchBranchDescriptionSubscriber.php +++ b/src/Subscriber/MismatchBranchDescriptionSubscriber.php @@ -83,7 +83,7 @@ private function extractDescriptionBranchFromBody(string $body): ?string $rowDescriptionBranch = $rowsDescriptionBranch[0]; // row matching - $descriptionBranchParts = \explode('|', (string) $rowDescriptionBranch); + $descriptionBranchParts = \explode('|', $rowDescriptionBranch); if (false === array_key_exists(2, $descriptionBranchParts)) { // Branch description is in second Markdown table column return null; } diff --git a/src/Subscriber/StatusChangeByReviewSubscriber.php b/src/Subscriber/StatusChangeByReviewSubscriber.php index ad5003b..6769150 100644 --- a/src/Subscriber/StatusChangeByReviewSubscriber.php +++ b/src/Subscriber/StatusChangeByReviewSubscriber.php @@ -38,7 +38,7 @@ public function onReview(GitHubEvent $event): void $newStatus = null; // Set status based on review state - $newStatus = match (strtolower((string) $data['review']['state'])) { + $newStatus = match (strtolower($data['review']['state'])) { 'approved' => Status::REVIEWED, 'changes_requested' => Status::NEEDS_WORK, default => $this->parseStatusFromText($data['review']['body']), diff --git a/tests/Controller/WebhookControllerTest.php b/tests/Controller/WebhookControllerTest.php index 6d50fa7..e93d223 100644 --- a/tests/Controller/WebhookControllerTest.php +++ b/tests/Controller/WebhookControllerTest.php @@ -49,14 +49,14 @@ public function testIssueComment($eventHeader, $payloadFilename, $expectedRespon $client->request('POST', '/webhooks/github', [], [], ['HTTP_X-Github-Event' => $eventHeader], $body); $response = $client->getResponse(); - $responseData = json_decode((string) $response->getContent(), true); + $responseData = json_decode($response->getContent(), true); $this->assertResponseIsSuccessful($responseData['error'] ?? 'An error occurred.'); // a weak sanity check that we went down "the right path" in the controller $this->assertSame($expectedResponse, $responseData); } - public function getTests() + public function getTests(): array { return [ 'On issue commented' => [