Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use existing $this->getMonitor() method for consistency #156

Merged
merged 1 commit into from
Oct 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Notifications/Notifications/CertificateExpiresSoon.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ public function setEvent(SoonExpiringSslCertificateFoundEvent $event)

protected function getMessageText(): string
{
return "SSL certificate for {$this->event->monitor->url} expires soon";
return "SSL certificate for {$this->getMonitor()->url} expires soon";
}
}
6 changes: 3 additions & 3 deletions src/Notifications/Notifications/UptimeCheckFailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ public function getMonitorProperties($extraProperties = []): array

$extraProperties = [
$since => $date,
'Failure reason' => $this->event->monitor->uptime_check_failure_reason,
'Failure reason' => $this->getMonitor()->uptime_check_failure_reason,
];

return parent::getMonitorProperties($extraProperties);
}

public function isStillRelevant(): bool
{
return $this->event->monitor->uptime_status == UptimeStatus::DOWN;
return $this->getMonitor()->uptime_status == UptimeStatus::DOWN;
}

public function setEvent(MonitorFailedEvent $event)
Expand All @@ -77,6 +77,6 @@ public function setEvent(MonitorFailedEvent $event)

protected function getMessageText(): string
{
return "{$this->event->monitor->url} seems down";
return "{$this->getMonitor()->url} seems down";
}
}
4 changes: 2 additions & 2 deletions src/Notifications/Notifications/UptimeCheckRecovered.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getMonitorProperties($extraProperties = []): array

public function isStillRelevant(): bool
{
return $this->event->monitor->uptime_status == UptimeStatus::UP;
return $this->getMonitor()->uptime_status == UptimeStatus::UP;
}

public function setEvent(MonitorRecoveredEvent $event)
Expand All @@ -72,6 +72,6 @@ public function setEvent(MonitorRecoveredEvent $event)

public function getMessageText(): string
{
return "{$this->event->monitor->url} has recovered after {$this->event->downtimePeriod->duration()}";
return "{$this->getMonitor()->url} has recovered after {$this->event->downtimePeriod->duration()}";
}
}
4 changes: 2 additions & 2 deletions src/Notifications/Notifications/UptimeCheckSucceeded.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function toSlack($notifiable)

public function isStillRelevant(): bool
{
return $this->event->monitor->uptime_status != UptimeStatus::DOWN;
return $this->getMonitor()->uptime_status != UptimeStatus::DOWN;
}

public function setEvent(MonitorSucceededEvent $event)
Expand All @@ -61,6 +61,6 @@ public function setEvent(MonitorSucceededEvent $event)

public function getMessageText(): string
{
return "{$this->event->monitor->url} is up";
return "{$this->getMonitor()->url} is up";
}
}