From cb9963c8900abf93be80d52c8fc53ae66daa959d Mon Sep 17 00:00:00 2001 From: Pangratios Cosma Date: Fri, 27 Oct 2023 12:59:58 +0300 Subject: [PATCH] feat(check-ins): add support for slug configuration --- CHANGELOG.md | 4 ++++ src/Checkin.php | 10 ++++++++++ src/Honeybadger.php | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7e0f01..f8f1b71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [2.17.0] - 2023-10-27 +### Added +- Check-Ins: Support for slug configuration within the package + ## [2.16.0] - 2023-10-17 ### Added - Allow calling the checkin method with a checkin id or name diff --git a/src/Checkin.php b/src/Checkin.php index b0f2183..16beed7 100644 --- a/src/Checkin.php +++ b/src/Checkin.php @@ -23,6 +23,13 @@ class Checkin */ public $name; + /** + * Checkin slug. + * + * @var string|null + */ + public $slug; + /** * Valid values are "simple" or "cron". * If you specify "cron", then the "cron_schedule" field is required. @@ -82,6 +89,7 @@ class Checkin public function __construct(array $params = []) { $this->id = $params['id'] ?? null; $this->name = $params['name'] ?? null; + $this->slug = $params['slug'] ?? null; $this->scheduleType = $params['schedule_type'] ?? null; $this->reportPeriod = $params['report_period'] ?? null; $this->gracePeriod = $params['grace_period'] ?? null; @@ -132,6 +140,7 @@ public function asRequestData(): array { $result = [ 'name' => $this->name, + 'slug' => $this->slug, 'schedule_type' => $this->scheduleType, 'report_period' => $this->reportPeriod, 'grace_period' => $this->gracePeriod, @@ -151,6 +160,7 @@ public function asRequestData(): array */ public function isInSync(Checkin $other): bool { return $this->name === $other->name + && $this->slug === $other->slug && $this->projectId === $other->projectId && $this->scheduleType === $other->scheduleType && $this->reportPeriod === $other->reportPeriod diff --git a/src/Honeybadger.php b/src/Honeybadger.php index c6056c6..f820e75 100644 --- a/src/Honeybadger.php +++ b/src/Honeybadger.php @@ -20,7 +20,7 @@ class Honeybadger implements Reporter /** * SDK Version. */ - const VERSION = '2.16.0'; + const VERSION = '2.17.0'; /** * Honeybadger API URL.