This repository has been archived on 2023-10-21. You can view files and clone it, but cannot push or open issues or pull requests.
patchouli/src/Dummy/DummyPackageFile.php
2020-12-29 02:40:16 +00:00

41 lines
882 B
PHP

<?php
namespace Patchouli\Dummy;
use Patchouli\IPackageFile;
use UnexpectedValueException;
class DummyPackageFile implements IPackageFile {
private string $filename;
public function __construct(string $filename) {
$this->filename = $filename;
}
public function getFileName(): string {
return $this->filename;;
}
public function getFileType(): string {
return 'application/octet-stream';
}
public function isRemote(): bool {
return true;
}
public function getRemoteUrl(): string {
return 'http://flash.moe/assets/errors/404.jpg';
}
public function getLocalStream() {
throw new UnexpectedValueException;
}
public function fwifSerialize(): array {
return [
'name' => $this->getFileName(),
'type' => $this->getFileType(),
];
}
}