9
9
use Codedge \Updater \Events \UpdateAvailable ;
10
10
use Codedge \Updater \Events \UpdateFailed ;
11
11
use Codedge \Updater \Events \UpdateSucceeded ;
12
- use Illuminate \Support \Facades \File ;
13
12
use GuzzleHttp \Client ;
14
13
use Illuminate \Database \Eloquent \Collection ;
14
+ use Illuminate \Support \Facades \File ;
15
15
use Psr \Http \Message \ResponseInterface ;
16
16
use Storage ;
17
17
use Symfony \Component \Finder \Finder ;
@@ -70,7 +70,7 @@ public function __construct(Client $client, array $config)
70
70
*
71
71
* @return bool
72
72
*/
73
- public function isNewVersionAvailable ($ currentVersion = '' ) : bool
73
+ public function isNewVersionAvailable ($ currentVersion = '' ): bool
74
74
{
75
75
$ version = $ currentVersion ?: $ this ->getVersionInstalled ();
76
76
@@ -139,7 +139,7 @@ public function fetch($version = '')
139
139
*
140
140
* @return bool
141
141
*/
142
- public function update ($ version = '' ) : bool
142
+ public function update ($ version = '' ): bool
143
143
{
144
144
$ this ->setPathToUpdate (base_path (), $ this ->config ['exclude_folders ' ]);
145
145
@@ -153,7 +153,7 @@ public function update($version = '') : bool
153
153
collect ((new Finder ())->in ($ sourcePath )->exclude ($ this ->config ['exclude_folders ' ])->directories ()->sort (function ($ a , $ b ) {
154
154
return strlen ($ b ->getRealpath ()) - strlen ($ a ->getRealpath ());
155
155
}))->each (function ($ directory ) { /** @var \SplFileInfo $directory */
156
- if (!$ this ->isDirectoryExcluded (
156
+ if (! $ this ->isDirectoryExcluded (
157
157
File::directories ($ directory ->getRealPath ()), $ this ->config ['exclude_folders ' ])
158
158
) {
159
159
File::copyDirectory (
@@ -191,7 +191,7 @@ public function update($version = '') : bool
191
191
*
192
192
* @return string
193
193
*/
194
- public function getVersionInstalled ($ prepend = '' , $ append = '' ) : string
194
+ public function getVersionInstalled ($ prepend = '' , $ append = '' ): string
195
195
{
196
196
return $ this ->config ['version_installed ' ];
197
197
}
@@ -207,7 +207,7 @@ public function getVersionInstalled($prepend = '', $append = '') : string
207
207
*
208
208
* @return string
209
209
*/
210
- public function getVersionAvailable ($ prepend = '' , $ append = '' ) : string
210
+ public function getVersionAvailable ($ prepend = '' , $ append = '' ): string
211
211
{
212
212
$ version = '' ;
213
213
if ($ this ->versionFileExists ()) {
@@ -266,7 +266,7 @@ protected function getPackageReleases()
266
266
*
267
267
* @return bool
268
268
*/
269
- protected function versionFileExists () : bool
269
+ protected function versionFileExists (): bool
270
270
{
271
271
return Storage::exists (static ::NEW_VERSION_FILE );
272
272
}
@@ -278,7 +278,7 @@ protected function versionFileExists() : bool
278
278
*
279
279
* @return bool
280
280
*/
281
- protected function setVersionFile (string $ content ) : bool
281
+ protected function setVersionFile (string $ content ): bool
282
282
{
283
283
return Storage::put (static ::NEW_VERSION_FILE , $ content );
284
284
}
@@ -288,7 +288,7 @@ protected function setVersionFile(string $content) : bool
288
288
*
289
289
* @return string
290
290
*/
291
- protected function getVersionFile () : string
291
+ protected function getVersionFile (): string
292
292
{
293
293
return Storage::get (static ::NEW_VERSION_FILE );
294
294
}
@@ -298,7 +298,7 @@ protected function getVersionFile() : string
298
298
*
299
299
* @return bool
300
300
*/
301
- protected function deleteVersionFile () : bool
301
+ protected function deleteVersionFile (): bool
302
302
{
303
303
return Storage::delete (static ::NEW_VERSION_FILE );
304
304
}
0 commit comments