| 1: | <?php |
| 2: | declare(strict_types=1); |
| 3: | |
| 4: | namespace om\ICal\Value; |
| 5: | |
| 6: | use om\ICal\Parameters; |
| 7: | use Stringable; |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | final readonly class Link implements Stringable { |
| 14: | |
| 15: | |
| 16: | |
| 17: | public function __construct( |
| 18: | public string $value, |
| 19: | public Parameters $parameters, |
| 20: | ) { |
| 21: | } |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | public function valueType(): string { |
| 27: | return strtoupper($this->parameters->get('VALUE') ?? 'URI'); |
| 28: | } |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: | public function relation(): ?string { |
| 34: | return $this->parameters->get('LINKREL'); |
| 35: | } |
| 36: | |
| 37: | |
| 38: | public function label(): ?string { |
| 39: | return $this->parameters->get('LABEL'); |
| 40: | } |
| 41: | |
| 42: | |
| 43: | public function mediaType(): ?string { |
| 44: | return $this->parameters->get('FMTTYPE'); |
| 45: | } |
| 46: | |
| 47: | |
| 48: | public function language(): ?string { |
| 49: | return $this->parameters->get('LANGUAGE'); |
| 50: | } |
| 51: | |
| 52: | public function __toString(): string { |
| 53: | return $this->value; |
| 54: | } |
| 55: | } |
| 56: | |