Skip to content

Commit

Permalink
chore: revert command argument for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
subzero10 committed Oct 13, 2023
1 parent 6e87089 commit 2dacde4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Commands/HoneybadgerCheckinCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ class HoneybadgerCheckinCommand extends Command
{
/**
* The name and signature of the console command.
* "id" can be the check-in ID or the check-in name.
*
* @var string
*/
protected $signature = 'honeybadger:checkin {idOrName}';
protected $signature = 'honeybadger:checkin {id}';

/**
* The console command description.
Expand All @@ -30,8 +31,9 @@ class HoneybadgerCheckinCommand extends Command
public function handle(Reporter $honeybadger)
{
try {
$honeybadger->checkin($this->checkinIdOrName());
$this->info(sprintf('Checkin %s was sent to Honeybadger', $this->argument('id')));
$idOrName = $this->checkinIdOrName();
$honeybadger->checkin($idOrName);
$this->info(sprintf('Checkin %s was sent to Honeybadger', $idOrName));
} catch (Exception $e) {
$this->error($e->getMessage());
}
Expand All @@ -44,8 +46,8 @@ public function handle(Reporter $honeybadger)
*/
private function checkinIdOrName(): string
{
return is_array($this->argument('idOrName'))
? $this->argument('idOrName')[0]
: $this->argument('idOrName');
return is_array($this->argument('id'))
? $this->argument('id')[0]
: $this->argument('id');
}
}

0 comments on commit 2dacde4

Please sign in to comment.