More refactoring

This commit is contained in:
Oliver Davies 2020-05-22 23:02:22 +01:00
parent 5aa1f79279
commit dca7125df1
3 changed files with 17 additions and 22 deletions

View file

@ -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();
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}