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

Commit a02522e

Browse files
author
Robert Kummer
authored
Merge pull request #24 from ipunkt/analysis-XVNWVO
Apply fixes from StyleCI
2 parents 9481d34 + 7716911 commit a02522e

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

app/Jobs/CreateLocalFile.php

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,63 +9,63 @@
99

1010
class CreateLocalFile
1111
{
12-
use Dispatchable;
12+
use Dispatchable;
1313

14-
/**
15-
* @var \Illuminate\Http\UploadedFile
16-
*/
17-
private $file;
14+
/**
15+
* @var \Illuminate\Http\UploadedFile
16+
*/
17+
private $file;
1818

19-
/**
20-
* @var string
21-
*/
22-
private $reference;
19+
/**
20+
* @var string
21+
*/
22+
private $reference;
2323

24-
public function __construct(string $reference, UploadedFile $file)
25-
{
26-
$this->reference = $reference;
27-
$this->file = $file;
28-
}
24+
public function __construct(string $reference, UploadedFile $file)
25+
{
26+
$this->reference = $reference;
27+
$this->file = $file;
28+
}
2929

30-
/**
31-
* Execute the job.
32-
*
33-
* @return void
34-
*/
35-
public function handle()
36-
{
37-
$fileHandle = $this->file->openFile();
38-
$content = $fileHandle->fread($this->file->getSize());
30+
/**
31+
* Execute the job.
32+
*
33+
* @return void
34+
*/
35+
public function handle()
36+
{
37+
$fileHandle = $this->file->openFile();
38+
$content = $fileHandle->fread($this->file->getSize());
3939

40-
$proxyFile = new ProxyFile([
41-
'reference' => $this->reference,
42-
'type' => 'local',
43-
'filename' => $this->file->getClientOriginalName(),
44-
'mimetype' => $this->file->getClientMimeType(),
45-
'size' => $this->file->getSize(),
46-
'checksum' => sha1($content),
47-
]);
48-
$proxyFile->save();
40+
$proxyFile = new ProxyFile([
41+
'reference' => $this->reference,
42+
'type' => 'local',
43+
'filename' => $this->file->getClientOriginalName(),
44+
'mimetype' => $this->file->getClientMimeType(),
45+
'size' => $this->file->getSize(),
46+
'checksum' => sha1($content),
47+
]);
48+
$proxyFile->save();
4949

50-
/** @var \App\LocalFile $localFile */
51-
$localFile = $proxyFile->localFile()->create([
52-
'path' => uniqid('', true),
53-
]);
50+
/** @var \App\LocalFile $localFile */
51+
$localFile = $proxyFile->localFile()->create([
52+
'path' => uniqid('', true),
53+
]);
5454

55-
/** @var Filesystem|\Illuminate\Filesystem\FilesystemAdapter $filesystem */
56-
$filesystem = app(Filesystem::class);
55+
/** @var Filesystem|\Illuminate\Filesystem\FilesystemAdapter $filesystem */
56+
$filesystem = app(Filesystem::class);
5757

58-
if (!$filesystem->exists('local')) {
59-
$filesystem->makeDirectory('local');
60-
}
58+
if (! $filesystem->exists('local')) {
59+
$filesystem->makeDirectory('local');
60+
}
6161

62-
$path = $localFile->getLocalStoragePath();
62+
$path = $localFile->getLocalStoragePath();
6363

64-
$fh = fopen($this->file->getRealPath(), 'rb');
65-
if ($filesystem->put($path, $fh)) {
66-
$localFile->path = $path;
67-
$localFile->save();
68-
}
69-
fclose($fh);
70-
}
64+
$fh = fopen($this->file->getRealPath(), 'rb');
65+
if ($filesystem->put($path, $fh)) {
66+
$localFile->path = $path;
67+
$localFile->save();
68+
}
69+
fclose($fh);
70+
}
7171
}

0 commit comments

Comments
 (0)