More refactoring
This commit is contained in:
parent
5aa1f79279
commit
dca7125df1
|
@ -16,16 +16,16 @@ class Event
|
|||
return new static($data);
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getLink(): string
|
||||
{
|
||||
return rtrim($this->link, '/');
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
protected function __construct(array $data)
|
||||
{
|
||||
[
|
||||
|
@ -36,9 +36,4 @@ class Event
|
|||
$this->name = $name;
|
||||
$this->link = $link;
|
||||
}
|
||||
|
||||
public function getRsvps(): Collection
|
||||
{
|
||||
return new Collection();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,11 +9,11 @@ use Tightenco\Collect\Support\Collection;
|
|||
|
||||
final class Result
|
||||
{
|
||||
private Winner $winner;
|
||||
private Collection $rsvps;
|
||||
|
||||
private Event $event;
|
||||
|
||||
private Collection $rsvps;
|
||||
private Winner $winner;
|
||||
|
||||
public function __construct(
|
||||
Winner $winner,
|
||||
|
@ -25,11 +25,6 @@ final class Result
|
|||
$this->rsvps = $rsvps;
|
||||
}
|
||||
|
||||
public function getWinner(): Winner
|
||||
{
|
||||
return $this->winner;
|
||||
}
|
||||
|
||||
public function getEvent(): Event
|
||||
{
|
||||
return $this->event;
|
||||
|
@ -39,4 +34,9 @@ final class Result
|
|||
{
|
||||
return $this->rsvps;
|
||||
}
|
||||
|
||||
public function getWinner(): Winner
|
||||
{
|
||||
return $this->winner;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,11 @@ final class Winner
|
|||
return $this->name;
|
||||
}
|
||||
|
||||
public function getPhoto(): ?string
|
||||
{
|
||||
return $this->photo ?? null;
|
||||
}
|
||||
|
||||
protected function __construct(array $data)
|
||||
{
|
||||
[
|
||||
|
@ -31,9 +36,4 @@ final class Winner
|
|||
$this->name = $name;
|
||||
$this->photo = $photo['photo_link'];
|
||||
}
|
||||
|
||||
public function getPhoto(): ?string
|
||||
{
|
||||
return $this->photo ?? null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue