File tree Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Expand file tree Collapse file tree 3 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 22
33namespace App \Helpers ;
44
5- use Symfony \Component \Process \Process ;
65use GuzzleHttp \Client ;
6+ use Symfony \Component \Process \Process ;
77
88class Api
99{
@@ -16,13 +16,14 @@ public static function getSentryUnreolvedIssues()
1616 $ client = new Client ;
1717 try {
1818 $ response = $ client ->request ('GET ' , "https://sentry.io/api/0/projects/ $ organization/ $ project/issues/ " , [
19- 'headers ' => [
20- 'Authorization ' => "Bearer $ token " ,
21- ],
22- 'query ' => [
23- 'query ' => 'is:unresolved ' ,
24- ],
19+ 'headers ' => [
20+ 'Authorization ' => "Bearer $ token " ,
21+ ],
22+ 'query ' => [
23+ 'query ' => 'is:unresolved ' ,
24+ ],
2525 ]);
26+
2627 return json_decode ($ response ->getBody ()->getContents (), true );
2728 } catch (\Exception $ e ) {
2829 return [];
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ public function __construct($data = [])
1818
1919 public function name (): string
2020 {
21- return 'Issues ' . ' ( ' . count ($ this ->data ) . ') ' ;
21+ return 'Issues ' . ' ( ' . count ($ this ->data ). ') ' ;
2222 }
23+
2324 /**
2425 * Calculate the value of the metric.
2526 *
@@ -30,11 +31,12 @@ public function calculate(NovaRequest $request): array
3031 $ rows = [];
3132 foreach ($ this ->data as $ issue ) {
3233 $ rows [] = MetricTableRow::make ()
33- ->icon ($ issue ['level ' ] === 'error ' ? 'x-circle ' : 'exclamation-circle ' )
34- ->iconClass ($ issue ['level ' ] === 'error ' ? 'text-red-500 ' : 'text-yellow-500 ' )
35- ->title (ucwords ($ issue ['type ' ]) . ' ( ' . $ issue ['count ' ] . ') ' )
36- ->subtitle ($ issue ['title ' ]);
34+ ->icon ($ issue ['level ' ] === 'error ' ? 'x-circle ' : 'exclamation-circle ' )
35+ ->iconClass ($ issue ['level ' ] === 'error ' ? 'text-red-500 ' : 'text-yellow-500 ' )
36+ ->title (ucwords ($ issue ['type ' ]). ' ( ' . $ issue ['count ' ]. ') ' )
37+ ->subtitle ($ issue ['title ' ]);
3738 }
39+
3840 return $ rows ;
3941 }
4042
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ public function __construct($data = [])
1818
1919 public function name (): string
2020 {
21- return 'Outdated Packages ' . ' ( ' . count ($ this ->data ) . ') ' ;
21+ return 'Outdated Packages ' . ' ( ' . count ($ this ->data ). ') ' ;
2222 }
23+
2324 /**
2425 * Calculate the value of the metric.
2526 *
@@ -30,11 +31,12 @@ public function calculate(NovaRequest $request): array
3031 $ rows = [];
3132 foreach ($ this ->data as $ package ) {
3233 $ rows [] = MetricTableRow::make ()
33- ->icon ('exclamation-circle ' )
34- ->iconClass ('text-yellow-500 ' )
35- ->title ($ package ['name ' ])
36- ->subtitle ('Installed: ' .$ package ['version ' ].' | Latest: ' .$ package ['latest ' ]);
34+ ->icon ('exclamation-circle ' )
35+ ->iconClass ('text-yellow-500 ' )
36+ ->title ($ package ['name ' ])
37+ ->subtitle ('Installed: ' .$ package ['version ' ].' | Latest: ' .$ package ['latest ' ]);
3738 }
39+
3840 return $ rows ;
3941 }
4042
You can’t perform that action at this time.
0 commit comments