1 | <?php |
||
10 | abstract class Api implements ApiContract |
||
11 | { |
||
12 | /** |
||
13 | * $request. |
||
14 | * |
||
15 | * @var \Illuminate\Http\Request |
||
16 | */ |
||
17 | public $request; |
||
18 | |||
19 | /** |
||
20 | * $filesystem. |
||
21 | * |
||
22 | * @var \Recca0120\Upload\Filesystem |
||
23 | */ |
||
24 | public $filesystem; |
||
25 | |||
26 | /** |
||
27 | * $config. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $config; |
||
32 | |||
33 | /** |
||
34 | * __construct. |
||
35 | * |
||
36 | * @param array $config |
||
37 | * @param \Illuminate\Http\Request $request |
||
38 | * @param \Recca0120\Upload\Filesystem $filesystem |
||
39 | */ |
||
40 | 17 | public function __construct($config = [], Request $request = null, Filesystem $filesystem = null, ChunkFile $chunkFile = null) |
|
52 | |||
53 | /** |
||
54 | * domain. |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | 1 | public function domain() |
|
62 | |||
63 | /** |
||
64 | * path. |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | 1 | public function path() |
|
72 | |||
73 | /** |
||
74 | * makeDirectory. |
||
75 | * |
||
76 | * @return $this |
||
77 | */ |
||
78 | 6 | public function makeDirectory($path) |
|
86 | |||
87 | /** |
||
88 | * cleanDirectory. |
||
89 | */ |
||
90 | 2 | public function cleanDirectory($path) |
|
103 | |||
104 | /** |
||
105 | * receive. |
||
106 | * |
||
107 | * @param string $inputName |
||
108 | * @return \Symfony\Component\HttpFoundation\File\UploadedFile |
||
109 | * |
||
110 | * @throws \Recca0120\Upload\Exceptions\ChunkedResponseException |
||
111 | */ |
||
112 | abstract public function receive($inputName); |
||
113 | |||
114 | /** |
||
115 | * deleteUploadedFile. |
||
116 | * |
||
117 | * @param \Symfony\Component\HttpFoundation\File\UploadedFile |
||
118 | * @return $this |
||
119 | */ |
||
120 | 1 | public function deleteUploadedFile(UploadedFile $uploadedFile) |
|
130 | |||
131 | /** |
||
132 | * completedResponse. |
||
133 | * |
||
134 | * @param \Illuminate\Http\JsonResponse $response |
||
135 | * @return \Illuminate\Http\JsonResponse |
||
136 | */ |
||
137 | 1 | public function completedResponse(JsonResponse $response) |
|
141 | |||
142 | /** |
||
143 | * chunkPath. |
||
144 | * |
||
145 | * @return string |
||
146 | */ |
||
147 | 5 | protected function chunkPath() |
|
153 | |||
154 | /** |
||
155 | * storagePath. |
||
156 | * |
||
157 | * @return string |
||
158 | */ |
||
159 | 5 | protected function storagePath() |
|
165 | } |
||
166 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: