Skip to content

Commit 5ca772a

Browse files
committed
added method comments and type hints
1 parent a3697d6 commit 5ca772a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

app/V1Module/presenters/base/BasePresenter.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use App\Responses\StorageFileResponse;
2727
use App\Responses\ZipFilesResponse;
2828
use Nette\Application\Application;
29+
use Nette\Http\FileUpload;
2930
use Nette\Http\IResponse;
3031
use Tracy\ILogger;
3132
use ReflectionClass;
@@ -347,7 +348,12 @@ private function getPostField($param, $required = true)
347348
}
348349
}
349350

350-
private function getFileField($required = true)
351+
/**
352+
* @param bool $required Whether the file field is required.
353+
* @throws BadRequestException Thrown when the number of files is not 1 (and the field is required).
354+
* @return FileUpload|null Returns a FileUpload object or null if the file was optional and not sent.
355+
*/
356+
private function getFileField(bool $required = true): FileUpload | null
351357
{
352358
$req = $this->getRequest();
353359
$files = $req->getFiles();

0 commit comments

Comments
 (0)