Skip to content

Commit 3aa434b

Browse files
committed
IDE autocomplete support through PHPDoc added 🚀
1 parent ed3cd61 commit 3aa434b

File tree

3 files changed

+59
-10
lines changed

3 files changed

+59
-10
lines changed

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to `laravel-filepond` will be documented in this file.
44

5+
## 10.2.2 - 2025-07-16
6+
7+
- Added PHPDoc for IDE autocomplete support. 🚀
8+
59
## 10.1.2 - 2025-05-08
610

711
- Mimetype added in fileinfo response. ✨

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ User::find(1)->fileponds;
305305

306306
## Development
307307

308-
First clone the repo and `cd` into the directory. Switch to `10.x-dev` branch. Build and start development environment with docker.
308+
First clone the repo and `cd` into the directory. Build development environment with docker.
309309

310310
```bash
311311
# Build the development image
@@ -357,8 +357,8 @@ If you discover any security related issues, please email [email protected]
357357

358358
## Credits
359359

360-
- [Rahul Haque](https://github.com/rahulhaque)
361-
- [All Contributors](../../contributors)
360+
- [Rahul Haque](https://github.com/rahulhaque)
361+
- [All Contributors](../../contributors)
362362

363363
## License
364364

‎src/Filepond.php‎

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function field(string|array|null $field, bool $checkOwnership = true)
2626
/**
2727
* Return file object from the field
2828
*
29-
* @return array|\Illuminate\Http\UploadedFile
29+
* @return \Illuminate\Http\UploadedFile|array<int, \Illuminate\Http\UploadedFile>|null
3030
*/
3131
public function getFile()
3232
{
@@ -47,7 +47,7 @@ public function getFile()
4747
* Get the filepond file as Data URL string
4848
* More at - https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
4949
*
50-
* @return array|string
50+
* @return array|array<int, string>|null
5151
*
5252
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
5353
*/
@@ -79,7 +79,25 @@ public function getModel()
7979
/**
8080
* Copy the FilePond files to destination
8181
*
82-
* @return array
82+
* @return array{
83+
* id: int,
84+
* dirname: string,
85+
* basename: string,
86+
* extension: string,
87+
* mimetype: string,
88+
* filename: string,
89+
* location: string,
90+
* url: string
91+
* }|array<int, array{
92+
* id: int,
93+
* dirname: string,
94+
* basename: string,
95+
* extension: string,
96+
* mimetype: string,
97+
* filename: string,
98+
* location: string,
99+
* url: string
100+
* }>|null
83101
*
84102
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
85103
*/
@@ -108,7 +126,25 @@ public function copyTo(string $path, string $disk = '', string $visibility = '')
108126
/**
109127
* Copy the FilePond files to destination and delete
110128
*
111-
* @return array
129+
* @return array{
130+
* id: int,
131+
* dirname: string,
132+
* basename: string,
133+
* extension: string,
134+
* mimetype: string,
135+
* filename: string,
136+
* location: string,
137+
* url: string
138+
* }|array<int, array{
139+
* id: int,
140+
* dirname: string,
141+
* basename: string,
142+
* extension: string,
143+
* mimetype: string,
144+
* filename: string,
145+
* location: string,
146+
* url: string
147+
* }>|null
112148
*
113149
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
114150
*/
@@ -145,7 +181,7 @@ public function moveTo(string $path, string $disk = '', string $visibility = '')
145181
public function delete()
146182
{
147183
if (! $this->getFieldValue()) {
148-
return null;
184+
return;
149185
}
150186

151187
if ($this->getIsMultipleUpload()) {
@@ -174,7 +210,16 @@ public function delete()
174210
/**
175211
* Put the file in permanent storage and return response
176212
*
177-
* @return array
213+
* @return array{
214+
* id: int,
215+
* dirname: string,
216+
* basename: string,
217+
* extension: string,
218+
* mimetype: string,
219+
* filename: string,
220+
* location: string,
221+
* url: string
222+
* }
178223
*
179224
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
180225
*/
@@ -187,7 +232,7 @@ private function putFile(FilepondModel $filepond, string $path, string $disk, st
187232
Storage::disk($permanentDisk)->writeStream(
188233
$pathInfo['dirname'].DIRECTORY_SEPARATOR.$pathInfo['filename'].'.'.$filepond->extension,
189234
Storage::disk($this->getTempDisk())->readStream($filepond->filepath),
190-
$visibility !== '' ? ['visibility' => $visibility] : [],
235+
$visibility !== '' ? ['visibility' => $visibility] : []
191236
);
192237

193238
return [

0 commit comments

Comments
 (0)