@@ -11,36 +11,39 @@ class RebuildRaidArray extends Command
11
11
//region Public Access
12
12
13
13
/**
14
- * Rebuild the RAID array underlying the given Storage disk name
14
+ * Rebuild the RAID array underlying the given Storage disk name.
15
15
*/
16
16
public function handle ()
17
17
{
18
18
$ disk = $ this ->argument ('disk ' );
19
- if (!$ disk ) {
20
- $ this ->error ('Please provide the disk you want the RAID ' .
19
+ if (! $ disk ) {
20
+ $ this ->error ('Please provide the disk you want the RAID ' .
21
21
'configuration to be rebuilt for. ' );
22
+
22
23
return ;
23
24
}
24
25
25
- $ diskConfig = config ('filesystems.disks. ' . $ disk );
26
- if (!$ diskConfig ) {
27
- $ this ->error ('Cannot find the filesystem configuration for disk " ' .
28
- $ disk . '". ' );
26
+ $ diskConfig = config ('filesystems.disks. ' .$ disk );
27
+ if (! $ diskConfig ) {
28
+ $ this ->error ('Cannot find the filesystem configuration for disk " ' .
29
+ $ disk .'". ' );
30
+
29
31
return ;
30
32
}
31
33
32
34
$ fileSystems = [];
33
- if (!isset ($ diskConfig ['disks ' ])) {
34
- $ this ->error ('Please make sure you have a key "disks" in the ' .
35
- 'configuration of the disk " ' . $ disk . '". ' );
35
+ if (! isset ($ diskConfig ['disks ' ])) {
36
+ $ this ->error ('Please make sure you have a key "disks" in the ' .
37
+ 'configuration of the disk " ' .$ disk .'". ' );
38
+
36
39
return ;
37
40
}
38
- foreach ($ diskConfig ['disks ' ] as $ diskName ) {
41
+ foreach ($ diskConfig ['disks ' ] as $ diskName ) {
39
42
$ fileSystems [] = Storage::disk ($ diskName );
40
43
}
41
44
42
45
$ raidLevel = $ diskConfig ['raidLevel ' ] ?? 1 ;
43
- if ($ raidLevel == 1 ) {
46
+ if ($ raidLevel == 1 ) {
44
47
$ adapter = new RaidOneAdapter ($ fileSystems );
45
48
$ adapter ->rebuildArray ();
46
49
}
@@ -62,8 +65,8 @@ public function handle()
62
65
*
63
66
* @var string
64
67
*/
65
- protected $ signature = 'raid:rebuild-array {disk : The configured disk ' .
68
+ protected $ signature = 'raid:rebuild-array {disk : The configured disk ' .
66
69
'for which to rebuild the array} ' ;
67
70
68
71
//endregion
69
- }
72
+ }
0 commit comments