uiharu/src/Lookup/WebLookupFallbackResult.php

56 lines
1.3 KiB
PHP

<?php
namespace Uiharu\Lookup;
use RuntimeException;
use Uiharu\Url;
use Index\MediaType;
use Index\Colour\Colour;
class WebLookupFallbackResult extends WebLookupResult {
private string $title;
public function __construct(Url $url, MediaType $mediaType, string $title) {
parent::__construct($url, $mediaType);
$this->title = $title;
}
public function getObjectType(): string {
return 'unknown';
}
public function hasColour(): bool {
return false;
}
public function getColour(): Colour {
throw new RuntimeException('Unsupported.');
}
public function hasTitle(): bool {
return true;
}
public function getTitle(): string {
return $this->title;
}
public function hasSiteName(): bool {
return false;
}
public function getSiteName(): string {
throw new RuntimeException('Unsupported.');
}
public function hasDescription(): bool {
return false;
}
public function getDescription(): string {
throw new RuntimeException('Unsupported.');
}
public function hasPreviewImage(): bool {
return false;
}
public function getPreviewImage(): string {
throw new RuntimeException('Unsupported.');
}
}