Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark committed Sep 17, 2024
1 parent 0b2a452 commit 42e8f60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Subscriber/MismatchBranchDescriptionSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Subscriber/StatusChangeByReviewSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
Expand Down
4 changes: 2 additions & 2 deletions tests/Controller/WebhookControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down

0 comments on commit 42e8f60

Please sign in to comment.