41 lines
882 B
PHP
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(),
|
|
];
|
|
}
|
|
}
|