From 14048dd5aedc313cc2fc54cabdf087cd4ef6c5a3 Mon Sep 17 00:00:00 2001 From: Marc Reichel Date: Wed, 17 Jan 2024 08:41:40 +0100 Subject: [PATCH] feat: Replace Issue Table with Issue Badge --- src/Dto/GithubIssue.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Dto/GithubIssue.php b/src/Dto/GithubIssue.php index 2ad4571..0ae8fb2 100644 --- a/src/Dto/GithubIssue.php +++ b/src/Dto/GithubIssue.php @@ -20,15 +20,11 @@ public function __construct( public static function fromMantisIssue(MantisIssue $issue): GithubIssue { - $rows = [ - '| Mantis Ticket |', - '|:-------------:|', - '| [MANTIS-' . $issue->getId() . '](' . $issue->getIssueUrl() . ') |', - ]; - $table = implode(PHP_EOL, $rows); + $issueBadge = '[![MANTIS-' . $issue->getId() . '](https://img.shields.io/badge/MANTIS-' . $issue->getId() . '-green?style=for-the-badge)](' . $issue->getIssueUrl() . ')'; + return new self( title: '[MANTIS-' . $issue->getId() . '] [' . $issue->getProject() . '] ' . $issue->getSummary(), - description: $issue->getDescription() . PHP_EOL . PHP_EOL . $table, + description: $issue->getDescription() . PHP_EOL . PHP_EOL . $issueBadge, ); }