File tree Expand file tree Collapse file tree 8 files changed +23
-22
lines changed Expand file tree Collapse file tree 8 files changed +23
-22
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 ;
@@ -155,7 +156,7 @@ protected function handleChunk()
155
156
$ file = $ this ->getChunkFilePath ();
156
157
157
158
$ this ->handleChunkFile ($ file )
158
- ->tryToBuildFullFileFromChunks ();
159
+ ->tryToBuildFullFileFromChunks ();
159
160
}
160
161
161
162
/**
@@ -248,7 +249,7 @@ public function chunkStorage()
248
249
/**
249
250
* Returns the disk adapter for the chunk.
250
251
*
251
- * @return \Illuminate\Filesystem\FilesystemAdapter
252
+ * @return FilesystemContract
252
253
*/
253
254
public function chunkDisk ()
254
255
{
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 ;
@@ -35,10 +36,10 @@ class ParallelSave extends ChunkSave
35
36
/**
36
37
* ParallelSave constructor.
37
38
*
38
- * @param UploadedFile $file the uploaded file (chunk file)
39
- * @param AbstractHandler|HandleParallelUploadTrait $handler the handler that detected the correct save method
40
- * @param ChunkStorage $chunkStorage the chunk storage
41
- * @param AbstractConfig $config the config manager
39
+ * @param UploadedFile $file the uploaded file (chunk file)
40
+ * @param AbstractHandler $handler the handler that detected the correct save method
41
+ * @param ChunkStorage $chunkStorage the chunk storage
42
+ * @param AbstractConfig $config the config manager
42
43
*
43
44
* @throws ChunkSaveException
44
45
*/
@@ -87,7 +88,7 @@ protected function handleChunkFile($file)
87
88
/**
88
89
* Searches for all chunk files.
89
90
*
90
- * @return \Illuminate\Support\ Collection
91
+ * @return Collection
91
92
*/
92
93
protected function getSavedChunksFiles ()
93
94
{
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ public function config()
187
187
}
188
188
189
189
/**
190
- * @return \Illuminate\Filesystem\FilesystemAdapter
190
+ * @return FilesystemContract
191
191
*/
192
192
public function disk ()
193
193
{
You can’t perform that action at this time.
0 commit comments