Added hasUploadedFile method to FormContent.
This commit is contained in:
parent
208446b544
commit
6a38f803f4
2 changed files with 6 additions and 2 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
0.2308.212025
|
0.2308.220004
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
// FormContent.php
|
// FormContent.php
|
||||||
// Created: 2022-02-10
|
// Created: 2022-02-10
|
||||||
// Updated: 2023-08-21
|
// Updated: 2023-08-22
|
||||||
|
|
||||||
namespace Index\Http\Content;
|
namespace Index\Http\Content;
|
||||||
|
|
||||||
|
@ -35,6 +35,10 @@ class FormContent implements IHttpContent {
|
||||||
return http_build_query($this->postFields, '', '&', $spacesAsPlus ? PHP_QUERY_RFC1738 : PHP_QUERY_RFC3986);
|
return http_build_query($this->postFields, '', '&', $spacesAsPlus ? PHP_QUERY_RFC1738 : PHP_QUERY_RFC3986);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hasUploadedFile(string $name): bool {
|
||||||
|
return isset($this->uploadedFiles[$name]);
|
||||||
|
}
|
||||||
|
|
||||||
public function getUploadedFile(string $name): HttpUploadedFile {
|
public function getUploadedFile(string $name): HttpUploadedFile {
|
||||||
if(!isset($this->uploadedFiles[$name]))
|
if(!isset($this->uploadedFiles[$name]))
|
||||||
throw new RuntimeException('No file with name $name present.');
|
throw new RuntimeException('No file with name $name present.');
|
||||||
|
|
Loading…
Reference in a new issue