MultipartBodyRepository
class MultipartBodyRepository implements BodyRepository, MergeableBody
Traits
Properties
| protected MultipartValue> | $data | The multipart values. |
|
| protected string | $boundary | The multipart boundary. |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Create a multipart body repository.
Set the repository value.
Merge arrays into the repository.
Add an element to the repository.
Get the raw data in the repository.
Get values with the given name.
Remove an item from the repository.
Determine if the repository is empty.
Determine if the repository is not empty.
Parse a multipart array.
Get the multipart boundary.
Get the boundary-aware multipart content type.
Convert the body repository into a stream.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
at line 37
__construct(array $value = [], string|null $boundary = null)
Create a multipart body repository.
at line 50
BodyRepository
set(mixed $value)
Set the repository value.
at line 67
MergeableBody
merge(array ...$arrays)
Merge arrays into the repository.
at line 83
MultipartBodyRepository
add(string $name, mixed $contents, string|null $filename = null, array $headers = [])
Add an element to the repository.
at line 95
MultipartBodyRepository
attach(MultipartValue $file)
Attach a multipart value.
at line 107
mixed
all()
Get the raw data in the repository.
at line 115
mixed
get(string $key, mixed $default = null)
Get values with the given name.
at line 137
MultipartBodyRepository
remove(string $key)
Remove an item from the repository.
at line 151
bool
isEmpty()
Determine if the repository is empty.
at line 159
bool
isNotEmpty()
Determine if the repository is not empty.
at line 170
protected array
parseMultipartArray(array $value)
Parse a multipart array.
at line 184
string
boundary()
Get the multipart boundary.
at line 192
string
contentType()
Get the boundary-aware multipart content type.
at line 200
StreamInterface
toStream()
Convert the body repository into a stream.