Skip to content

Commit 0a6b228

Browse files
committed
IDE autocomplete support through PHPDoc added 🚀
1 parent 873aab4 commit 0a6b228

File tree

4 files changed

+58
-9
lines changed

4 files changed

+58
-9
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest]
16-
php: [8.2, 8.3]
16+
php: [8.2]
1717
laravel: [11.*]
1818
stability: [prefer-stable]
1919
include:

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+
## 11.2.4 - 2025-07-16
6+
7+
- Added PHPDoc for IDE autocomplete support. 🚀
8+
59
## 11.1.4 - 2025-05-08
610

711
- Fixed overriding the disk default visibility #75. 🐛

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ See the corresponding branch for the documentation.
3232

3333
|Version|Branch|
3434
|:-:|:-:|
35+
|Laravel 12|[12.x branch](../../tree/12.x/README.md)|
3536
|Laravel 11|[11.x branch](../../tree/11.x/README.md)|
3637
|Laravel 10|[10.x branch](../../tree/10.x/README.md)|
3738
|Laravel 9|[9.x branch](../../tree/9.x/README.md)|

src/Filepond.php

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace RahulHaque\Filepond;
44

5-
use Illuminate\Http\File;
65
use Illuminate\Support\Facades\Storage;
76
use RahulHaque\Filepond\Models\Filepond as FilepondModel;
87

@@ -27,7 +26,7 @@ public function field(string|array|null $field, bool $checkOwnership = true)
2726
/**
2827
* Return file object from the field
2928
*
30-
* @return array|\Illuminate\Http\UploadedFile
29+
* @return \Illuminate\Http\UploadedFile|array<int, \Illuminate\Http\UploadedFile>|null
3130
*/
3231
public function getFile()
3332
{
@@ -48,7 +47,7 @@ public function getFile()
4847
* Get the filepond file as Data URL string
4948
* More at - https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
5049
*
51-
* @return array|string
50+
* @return array|array<int, string>|null
5251
*
5352
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
5453
*/
@@ -80,7 +79,25 @@ public function getModel()
8079
/**
8180
* Copy the FilePond files to destination
8281
*
83-
* @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
84101
*
85102
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
86103
*/
@@ -109,7 +126,25 @@ public function copyTo(string $path, string $disk = '', string $visibility = '')
109126
/**
110127
* Copy the FilePond files to destination and delete
111128
*
112-
* @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
113148
*
114149
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
115150
*/
@@ -146,7 +181,7 @@ public function moveTo(string $path, string $disk = '', string $visibility = '')
146181
public function delete()
147182
{
148183
if (! $this->getFieldValue()) {
149-
return null;
184+
return;
150185
}
151186

152187
if ($this->getIsMultipleUpload()) {
@@ -175,7 +210,16 @@ public function delete()
175210
/**
176211
* Put the file in permanent storage and return response
177212
*
178-
* @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+
* }
179223
*
180224
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
181225
*/
@@ -188,7 +232,7 @@ private function putFile(FilepondModel $filepond, string $path, string $disk, st
188232
Storage::disk($permanentDisk)->writeStream(
189233
$pathInfo['dirname'].DIRECTORY_SEPARATOR.$pathInfo['filename'].'.'.$filepond->extension,
190234
Storage::disk($this->getTempDisk())->readStream($filepond->filepath),
191-
$visibility !== '' ? ['visibility' => $visibility] : [],
235+
$visibility !== '' ? ['visibility' => $visibility] : []
192236
);
193237

194238
return [

0 commit comments

Comments
 (0)