Skip to content

Commit

Permalink
feat(check-ins): add support for slug configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
subzero10 committed Oct 27, 2023
2 parents 7e86aca + cb9963c commit 30bdfa0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions src/Checkin.php
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Honeybadger.php
Expand Up @@ -20,7 +20,7 @@ class Honeybadger implements Reporter
/**
* SDK Version.
*/
const VERSION = '2.16.0';
const VERSION = '2.17.0';

/**
* Honeybadger API URL.
Expand Down

0 comments on commit 30bdfa0

Please sign in to comment.