Issues (59)

src/Contracts/ChunkyManager.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Jobtech\LaravelChunky\Contracts;
4
5
use Illuminate\Http\UploadedFile;
0 ignored issues
show
The type Illuminate\Http\UploadedFile was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Illuminate\Support\Collection;
7
use Jobtech\LaravelChunky\Chunk;
8
use Jobtech\LaravelChunky\ChunkySettings;
9
use Jobtech\LaravelChunky\Http\Requests\AddChunkRequest;
10
use Jobtech\LaravelChunky\Support\ChunksFilesystem;
11
use Jobtech\LaravelChunky\Support\MergeFilesystem;
12
13
/**
14
 * @method int lastIndexFrom(AddChunkRequest $request)
15
 * @method bool isLastIndex(AddChunkRequest $request)
16
 */
17
interface ChunkyManager
18
{
19
    /**
20
     * @return \Jobtech\LaravelChunky\ChunkySettings
21
     */
22
    public function settings(): ChunkySettings;
23
24
    /**
25
     * @param string $disk
26
     * @param string $folder
27
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
28
     *
29
     * @return \Jobtech\LaravelChunky\ChunkyManager
30
     */
31
    public function setChunksFilesystem(string $disk, string $folder): ChunkyManager;
32
33
    /**
34
     * @return \Jobtech\LaravelChunky\Support\ChunksFilesystem
35
     */
36
    public function chunksFilesystem(): ChunksFilesystem;
37
38
    /**
39
     * @param string $disk
40
     * @param string $folder
41
     *
42
     * @throws \Illuminate\Contracts\Container\BindingResolutionException
43
     *
44
     * @return \Jobtech\LaravelChunky\ChunkyManager
45
     */
46
    public function setMergeFilesystem(string $disk, string $folder): ChunkyManager;
47
48
    /**
49
     * @return \Jobtech\LaravelChunky\Support\MergeFilesystem
50
     */
51
    public function mergeFilesystem(): MergeFilesystem;
52
53
    /**
54
     * @return \Jobtech\LaravelChunky\Contracts\MergeHandler
55
     */
56
    public function mergeHandler(): MergeHandler;
57
58
    /**
59
     * @return string|null
60
     */
61
    public function chunksDisk(): ?string;
62
63
    /**
64
     * @return string|null
65
     */
66
    public function mergeDisk(): ?string;
67
68
    /**
69
     * @return string
70
     */
71
    public function chunksFolder(): string;
72
73
    /**
74
     * @return string
75
     */
76
    public function mergeFolder(): string;
77
78
    /**
79
     * @return array
80
     */
81
    public function chunksOptions(): array;
82
83
    /**
84
     * @return array
85
     */
86
    public function mergeOptions(): array;
87
88
    /**
89
     * @param string|null $folder
90
     * @param bool $temporary
91
     * @return \Illuminate\Support\Collection
92
     */
93
    public function listChunks(?string $folder = null): Collection;
94
95
    /**
96
     * @param Chunk|string $chunk
97
     * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
98
     *
99
     * @return resource|null
100
     */
101
    public function readChunk($chunk);
102
103
    /**
104
     * @param \Illuminate\Http\UploadedFile $file
105
     * @param int $index
106
     * @param string $folder
107
     *
108
     * @return \Jobtech\LaravelChunky\Chunk
109
     */
110
    public function addChunk(UploadedFile $file, int $index, string $folder): Chunk;
111
112
    /**
113
     * @param string $folder
114
     *
115
     * @return bool
116
     */
117
    public function deleteChunks(string $folder): bool;
118
119
    /**
120
     * @param string $folder
121
     *
122
     * @return bool
123
     */
124
    public function isValidChunksFolder(string $folder): bool;
125
126
    /**
127
     * @param string $folder
128
     * @param int $index
129
     *
130
     * @return bool
131
     */
132
    public function checkChunks(string $folder, int $index): bool;
133
134
    /**
135
     * @param string $folder
136
     * @param int $chunk_size
137
     * @param int $total_size
138
     *
139
     * @return bool
140
     */
141
    public function checkChunksIntegrity(string $folder, int $chunk_size, int $total_size): bool;
142
143
    /**
144
     * @param \Jobtech\LaravelChunky\Http\Requests\AddChunkRequest $request
145
     * @param string|null $folder
146
     *
147
     * @return \Jobtech\LaravelChunky\Chunk
148
     */
149
    public function handle(AddChunkRequest $request, ?string $folder = null): Chunk;
150
151
    /**
152
     * @param string $chunks_folder
153
     * @param string $merge_path
154
     *
155
     * @return string
156
     */
157
    public function merge(string $chunks_folder, string $merge_path): string;
158
}
159