Skip to content

Commit b4ecb71

Browse files
Merge pull request #87 from TheDragonCode/1.x
Rolling back the output of notification titles
2 parents 27022be + ace67a7 commit b4ecb71

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

app/Data/NotificationData.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
namespace DragonCode\GithubNotifications\Data;
66

7-
use Illuminate\Support\Str;
8-
9-
use function Termwind\terminal;
10-
117
class NotificationData extends Data
128
{
139
public int $id;
@@ -39,7 +35,6 @@ public function __construct(array $data, int $index)
3935
$this->repository = $this->get($data, 'repository.name');
4036

4137
$this->title = $this->title($index);
42-
$this->title .= $this->caption($data);
4338
}
4439

4540
protected function title(int $index): string
@@ -53,20 +48,6 @@ protected function title(int $index): string
5348
);
5449
}
5550

56-
public function caption(array $data): string
57-
{
58-
$title = Str::length(strip_tags($this->title));
59-
60-
return Str::of(strip_tags((string) $this->get($data, 'subject.title')))
61-
->trim()
62-
->squish()
63-
->limit($this->terminalWidth() - $title - 50)
64-
->prepend('<fg=yellow>(')
65-
->append(')</>')
66-
->prepend(' ')
67-
->toString();
68-
}
69-
7051
protected function issueId(array $data): int
7152
{
7253
if ($values = $this->parseUrl($data)) {
@@ -84,9 +65,4 @@ protected function parseUrl(array $data): ?array
8465

8566
return null;
8667
}
87-
88-
protected function terminalWidth(): int
89-
{
90-
return terminal()->width();
91-
}
9268
}

0 commit comments

Comments
 (0)