@@ -60,21 +60,18 @@ public function run(): Collection
60
60
61
61
public function commandsArray (): Collection
62
62
{
63
- return collect ($ this ->recipe )->map (function ($ path , $ key ) {
64
- return [
65
- 'origin ' => ($ this ->operation === 'pull ' ) ? $ this ->remotePath ($ key ) : $ this ->localPath ($ key ),
66
- 'target ' => ($ this ->operation === 'pull ' ) ? $ this ->localPath ($ key ) : $ this ->remotePath ($ key ),
67
- 'options ' => $ this ->options ,
68
- 'port ' => $ this ->port (),
69
- ];
70
- });
63
+ return collect ($ this ->recipe )->map (fn ($ path , $ key ) => [
64
+ 'origin ' => ($ this ->operation === 'pull ' ) ? $ this ->remotePath ($ key ) : $ this ->localPath ($ key ),
65
+ 'target ' => ($ this ->operation === 'pull ' ) ? $ this ->localPath ($ key ) : $ this ->remotePath ($ key ),
66
+ 'options ' => $ this ->options ,
67
+ 'port ' => $ this ->port (),
68
+ ]);
71
69
}
72
70
73
71
public function commandsString (): Collection
74
72
{
75
- return $ this ->commandsArray ()->map (function ($ command ) {
76
- return "rsync -e 'ssh -p {$ command ['port ' ]}' {$ command ['options ' ]} {$ command ['origin ' ]} {$ command ['target ' ]}" ;
77
- });
73
+ return $ this ->commandsArray ()
74
+ ->map (fn ($ command ) => "rsync -e 'ssh -p {$ command ['port ' ]}' {$ command ['options ' ]} {$ command ['origin ' ]} {$ command ['target ' ]}" );
78
75
}
79
76
80
77
protected function port (): string
@@ -94,19 +91,11 @@ protected function remotePath(string $key): string
94
91
95
92
protected function localPathEqualsRemotePath (): bool
96
93
{
97
- if ($ this ->localPath (0 ) !== $ this ->remotePath (0 )) {
98
- return false ;
99
- }
100
-
101
- return true ;
94
+ return $ this ->localPath (0 ) === $ this ->remotePath (0 );
102
95
}
103
96
104
97
protected function remoteIsReadOnly (): bool
105
98
{
106
- if (! Arr::get ($ this ->remote , 'read_only ' , false )) {
107
- return false ;
108
- }
109
-
110
- return true ;
99
+ return Arr::get ($ this ->remote , 'read_only ' , false );
111
100
}
112
101
}
0 commit comments