File tree Expand file tree Collapse file tree 4 files changed +29
-5
lines changed
Expand file tree Collapse file tree 4 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 44
55use App \Support \ConfiguresForLintOrFix ;
66use App \Support \GetsCleaner ;
7+ use Exception ;
78use LaravelZero \Framework \Commands \Command ;
9+ use LaravelZero \Framework \Exceptions \ConsoleException ;
810
911class FixCommand extends Command
1012{
@@ -17,8 +19,18 @@ class FixCommand extends Command
1719
1820 public function handle (): int
1921 {
20- $ clean = $ this ->getCleaner ('fix ' , $ this ->input ->getOption ('using ' ));
22+ try {
23+ $ clean = $ this ->getCleaner ('fix ' , $ this ->input ->getOption ('using ' ));
2124
22- return $ clean ->execute ();
25+ return $ clean ->execute ();
26+ } catch (ConsoleException $ exception ) {
27+ $ this ->error ($ exception ->getMessage ());
28+
29+ return $ exception ->getCode ();
30+ } catch (Exception $ exception ) {
31+ $ this ->error ($ exception ->getMessage ());
32+
33+ return 1 ;
34+ }
2335 }
2436}
Original file line number Diff line number Diff line change 44
55use App \Support \ConfiguresForLintOrFix ;
66use App \Support \GetsCleaner ;
7+ use Exception ;
78use LaravelZero \Framework \Commands \Command ;
9+ use LaravelZero \Framework \Exceptions \ConsoleException ;
810
911class LintCommand extends Command
1012{
@@ -17,8 +19,18 @@ class LintCommand extends Command
1719
1820 public function handle (): int
1921 {
20- $ clean = $ this ->getCleaner ('lint ' , $ this ->input ->getOption ('using ' ));
22+ try {
23+ $ clean = $ this ->getCleaner ('lint ' , $ this ->input ->getOption ('using ' ));
2124
22- return $ clean ->execute ();
25+ return $ clean ->execute ();
26+ } catch (ConsoleException $ exception ) {
27+ $ this ->error ($ exception ->getMessage ());
28+
29+ return $ exception ->getCode ();
30+ } catch (Exception $ exception ) {
31+ $ this ->error ($ exception ->getMessage ());
32+
33+ return 1 ;
34+ }
2335 }
2436}
Original file line number Diff line number Diff line change 2626 |
2727 */
2828
29- 'version ' => '1.1.0 ' ,
29+ 'version ' => '1.1.1 ' ,
3030
3131 /*
3232 |--------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments