File tree Expand file tree Collapse file tree 1 file changed +11
-23
lines changed Expand file tree Collapse file tree 1 file changed +11
-23
lines changed Original file line number Diff line number Diff line change @@ -21,24 +21,19 @@ public function __construct(IssueMessage $issue)
21
21
*/
22
22
public function toString ()
23
23
{
24
- $ msgs = [];
25
24
$ msg = trim ($ this ->issue ->getMessage ());
26
25
if (count ($ this ->issue ->getIssues ()))
27
26
{
28
- $ msgs = [$ msg . ': ' ];
29
- foreach ($ this ->issue ->getIssues () as $ issue )
30
- {
31
- $ issues = static ::getSubIssues ($ issue );
32
- if ($ issues )
33
- {
34
- array_push ($ msgs , ...$ issues );
35
- }
36
- }
27
+ $ msg .= ': ' ;
37
28
}
38
- else
29
+
30
+ $ msgs = [$ msg ];
31
+ $ issues = static ::getSubIssues ($ this ->issue );
32
+ if ($ issues )
39
33
{
40
- $ msgs = [ $ msg ] ;
34
+ array_push ( $ msgs, ... $ issues ) ;
41
35
}
36
+
42
37
return implode ("\n" , $ msgs );
43
38
}
44
39
@@ -53,18 +48,11 @@ protected static function getSubIssues(IssueMessage $issue, $level = 0)
53
48
foreach ($ issue ->getIssues () as $ sub_issue )
54
49
{
55
50
$ msg = str_repeat (' ' , $ level ) . '- ' . trim ($ sub_issue ->getMessage ());
56
- if (count ($ sub_issue ->getIssues ()))
57
- {
58
- $ msgs [] = $ msg ;
59
- $ issues = static ::getSubIssues ($ sub_issue , $ level + 1 );
60
- if ($ issues )
61
- {
62
- array_push ($ msgs , ...$ issues );
63
- }
64
- }
65
- else
51
+ $ msgs [] = $ msg ;
52
+ $ issues = static ::getSubIssues ($ sub_issue , $ level + 1 );
53
+ if ($ issues )
66
54
{
67
- $ msgs[] = $ msg ;
55
+ array_push ( $ msgs, ... $ issues ) ;
68
56
}
69
57
}
70
58
return $ msgs ;
You can’t perform that action at this time.
0 commit comments