Skip to content

Commit 82890f3

Browse files
authored
refactor(check-ins): checkins to check-ins (#115)
* refactor(check-ins): checkins to check-ins * chore: update composer.json * chore: update CHANGELOG.md
1 parent 92bedda commit 82890f3

8 files changed

+37
-34
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.1] - 2023-11-16
10+
### Refactored
11+
- Check-Ins: checkins to check-ins
12+
913
## [3.18.0] - 2023-10-27
1014
### Added
1115
- Check-Ins: Add support for slug url

composer.json

Lines changed: 1 addition & 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.0",
25+
"honeybadger-io/honeybadger-php": "^2.17.2",
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",

src/Commands/HoneybadgerCheckinCommand.php renamed to src/Commands/HoneybadgerCheckInCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Honeybadger\Contracts\Reporter;
77
use Illuminate\Console\Command;
88

9-
class HoneybadgerCheckinCommand extends Command
9+
class HoneybadgerCheckInCommand extends Command
1010
{
1111
/**
1212
* The name and signature of the console command.
@@ -31,9 +31,9 @@ class HoneybadgerCheckinCommand extends Command
3131
public function handle(Reporter $honeybadger)
3232
{
3333
try {
34-
$idOrName = $this->checkinIdOrName();
34+
$idOrName = $this->checkInIdOrName();
3535
$honeybadger->checkin($idOrName);
36-
$this->info(sprintf('Checkin %s was sent to Honeybadger', $idOrName));
36+
$this->info(sprintf('Check-in %s was sent to Honeybadger', $idOrName));
3737
} catch (Exception $e) {
3838
$this->error($e->getMessage());
3939
}
@@ -44,7 +44,7 @@ public function handle(Reporter $honeybadger)
4444
*
4545
* @return string
4646
*/
47-
private function checkinIdOrName(): string
47+
private function checkInIdOrName(): string
4848
{
4949
return is_array($this->argument('id'))
5050
? $this->argument('id')[0]

src/Commands/HoneybadgerCheckinsSyncCommand.php renamed to src/Commands/HoneybadgerCheckInsSyncCommand.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Honeybadger\HoneybadgerLaravel\Commands;
44

5-
use Honeybadger\Contracts\SyncCheckins;
5+
use Honeybadger\Contracts\SyncCheckIns;
66
use Illuminate\Console\Command;
77

8-
class HoneybadgerCheckinsSyncCommand extends Command
8+
class HoneybadgerCheckInsSyncCommand extends Command
99
{
1010
/**
1111
* The name and signature of the console command.
@@ -19,18 +19,18 @@ class HoneybadgerCheckinsSyncCommand extends Command
1919
*
2020
* @var string
2121
*/
22-
protected $description = 'Synchronize checkins to Honeybadger';
22+
protected $description = 'Synchronize check-ins to Honeybadger';
2323

2424
/**
2525
* Execute the console command.
2626
*
2727
* @return mixed
2828
*/
29-
public function handle(SyncCheckins $checkinsManager)
29+
public function handle(SyncCheckIns $checkinsManager)
3030
{
31-
$localCheckins = config('honeybadger.checkins', []);
32-
$result = $checkinsManager->sync($localCheckins);
33-
$this->info('Checkins were synchronized with Honeybadger.');
31+
$localCheckIns = config('honeybadger.checkins', []);
32+
$result = $checkinsManager->sync($localCheckIns);
33+
$this->info('Check-ins were synchronized with Honeybadger.');
3434
$this->table(['Id', 'Name', 'Slug', 'Schedule Type', 'Report Period', 'Cron Schedule', 'Cron Timezone', 'Grace Period', 'Status'], array_map(function ($checkin) {
3535
return [
3636
$checkin->id,

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.0';
15+
const VERSION = '3.18.1';
1616

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

src/HoneybadgerServiceProvider.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@
33
namespace Honeybadger\HoneybadgerLaravel;
44

55
use GuzzleHttp\Client;
6-
use Honeybadger\CheckinsManager;
7-
use Honeybadger\Contracts\SyncCheckins;
8-
use Honeybadger\HoneybadgerLaravel\Commands\HoneybadgerCheckinsSyncCommand;
6+
use Honeybadger\CheckInsManager;
7+
use Honeybadger\Contracts\SyncCheckIns;
8+
use Honeybadger\HoneybadgerLaravel\Commands\HoneybadgerCheckInsSyncCommand;
99
use Honeybadger\LogHandler;
1010
use Honeybadger\Honeybadger;
1111
use Honeybadger\Contracts\Reporter;
1212
use Honeybadger\Exceptions\ServiceException;
13-
use Honeybadger\HoneybadgerLaravel\Commands\HoneybadgerCheckinCommand;
13+
use Honeybadger\HoneybadgerLaravel\Commands\HoneybadgerCheckInCommand;
1414
use Honeybadger\HoneybadgerLaravel\Commands\HoneybadgerDeployCommand;
1515
use Honeybadger\HoneybadgerLaravel\Commands\HoneybadgerInstallCommand;
1616
use Honeybadger\HoneybadgerLaravel\Commands\HoneybadgerTestCommand;
1717
use Honeybadger\HoneybadgerLaravel\Contracts\Installer as InstallerContract;
1818
use Illuminate\Console\Scheduling\Event;
1919
use Illuminate\Support\Facades\Blade;
20-
use Illuminate\Support\Facades\Log;
2120
use Illuminate\Support\ServiceProvider;
2221

2322
class HoneybadgerServiceProvider extends ServiceProvider
@@ -50,7 +49,7 @@ public function register()
5049
$this->mergeConfigFrom(__DIR__.'/../config/honeybadger.php', 'honeybadger');
5150

5251
$this->registerReporters();
53-
$this->registerCheckinsSync();
52+
$this->registerCheckInsSync();
5453

5554
$this->app->bind(LogHandler::class, function ($app) {
5655
return new LogHandler($app[Reporter::class]);
@@ -95,12 +94,12 @@ private function bindCommands()
9594

9695
$this->app->bind(
9796
'command.honeybadger:checkin',
98-
HoneybadgerCheckinCommand::class
97+
HoneybadgerCheckInCommand::class
9998
);
10099

101100
$this->app->bind(
102101
'command.honeybadger:checkins:sync',
103-
HoneybadgerCheckinsSyncCommand::class
102+
HoneybadgerCheckInsSyncCommand::class
104103
);
105104

106105
$this->app->bind(
@@ -185,10 +184,10 @@ protected function setUpAutomaticBreadcrumbs()
185184
}
186185
}
187186

188-
protected function registerCheckinsSync(): void
187+
protected function registerCheckInsSync(): void
189188
{
190-
$this->app->singleton(SyncCheckins::class, function ($app) {
191-
return new CheckinsManager($app['config']['honeybadger']);
189+
$this->app->singleton(SyncCheckIns::class, function ($app) {
190+
return new CheckInsManager($app['config']['honeybadger']);
192191
});
193192
}
194193

tests/Commands/HoneybadgerCheckinCommandTest.php renamed to tests/Commands/HoneybadgerCheckInCommandTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
use Exception;
66
use Honeybadger\Contracts\Reporter;
77
use Honeybadger\Honeybadger;
8-
use Honeybadger\HoneybadgerLaravel\Commands\HoneybadgerCheckinCommand;
8+
use Honeybadger\HoneybadgerLaravel\Commands\HoneybadgerCheckInCommand;
99
use Honeybadger\Tests\TestCase;
1010
use Illuminate\Contracts\Console\Kernel;
1111
use Illuminate\Support\Facades\Config;
1212

13-
class HoneybadgerCheckinCommandTest extends TestCase
13+
class HoneybadgerCheckInCommandTest extends TestCase
1414
{
1515
protected function setUp(): void
1616
{
@@ -37,14 +37,14 @@ public function it_outputs_success()
3737
$mock = $this->createMock(Reporter::class);
3838
$this->app->instance(Honeybadger::class, $mock);
3939

40-
$command = $this->getMockBuilder(HoneybadgerCheckinCommand::class)
40+
$command = $this->getMockBuilder(HoneybadgerCheckInCommand::class)
4141
->disableOriginalClone()
4242
->setMethods(['info'])
4343
->getMock();
4444

4545
$command->expects($this->once())
4646
->method('info')
47-
->with('Checkin 1234 was sent to Honeybadger');
47+
->with('Check-in 1234 was sent to Honeybadger');
4848

4949
$this->app[Kernel::class]->registerCommand($command);
5050

@@ -60,7 +60,7 @@ public function it_outputs_an_error()
6060

6161
$this->app->instance(Reporter::class, $mock);
6262

63-
$command = $this->getMockBuilder(HoneybadgerCheckinCommand::class)
63+
$command = $this->getMockBuilder(HoneybadgerCheckInCommand::class)
6464
->disableOriginalClone()
6565
->setMethods(['error'])
6666
->getMock();

tests/Commands/HoneybadgerCheckinsSyncCommandTest.php renamed to tests/Commands/HoneybadgerCheckInsSyncCommandTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Honeybadger\Tests\Commands;
44

5-
use Honeybadger\Contracts\SyncCheckins;
5+
use Honeybadger\Contracts\SyncCheckIns;
66
use Honeybadger\Tests\TestCase;
77
use Illuminate\Support\Facades\Config;
88

9-
class HoneybadgerCheckinsSyncCommandTest extends TestCase
9+
class HoneybadgerCheckInsSyncCommandTest extends TestCase
1010
{
1111
const CHECKINS = [
1212
[
@@ -33,14 +33,14 @@ protected function setUp(): void
3333
}
3434

3535
/** @test */
36-
public function it_reads_checkins_from_config()
36+
public function it_reads_check_ins_from_config()
3737
{
38-
$mock = $this->createMock(SyncCheckins::class);
38+
$mock = $this->createMock(SyncCheckIns::class);
3939
$mock->expects($this->once())
4040
->method('sync')
4141
->with(self::CHECKINS);
4242

43-
$this->app->instance(SyncCheckins::class, $mock);
43+
$this->app->instance(SyncCheckIns::class, $mock);
4444

4545
$this->artisan('honeybadger:checkins:sync');
4646
}

0 commit comments

Comments
 (0)