Download src/Plugin/Domain/ValueObjects/Author.php from pnacorp/AIKEEDO: direct link, hf CLI and curl.
- Browser
- Download file 848 Bytes
-
https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Plugin/Domain/ValueObjects/Author.php
- Command line
-
hf download hf://pnacorp/AIKEEDO/src/Plugin/Domain/ValueObjects/Author.php
-
curl -L -o Author.php https://huggingface.co/pnacorp/AIKEEDO/resolve/main/src/Plugin/Domain/ValueObjects/Author.php
848 Bytes
| declare(strict_types=1); | |
| namespace Plugin\Domain\ValueObjects; | |
| use JsonSerializable; | |
| class Author implements JsonSerializable | |
| { | |
| public readonly AuthorName $name; | |
| public readonly Email $email; | |
| public readonly Url $homepage; | |
| public readonly Role $role; | |
| public function __construct( | |
| string $name, | |
| ?string $email = null, | |
| ?string $homepage = null, | |
| ?string $role = null | |
| ) { | |
| $this->name = new AuthorName($name); | |
| $this->email = new Email($email); | |
| $this->homepage = new Url($homepage); | |
| $this->role = new Role($role); | |
| } | |
| public function jsonSerialize(): mixed | |
| { | |
| return [ | |
| 'name' => $this->name, | |
| 'email' => $this->email, | |
| 'homepage' => $this->homepage, | |
| 'role' => $this->role | |
| ]; | |
| } | |
| } | |