@@ -49,14 +49,20 @@ public function runUp(string $filename, int $batch, Options $options): void
49
49
$ name = $ this ->resolveActionName ($ path );
50
50
51
51
if ($ this ->allowAction ($ action , $ name , $ options )) {
52
- $ this ->hasAction ($ action , '__invoke ' )
53
- ? $ this ->runAction ($ action , $ name , '__invoke ' )
54
- : $ this ->runAction ($ action , $ name , 'up ' );
52
+ $ this ->notification ->task ($ name , function () use ($ action , $ name , $ batch ) {
53
+ $ this ->hasAction ($ action , '__invoke ' )
54
+ ? $ this ->runAction ($ action , '__invoke ' )
55
+ : $ this ->runAction ($ action , 'up ' );
55
56
56
- if ($ this ->allowLogging ($ action )) {
57
- $ this ->log ($ name , $ batch );
58
- }
57
+ if ($ this ->allowLogging ($ action )) {
58
+ $ this ->log ($ name , $ batch );
59
+ }
60
+ });
61
+
62
+ return ;
59
63
}
64
+
65
+ $ this ->notification ->twoColumn ($ name , 'SKIP ' );
60
66
}
61
67
62
68
public function runDown (string $ filename , Options $ options ): void
@@ -65,34 +71,34 @@ public function runDown(string $filename, Options $options): void
65
71
$ action = $ this ->resolveAction ($ path );
66
72
$ name = $ this ->resolveActionName ($ path );
67
73
68
- if (! $ this ->hasAction ($ action , '__invoke ' ) && $ this ->hasAction ($ action , 'down ' )) {
69
- $ this ->runAction ($ action , $ name , 'down ' );
70
- }
74
+ $ this ->notification ->task ($ name , function () use ($ action , $ name ) {
75
+ if (! $ this ->hasAction ($ action , '__invoke ' ) && $ this ->hasAction ($ action , 'down ' )) {
76
+ $ this ->runAction ($ action , 'down ' );
77
+ }
71
78
72
- $ this ->deleteLog ($ name );
79
+ $ this ->deleteLog ($ name );
80
+ });
73
81
}
74
82
75
83
protected function hasAction (Action $ action , string $ method ): bool
76
84
{
77
85
return method_exists ($ action , $ method );
78
86
}
79
87
80
- protected function runAction (Action $ action , string $ name , string $ method ): void
88
+ protected function runAction (Action $ action , string $ method ): void
81
89
{
82
- $ this ->notification ->task ($ name , function () use ($ action , $ method ) {
83
- if ($ this ->hasAction ($ action , $ method )) {
84
- try {
85
- $ this ->runMethod ($ action , $ method , $ action ->enabledTransactions (), $ action ->transactionAttempts ());
90
+ if ($ this ->hasAction ($ action , $ method )) {
91
+ try {
92
+ $ this ->runMethod ($ action , $ method , $ action ->enabledTransactions (), $ action ->transactionAttempts ());
86
93
87
- $ action ->success ();
88
- }
89
- catch (Throwable $ e ) {
90
- $ action ->failed ();
94
+ $ action ->success ();
95
+ }
96
+ catch (Throwable $ e ) {
97
+ $ action ->failed ();
91
98
92
- throw $ e ;
93
- }
99
+ throw $ e ;
94
100
}
95
- });
101
+ }
96
102
}
97
103
98
104
protected function runMethod (Action $ action , string $ method , bool $ transactions , int $ attempts ): void
0 commit comments