Skip to content

Commit 4488bca

Browse files
committed
2 parents 853fb5e + 65a62ae commit 4488bca

File tree

14 files changed

+20
-25
lines changed

14 files changed

+20
-25
lines changed

config/laravel-uptime-monitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
*/
4545
'notifiable' => \Spatie\UptimeMonitor\Notifications\Notifiable::class,
4646

47-
/**
47+
/*
4848
* The date format used in notifications.
4949
*/
5050
'date_format' => 'd/m/Y',

src/Exceptions/CannotSaveMonitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ class CannotSaveMonitor extends Exception
1010
public static function alreadyExists(Monitor $monitor)
1111
{
1212
return new static("Could not save a monitor for url `{$monitor->url}` because there already exists another monitor with the same url. ".
13-
"Try saving a monitor with a different url.");
13+
'Try saving a monitor with a different url.');
1414
}
1515
}

src/Helpers/Period.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public function toText(): string
3636
$configuredDateFormat = config('laravel-uptime-monitor.notifications.date_format');
3737

3838
return
39-
$this->startDateTime->format('H:i') . " "
40-
. ($this->startDateTime->isToday() ? "" : "on {$this->startDateTime->format($configuredDateFormat)} ")
41-
. Emoji::rightwardsArrow() . " "
42-
. $this->endDateTime->format('H:i')
43-
. ($this->endDateTime->isToday() ? '' : " on {$this->endDateTime->format($configuredDateFormat)}");
39+
$this->startDateTime->format('H:i').' '
40+
.($this->startDateTime->isToday() ? '' : "on {$this->startDateTime->format($configuredDateFormat)} ")
41+
.Emoji::rightwardsArrow().' '
42+
.$this->endDateTime->format('H:i')
43+
.($this->endDateTime->isToday() ? '' : " on {$this->endDateTime->format($configuredDateFormat)}");
4444
}
45-
}
45+
}

src/Helpers/UptimeResponseCheckers/LookForStringChecker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ public function isValidResponse(ResponseInterface $response, Monitor $monitor):
1313
return true;
1414
}
1515

16-
return str_contains((string)$response->getBody(), $monitor->look_for_string);
16+
return str_contains((string) $response->getBody(), $monitor->look_for_string);
1717
}
1818

1919
public function getFailureReason(ResponseInterface $response, Monitor $monitor): string
2020
{
2121
return "String `{$monitor->look_for_string}` was not found on the response.";
2222
}
23-
}
23+
}

src/Helpers/UptimeResponseCheckers/UptimeResponseChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ interface UptimeResponseChecker
1010
public function isValidResponse(ResponseInterface $response, Monitor $monitor) : bool;
1111

1212
public function getFailureReason(ResponseInterface $response, Monitor $monitor) : string;
13-
}
13+
}

src/Models/Monitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function scopeEnabled($query)
4444
public function getUrlAttribute()
4545
{
4646
if (! isset($this->attributes['url'])) {
47-
return null;
47+
return;
4848
}
4949

5050
return Url::fromString($this->attributes['url']);

src/Models/Traits/SupportsUptimeCheck.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Spatie\UptimeMonitor\Events\UptimeCheckRecovered;
99
use Spatie\UptimeMonitor\Events\UptimeCheckSucceeded;
1010
use Spatie\UptimeMonitor\Helpers\Period;
11-
use Spatie\UptimeMonitor\Helpers\UptimeResponseCheckers\LookForStringChecker;
1211
use Spatie\UptimeMonitor\Helpers\UptimeResponseCheckers\UptimeResponseChecker;
1312
use Spatie\UptimeMonitor\Models\Monitor;
1413
use Spatie\UptimeMonitor\Models\Enums\UptimeStatus;

src/Notifications/BaseNotification.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract class BaseNotification extends Notification
1515
*/
1616
public function via($notifiable)
1717
{
18-
return config('laravel-uptime-monitor.notifications.notifications.' . static::class);
18+
return config('laravel-uptime-monitor.notifications.notifications.'.static::class);
1919
}
2020

2121
public function getMonitorProperties($extraProperties = []): array
@@ -25,7 +25,6 @@ public function getMonitorProperties($extraProperties = []): array
2525
$properties = array_merge([], $extraProperties);
2626

2727
if ($monitor->certificate_check_enabled && $monitor->certificate_status === CertificateStatus::VALID) {
28-
2928
$certificateTitle = "Certificate expires in {$monitor->formattedCertificateExpirationDate('forHumans')}";
3029
$certificateIssuer = $monitor->certificate_issuer;
3130

src/Notifications/Notifications/CertificateCheckFailed.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,4 @@ public function getMessageText(): string
6161
{
6262
return "{$this->event->monitor->url} hasn't got a valid certificate{$this->getLocationDescription()}.";
6363
}
64-
6564
}

src/Notifications/Notifications/UptimeCheckFailed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function getMonitorProperties($extraProperties = []): array
5151

5252
$extraProperties = [
5353
$since => $date,
54-
"Failure reason" => $this->event->monitor->uptime_check_failure_reason,
54+
'Failure reason' => $this->event->monitor->uptime_check_failure_reason,
5555
];
5656

5757
return parent::getMonitorProperties($extraProperties);

0 commit comments

Comments
 (0)