context) === []) { return $description; } renderUsing(self::$output); [ 'assignees' => $assignees, 'issues' => $issues, 'prs' => $prs, ] = $context; if (($link = Project::getInstance()->issues) !== '') { $issuesDescription = array_map(fn (int $issue): string => sprintf('#%s', sprintf($link, $issue), $issue), $issues); } if (($link = Project::getInstance()->prs) !== '') { $prsDescription = array_map(fn (int $pr): string => sprintf('#%s', sprintf($link, $pr), $pr), $prs); } if (($link = Project::getInstance()->assignees) !== '' && count($assignees) > 0) { $assigneesDescription = array_map(fn (string $assignee): string => sprintf( '@%s', sprintf($link, $assignee), $assignee, ), $assignees); } if (count($assignees) > 0 || count($issues) > 0 || count($prs) > 0) { $description .= ' '.implode(', ', array_merge( $issuesDescription ?? [], $prsDescription ?? [], isset($assigneesDescription) ? ['['.implode(', ', $assigneesDescription).']'] : [], )); } return $description; } /** * Fires after the test method description is printed. */ public static function afterTestMethodDescription(TestResult $result): void { if (($context = $result->context) === []) { return; } renderUsing(self::$output); [ 'notes' => $notes, ] = $context; foreach ($notes as $note) { render(sprintf(<<<'HTML'
// %s
HTML, $note, )); } } }