uiharu/src/Lookup/TwitterLookupResult.php

52 lines
1.2 KiB
PHP

<?php
namespace Uiharu\Lookup;
use RuntimeException;
use Uiharu\Url;
use Index\MediaType;
abstract class TwitterLookupResult implements \Uiharu\ILookupResult {
private Url $url;
public function __construct(Url $url) {
$this->url = $url;
}
public function getUrl(): Url {
return $this->url;
}
public abstract function getObjectType(): string;
public function hasMediaType(): bool {
return false;
}
public function getMediaType(): MediaType {
throw new RuntimeException('Unsupported');
}
public function hasColour(): bool {
return true;
}
public function getColour(): int {
return 0x1DA1F2;
}
public abstract function hasTitle(): bool;
public abstract function getTitle(): string;
public function hasSiteName(): bool {
return true;
}
public function getSiteName(): string {
return 'Twitter';
}
public abstract function hasDescription(): bool;
public abstract function getDescription(): string;
public abstract function hasPreviewImage(): bool;
public abstract function getPreviewImage(): string;
public abstract function getTwitterResult(): object;
}