@@ -105,15 +105,15 @@ public function commandRecord()
105
105
*/
106
106
public function handle ()
107
107
{
108
- if ( ! $ this ->passesChecks ()) {
108
+ if (! $ this ->passesChecks ()) {
109
109
return false ;
110
110
}
111
111
112
112
try {
113
113
$ this ->commandRecord ()->start ();
114
114
$ message = $ this ->handleCommand ();
115
115
116
- if ( ! $ this ->isRecursive ) {
116
+ if (! $ this ->isRecursive ) {
117
117
return $ this ->complete ($ message );
118
118
}
119
119
} catch (\Exception $ e ) {
@@ -146,7 +146,7 @@ protected function passesChecks()
146
146
}
147
147
148
148
foreach ($ this ->runsIf as $ name ) {
149
- if ( ! CommandRecord::hasCompleted ($ name )) {
149
+ if (! CommandRecord::hasCompleted ($ name )) {
150
150
return $ this ->fail ("Command {$ name } has not run yet. " );
151
151
}
152
152
}
@@ -158,7 +158,7 @@ protected function passesChecks()
158
158
}
159
159
160
160
if ($ this ->commandRecord ()->hasStarted ()) {
161
- return false ;
161
+ throw new \ Exception ( ' The monitored command ' . $ this -> commandRecord ()-> id . ' has already started. ' ) ;
162
162
}
163
163
164
164
return true ;
@@ -172,7 +172,8 @@ protected function passesChecks()
172
172
protected function hasRunTooManyTimes ()
173
173
{
174
174
return $ this ->runLimit >= 0 &&
175
- max (CommandRecord::hasBeenRequestedCount ($ this ->name ), CommandRecord::hasCompletedCount ($ this ->name )) >= $ this ->runLimit ;
175
+ max (CommandRecord::hasBeenRequestedCount ($ this ->name ),
176
+ CommandRecord::hasCompletedCount ($ this ->name )) >= $ this ->runLimit ;
176
177
}
177
178
178
179
/**
0 commit comments