Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #22 from ipunkt/analysis-z3yAZP
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
Robert Kummer authored Jun 2, 2017
2 parents 7a920f2 + 0c0630b commit bb9e5e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/Exceptions/LocalProxyFileCanNotByDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ public static function throwException(): self
{
return new static('Local proxy file can not be deleted.');
}
}
}
4 changes: 2 additions & 2 deletions app/Jobs/UpdateLocalFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function handle()

/** @var LocalFile|RemoteFile $currentFile */
$currentFile = $this->proxyFile->file;
if (!$filesystem->delete($currentFile->getLocalStoragePath())) {
if (! $filesystem->delete($currentFile->getLocalStoragePath())) {
throw LocalProxyFileCanNotByDeleted::throwException();
}
$currentFile->forceDelete();
Expand All @@ -74,7 +74,7 @@ public function handle()
'path' => uniqid('', true),
]);

if (!$filesystem->exists('local')) {
if (! $filesystem->exists('local')) {
$filesystem->makeDirectory('local');
}

Expand Down
9 changes: 5 additions & 4 deletions app/Jobs/UpdateRemoteFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function handle()

/** @var LocalFile|RemoteFile $currentFile */
$currentFile = $this->proxyFile->file;
if (!$this->getFilesystem()->delete($currentFile->getLocalStoragePath())) {
if (! $this->getFilesystem()->delete($currentFile->getLocalStoragePath())) {
throw LocalProxyFileCanNotByDeleted::throwException();
}
$currentFile->forceDelete();
Expand All @@ -78,7 +78,7 @@ public function handle()
try {
\DB::beginTransaction();

$content = (string)$response->getBody();
$content = (string) $response->getBody();

$filename = basename($this->url);
$parts = explode('.', $filename);
Expand Down Expand Up @@ -132,17 +132,18 @@ private function cacheRemoteFileLocally(RemoteFile $remoteFile, string $content)
}

/**
* sets up filesystem
* sets up filesystem.
*
* @return Filesystem|\Illuminate\Filesystem\FilesystemAdapter
*/
private function getFilesystem()
{
/** @var Filesystem|\Illuminate\Filesystem\FilesystemAdapter $filesystem */
$filesystem = app(Filesystem::class);
if (!$filesystem->exists('remote')) {
if (! $filesystem->exists('remote')) {
$filesystem->makeDirectory('remote');
}

return $filesystem;
}
}

0 comments on commit bb9e5e6

Please sign in to comment.