37 lines
712 B
PHP
37 lines
712 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace KTXF\Resource;
|
|
|
|
/**
|
|
* Carries file-like binary content metadata and a byte stream.
|
|
*/
|
|
final class BinaryResource
|
|
{
|
|
public function __construct(
|
|
private readonly string $filename,
|
|
private readonly string $mimeType,
|
|
private readonly \Generator $stream,
|
|
) {}
|
|
|
|
public function filename(): string
|
|
{
|
|
return $this->filename;
|
|
}
|
|
|
|
public function mimeType(): string
|
|
{
|
|
return $this->mimeType;
|
|
}
|
|
|
|
public function stream(): \Generator
|
|
{
|
|
return $this->stream;
|
|
}
|
|
} |