@@ -23,18 +23,14 @@ class EraseCommand extends Command
2323 */
2424 protected $ description = 'Erase components created from last Blueprint build ' ;
2525
26- /** @var Filesystem $files */
27- protected $ files ;
26+ /** @var Filesystem */
27+ protected $ filesystem ;
2828
29- /**
30- * @param Filesystem $files
31- * @param \Illuminate\Contracts\View\Factory $view
32- */
33- public function __construct (Filesystem $ files )
29+ public function __construct (Filesystem $ filesystem )
3430 {
3531 parent ::__construct ();
3632
37- $ this ->files = $ files ;
33+ $ this ->filesystem = $ filesystem ;
3834 }
3935
4036 /**
@@ -44,33 +40,37 @@ public function __construct(Filesystem $files)
4440 */
4541 public function handle ()
4642 {
47- $ contents = $ this ->files ->get ('.blueprint ' );
43+ $ contents = $ this ->filesystem ->get ('.blueprint ' );
4844
4945 $ blueprint = resolve (Blueprint::class);
5046
5147 $ generated = $ blueprint ->parse ($ contents , false );
5248
53- collect ($ generated )->each (function ($ files , $ action ) {
54- if ($ action === 'created ' ) {
55- $ this ->line ('Deleted: ' , $ this ->outputStyle ($ action ));
56- $ this ->files ->delete ($ files );
57- } elseif ($ action === 'updated ' ) {
58- $ this ->comment ('The updates to the following files can not be erased automatically. ' );
59- } else {
60- return ;
49+ collect ($ generated )->each (
50+ function ($ files , $ action ) {
51+ if ($ action === 'created ' ) {
52+ $ this ->line ('Deleted: ' , $ this ->outputStyle ($ action ));
53+ $ this ->filesystem ->delete ($ files );
54+ } elseif ($ action === 'updated ' ) {
55+ $ this ->comment ('The updates to the following files can not be erased automatically. ' );
56+ } else {
57+ return ;
58+ }
59+
60+ collect ($ files )->each (
61+ function ($ file ) {
62+ $ this ->line ('- ' . $ file );
63+ }
64+ );
65+
66+ $ this ->line ('' );
6167 }
62-
63- collect ($ files )->each (function ($ file ) {
64- $ this ->line ('- ' . $ file );
65- });
66-
67- $ this ->line ('' );
68- });
68+ );
6969
7070 unset($ generated ['created ' ]);
7171 unset($ generated ['updated ' ]);
7272
73- $ this ->files ->put ('.blueprint ' , $ blueprint ->dump ($ generated ));
73+ $ this ->filesystem ->put ('.blueprint ' , $ blueprint ->dump ($ generated ));
7474
7575 $ this ->call ('blueprint:trace ' );
7676 }
0 commit comments