File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 21
21
use ApiClients \Tools \OpenApiClientGenerator \Generator \Schema ;
22
22
use ApiClients \Tools \OpenApiClientGenerator \Generator \WebHook ;
23
23
use ApiClients \Tools \OpenApiClientGenerator \Generator \WebHooks ;
24
+ use ApiClients \Tools \OpenApiClientGenerator \Output \Status \Step ;
24
25
use ApiClients \Tools \OpenApiClientGenerator \Registry \Schema as SchemaRegistry ;
25
26
use ApiClients \Tools \OpenApiClientGenerator \Registry \ThrowableSchema ;
26
27
use ApiClients \Tools \OpenApiClientGenerator \Representation \Path ;
27
28
use ApiClients \Tools \OpenApiClientGenerator \State \File as StateFile ;
28
29
use ApiClients \Tools \OpenApiClientGenerator \State \Files ;
29
- use ApiClients \Tools \OpenApiClientGenerator \Output \Status \Step ;
30
30
use cebe \openapi \Reader ;
31
31
use cebe \openapi \spec \OpenApi ;
32
32
use EventSauce \ObjectHydrator \ObjectMapperUsingReflection ;
Original file line number Diff line number Diff line change 4
4
5
5
namespace ApiClients \Tools \OpenApiClientGenerator \Output ;
6
6
7
- use ApiClients \Tools \OpenApiClientGenerator \Output \Status \ANSI ;
8
- use ApiClients \Tools \OpenApiClientGenerator \Output \Status \Simple ;
9
- use ApiClients \Tools \OpenApiClientGenerator \Output \Status \Step ;
10
7
use OndraM \CiDetector \CiDetector ;
8
+ use Throwable ;
9
+
10
+ use function file_put_contents ;
11
+ use function getenv ;
11
12
use function Termwind \render ;
12
13
14
+ use const FILE_APPEND ;
15
+
13
16
final readonly class Error
14
17
{
15
- public static function display (\ Throwable $ throwable )
18
+ public static function display (Throwable $ throwable ): void
16
19
{
17
20
render ('<div>
18
21
<div class="px-1 bg-red-600">ERROR</div>
@@ -21,8 +24,10 @@ public static function display(\Throwable $throwable)
21
24
</em>
22
25
</div> ' );
23
26
24
- if ((new CiDetector ())->detect ()->getCiName () = == CiDetector::CI_GITHUB_ACTIONS ) {
25
- file_put_contents ( getenv ( ' GITHUB_STEP_SUMMARY ' ), " ### ⚠️ Error ⚠️ \n ``` " . $ throwable -> getMessage () . " ``` \n" , FILE_APPEND ) ;
27
+ if ((new CiDetector ())->detect ()->getCiName () ! == CiDetector::CI_GITHUB_ACTIONS ) {
28
+ return ;
26
29
}
30
+
31
+ file_put_contents (getenv ('GITHUB_STEP_SUMMARY ' ), "### ⚠️ Error ⚠️ \n``` " . $ throwable ->getMessage () . "``` \n" , FILE_APPEND );
27
32
}
28
33
}
You can’t perform that action at this time.
0 commit comments