File tree 3 files changed +22
-17
lines changed
3 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace App \Helpers ;
4
4
5
- use Symfony \Component \Process \Process ;
6
5
use GuzzleHttp \Client ;
6
+ use Symfony \Component \Process \Process ;
7
7
8
8
class Api
9
9
{
@@ -16,13 +16,14 @@ public static function getSentryUnreolvedIssues()
16
16
$ client = new Client ;
17
17
try {
18
18
$ 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
+ ],
25
25
]);
26
+
26
27
return json_decode ($ response ->getBody ()->getContents (), true );
27
28
} catch (\Exception $ e ) {
28
29
return [];
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ public function __construct($data = [])
18
18
19
19
public function name (): string
20
20
{
21
- return 'Issues ' . ' ( ' . count ($ this ->data ) . ') ' ;
21
+ return 'Issues ' . ' ( ' . count ($ this ->data ). ') ' ;
22
22
}
23
+
23
24
/**
24
25
* Calculate the value of the metric.
25
26
*
@@ -30,11 +31,12 @@ public function calculate(NovaRequest $request): array
30
31
$ rows = [];
31
32
foreach ($ this ->data as $ issue ) {
32
33
$ 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 ' ]);
37
38
}
39
+
38
40
return $ rows ;
39
41
}
40
42
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ public function __construct($data = [])
18
18
19
19
public function name (): string
20
20
{
21
- return 'Outdated Packages ' . ' ( ' . count ($ this ->data ) . ') ' ;
21
+ return 'Outdated Packages ' . ' ( ' . count ($ this ->data ). ') ' ;
22
22
}
23
+
23
24
/**
24
25
* Calculate the value of the metric.
25
26
*
@@ -30,11 +31,12 @@ public function calculate(NovaRequest $request): array
30
31
$ rows = [];
31
32
foreach ($ this ->data as $ package ) {
32
33
$ 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 ' ]);
37
38
}
39
+
38
40
return $ rows ;
39
41
}
40
42
You can’t perform that action at this time.
0 commit comments