Skip to content

Commit 764f4df

Browse files
authored
feat: conform to latest check-ins configuration api (#116)
* feat: conform to latest check-ins configuration api * chore: add changelog * chore: bump version
1 parent 82890f3 commit 764f4df

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [3.18.2] - 2023-12-28
10+
### Refactored
11+
- Check-Ins: check-in using slug
12+
913
## [3.18.1] - 2023-11-16
1014
### Refactored
1115
- Check-Ins: checkins to check-ins

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
],
2323
"require": {
2424
"php": "^7.2|^8.0",
25-
"honeybadger-io/honeybadger-php": "^2.17.2",
25+
"honeybadger-io/honeybadger-php": "^2.18.0",
2626
"sixlive/dotenv-editor": "^1.1|^2.0",
2727
"illuminate/console": "^7.0|^8.0|^9.0|^10.0",
2828
"illuminate/support": "^7.0|^8.0|^9.0|^10.0",
@@ -61,5 +61,10 @@
6161
"Honeybadger": "Honeybadger\\HoneybadgerLaravel\\Facades\\Honeybadger"
6262
}
6363
}
64+
},
65+
"repositories": [{
66+
"type": "git",
67+
"url": "https://github.com/honeybadger-io/honeybadger-php.git"
6468
}
69+
]
6570
}

src/Commands/HoneybadgerCheckInCommand.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class HoneybadgerCheckInCommand extends Command
1010
{
1111
/**
1212
* The name and signature of the console command.
13-
* "id" can be the check-in ID or the check-in name.
13+
* "id" can be the check-in ID or the check-in slug.
1414
*
1515
* @var string
1616
*/
@@ -31,20 +31,15 @@ class HoneybadgerCheckInCommand extends Command
3131
public function handle(Reporter $honeybadger)
3232
{
3333
try {
34-
$idOrName = $this->checkInIdOrName();
35-
$honeybadger->checkin($idOrName);
36-
$this->info(sprintf('Check-in %s was sent to Honeybadger', $idOrName));
34+
$idOrSlug = $this->checkInIdOrSlug();
35+
$honeybadger->checkin($idOrSlug);
36+
$this->info(sprintf('Check-in %s was sent to Honeybadger', $idOrSlug));
3737
} catch (Exception $e) {
3838
$this->error($e->getMessage());
3939
}
4040
}
4141

42-
/**
43-
* Get the API key from input.
44-
*
45-
* @return string
46-
*/
47-
private function checkInIdOrName(): string
42+
private function checkInIdOrSlug(): string
4843
{
4944
return is_array($this->argument('id'))
5045
? $this->argument('id')[0]

src/HoneybadgerLaravel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class HoneybadgerLaravel extends Honeybadger
1414
{
15-
const VERSION = '3.18.1';
15+
const VERSION = '3.18.2';
1616

1717
// Don't forget to sync changes to this with the config file defaults
1818
const DEFAULT_BREADCRUMBS = [

tests/Commands/HoneybadgerCheckInsSyncCommandTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ class HoneybadgerCheckInsSyncCommandTest extends TestCase
1010
{
1111
const CHECKINS = [
1212
[
13-
'project_id' => 'p1234',
14-
'name' => 'simple checkin test',
13+
'slug' => 'simple-checkin-test',
1514
'scheduleType' => 'simple',
1615
'report_period' => '1 day',
1716
],
1817
[
19-
'project_id' => 'p1234',
20-
'name' => 'cron checkin test',
18+
'slug' => 'cron-checkin-test',
2119
'scheduleType' => 'cron',
2220
'cron_schedule' => '0 * * * *',
2321
],

0 commit comments

Comments
 (0)