File tree Expand file tree Collapse file tree 8 files changed +24
-23
lines changed Expand file tree Collapse file tree 8 files changed +24
-23
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ public function isFirstChunk()
125
125
/**
126
126
* Checks if the chunk is last.
127
127
*
128
- * @return int
128
+ * @return bool
129
129
*/
130
130
public function isLastChunk ()
131
131
{
Original file line number Diff line number Diff line change @@ -36,21 +36,21 @@ class ContentRangeUploadHandler extends AbstractHandler
36
36
/**
37
37
* Current chunk start bytes.
38
38
*
39
- * @var int
39
+ * @var float
40
40
*/
41
41
protected $ bytesStart = 0 ;
42
42
43
43
/**
44
44
* Current chunk bytes end.
45
45
*
46
- * @var int
46
+ * @var float
47
47
*/
48
48
protected $ bytesEnd = 0 ;
49
49
50
50
/**
51
51
* The files total bytes.
52
52
*
53
- * @var int
53
+ * @var float
54
54
*/
55
55
protected $ bytesTotal = 0 ;
56
56
@@ -153,7 +153,7 @@ public function isFirstChunk()
153
153
/**
154
154
* Returns the chunks count.
155
155
*
156
- * @return int
156
+ * @return bool
157
157
*/
158
158
public function isLastChunk ()
159
159
{
@@ -172,23 +172,23 @@ public function isChunkedUpload()
172
172
}
173
173
174
174
/**
175
- * @return int returns the starting bytes for current request
175
+ * @return float returns the starting bytes for current request
176
176
*/
177
177
public function getBytesStart ()
178
178
{
179
179
return $ this ->bytesStart ;
180
180
}
181
181
182
182
/**
183
- * @return int returns the ending bytes for current request
183
+ * @return float returns the ending bytes for current request
184
184
*/
185
185
public function getBytesEnd ()
186
186
{
187
187
return $ this ->bytesEnd ;
188
188
}
189
189
190
190
/**
191
- * @return int returns the total bytes for the file
191
+ * @return float returns the total bytes for the file
192
192
*/
193
193
public function getBytesTotal ()
194
194
{
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class HandlerFactory
37
37
*/
38
38
public static function classFromRequest (Request $ request , $ fallbackClass = null )
39
39
{
40
- /** @var AbstractHandler $handlerClass */
40
+ /** @var AbstractHandler|string $handlerClass */
41
41
foreach (static ::$ handlers as $ handlerClass ) {
42
42
if ($ handlerClass ::canBeUsedForRequest ($ request )) {
43
43
return $ handlerClass ;
Original file line number Diff line number Diff line change 2
2
3
3
namespace Pion \Laravel \ChunkUpload \Handler ;
4
4
5
- use Pion \Laravel \ChunkUpload \Config \AbstractConfig ;
6
5
use Pion \Laravel \ChunkUpload \Save \SingleSave ;
7
6
use Pion \Laravel \ChunkUpload \Storage \ChunkStorage ;
8
7
@@ -16,7 +15,7 @@ class SingleUploadHandler extends AbstractHandler
16
15
/**
17
16
* Returns the chunks ave instance for saving.
18
17
*
19
- * @param ChunkStorage $chunkStorage the chunk storage
18
+ * @param ChunkStorage $chunkStorage the chunk storage
20
19
*
21
20
* @return SingleSave
22
21
*/
@@ -32,7 +31,7 @@ public function startSaving($chunkStorage)
32
31
*/
33
32
public function getChunkFileName ()
34
33
{
35
- return null ; // never used
34
+ return '' ; // never used
36
35
}
37
36
38
37
/**
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class FileReceiver
25
25
protected $ file ;
26
26
27
27
/**
28
- * The handler that detects what upload proccess is beeing used.
28
+ * The handler that detects what upload process is being used.
29
29
*
30
30
* @var AbstractHandler
31
31
*/
@@ -93,7 +93,7 @@ public function isUploaded()
93
93
*/
94
94
public function receive ()
95
95
{
96
- if (false === is_object ($ this ->handler )) {
96
+ if (false == is_object ($ this ->handler )) {
97
97
return false ;
98
98
}
99
99
Original file line number Diff line number Diff line change 2
2
3
3
namespace Pion \Laravel \ChunkUpload \Save ;
4
4
5
+ use Illuminate \Contracts \Filesystem \Filesystem as FilesystemContract ;
5
6
use Illuminate \Http \UploadedFile ;
6
7
use Pion \Laravel \ChunkUpload \Config \AbstractConfig ;
7
8
use Pion \Laravel \ChunkUpload \Exceptions \ChunkSaveException ;
@@ -154,7 +155,7 @@ protected function handleChunk()
154
155
$ file = $ this ->getChunkFilePath ();
155
156
156
157
$ this ->handleChunkFile ($ file )
157
- ->tryToBuildFullFileFromChunks ();
158
+ ->tryToBuildFullFileFromChunks ();
158
159
}
159
160
160
161
/**
@@ -242,7 +243,7 @@ public function chunkStorage()
242
243
/**
243
244
* Returns the disk adapter for the chunk.
244
245
*
245
- * @return \Illuminate\Filesystem\FilesystemAdapter
246
+ * @return FilesystemContract
246
247
*/
247
248
public function chunkDisk ()
248
249
{
Original file line number Diff line number Diff line change 3
3
namespace Pion \Laravel \ChunkUpload \Save ;
4
4
5
5
use Illuminate \Http \UploadedFile ;
6
+ use Illuminate \Support \Collection ;
6
7
use Illuminate \Support \Str ;
7
8
use Pion \Laravel \ChunkUpload \ChunkFile ;
8
9
use Pion \Laravel \ChunkUpload \Config \AbstractConfig ;
@@ -31,10 +32,10 @@ class ParallelSave extends ChunkSave
31
32
/**
32
33
* ParallelSave constructor.
33
34
*
34
- * @param UploadedFile $file the uploaded file (chunk file)
35
- * @param AbstractHandler|HandleParallelUploadTrait $handler the handler that detected the correct save method
36
- * @param ChunkStorage $chunkStorage the chunk storage
37
- * @param AbstractConfig $config the config manager
35
+ * @param UploadedFile $file the uploaded file (chunk file)
36
+ * @param AbstractHandler $handler the handler that detected the correct save method
37
+ * @param ChunkStorage $chunkStorage the chunk storage
38
+ * @param AbstractConfig $config the config manager
38
39
*
39
40
* @throws ChunkSaveException
40
41
*/
@@ -79,7 +80,7 @@ protected function tryToBuildFullFileFromChunks()
79
80
/**
80
81
* Searches for all chunk files.
81
82
*
82
- * @return \Illuminate\Support\ Collection
83
+ * @return Collection
83
84
*/
84
85
protected function getSavedChunksFiles ()
85
86
{
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public static function storage()
32
32
/**
33
33
* The disk that holds the chunk files.
34
34
*
35
- * @var \Illuminate\Filesystem\FilesystemAdapter
35
+ * @var FilesystemContract
36
36
*/
37
37
protected $ disk ;
38
38
@@ -172,7 +172,7 @@ public function config()
172
172
}
173
173
174
174
/**
175
- * @return \Illuminate\Filesystem\FilesystemAdapter
175
+ * @return FilesystemContract
176
176
*/
177
177
public function disk ()
178
178
{
You can’t perform that action at this time.
0 commit comments