Skip to content

Commit 5bba11f

Browse files
authored
Removed extra title and updated formatting (#13)
* Title appeared twice, so the one outside the table was removed. * Limited title to 70 characters * Extended rows under headings to 70 characters * Changed style of table to borderless
1 parent d111c89 commit 5bba11f

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/Command/RandomIssueCommand.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8686

8787
$randomIssue = $searchIssueModel->getItems()[$randomIssueIndex];
8888

89-
$io->section($randomIssue->getTitle());
90-
91-
$io->newLine(1);
92-
9389
$randomIssueTitle = $randomIssue->getTitle();
9490

9591
// cut off title at 90 characters
96-
if (strlen($randomIssue->getTitle()) > 90) {
97-
$randomIssueTitle = substr($randomIssue->getTitle(), 0, 90) . '...';
92+
if (strlen($randomIssue->getTitle()) > 70) {
93+
$randomIssueTitle = substr($randomIssue->getTitle(), 0, 70) . '...';
9894
}
9995

100-
10196
$randomIssueBody = $randomIssue->getBody();
10297

10398
// cut off body at 300 characters
@@ -109,7 +104,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
109104
$io->writeln([
110105
"",
111106
"<comment> Details:</>",
112-
sprintf("<comment> %s</>", str_repeat("-", 60))
107+
sprintf("<comment> %s</>", str_repeat("-", 70))
113108
]);
114109

115110
// create a table for displaying the title and link
@@ -123,8 +118,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
123118
['Date Created:', $randomIssue->getCreatedDate()],
124119
['Status:', $randomIssue->getState()],
125120
]);
126-
127-
$table->setStyle('box');
121+
$table->setStyle('borderless');
128122
// render table
129123
$table->render();
130124

@@ -134,7 +128,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
134128
$io->writeln([
135129
"",
136130
"<comment> Issue:</>",
137-
sprintf("<comment> %s</>", str_repeat("-", 60))
131+
sprintf("<comment> %s</>", str_repeat("-", 70))
138132
]);
139133
// wrap lines that are longer than 70 characters
140134
$randomIssueBodyLines = wordwrap($randomIssueBody, 70, "\n", true);
@@ -146,8 +140,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
146140

147141
$io->newLine(1);
148142

149-
150-
151143
return 0;
152144
}
153145
}

0 commit comments

Comments
 (0)