Download src/Plugin/Domain/ValueObjects/SupportChannel.php from pnacorp/AIKEEDO: direct link, hf CLI and curl.
- Browser
- Download file 727 Bytes
-
https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Plugin/Domain/ValueObjects/SupportChannel.php
- Command line
-
hf download hf://pnacorp/AIKEEDO/src/Plugin/Domain/ValueObjects/SupportChannel.php
-
curl -L -o SupportChannel.php https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Plugin/Domain/ValueObjects/SupportChannel.php
727 Bytes
| declare(strict_types=1); | |
| namespace Plugin\Domain\ValueObjects; | |
| use JsonSerializable; | |
| class SupportChannel implements JsonSerializable | |
| { | |
| public readonly SupportChannelType $type; | |
| public readonly Email|Url $value; | |
| public function __construct( | |
| string|SupportChannelType $type, | |
| string $value | |
| ) { | |
| $this->type = $type instanceof SupportChannelType | |
| ? $type : SupportChannelType::from($type); | |
| $this->value = $this->type == SupportChannelType::EMAIL | |
| ? new Email($value) : new Url($value); | |
| } | |
| public function jsonSerialize(): array | |
| { | |
| return [ | |
| 'type' => $this->type, | |
| 'value' => $this->value | |
| ]; | |
| } | |
| } | |