@@ -23,18 +23,14 @@ class EraseCommand extends Command
23
23
*/
24
24
protected $ description = 'Erase components created from last Blueprint build ' ;
25
25
26
- /** @var Filesystem $files */
27
- protected $ files ;
26
+ /** @var Filesystem */
27
+ protected $ filesystem ;
28
28
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 )
34
30
{
35
31
parent ::__construct ();
36
32
37
- $ this ->files = $ files ;
33
+ $ this ->filesystem = $ filesystem ;
38
34
}
39
35
40
36
/**
@@ -44,33 +40,37 @@ public function __construct(Filesystem $files)
44
40
*/
45
41
public function handle ()
46
42
{
47
- $ contents = $ this ->files ->get ('.blueprint ' );
43
+ $ contents = $ this ->filesystem ->get ('.blueprint ' );
48
44
49
45
$ blueprint = resolve (Blueprint::class);
50
46
51
47
$ generated = $ blueprint ->parse ($ contents , false );
52
48
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 ('' );
61
67
}
62
-
63
- collect ($ files )->each (function ($ file ) {
64
- $ this ->line ('- ' . $ file );
65
- });
66
-
67
- $ this ->line ('' );
68
- });
68
+ );
69
69
70
70
unset($ generated ['created ' ]);
71
71
unset($ generated ['updated ' ]);
72
72
73
- $ this ->files ->put ('.blueprint ' , $ blueprint ->dump ($ generated ));
73
+ $ this ->filesystem ->put ('.blueprint ' , $ blueprint ->dump ($ generated ));
74
74
75
75
$ this ->call ('blueprint:trace ' );
76
76
}
0 commit comments