Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some improvements #140

Merged
merged 12 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Checks/Checks/MeiliSearchCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

class MeiliSearchCheck extends Check
{
public int $timeout = 1;
protected int $timeout = 1;

public string $url = 'http://127.0.0.1:7700/health';
protected string $url = 'http://127.0.0.1:7700/health';

public function timeout(int $seconds): self
{
Expand Down
12 changes: 6 additions & 6 deletions src/Checks/Checks/PingCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

class PingCheck extends Check
{
public ?string $url = null;
protected ?string $url = null;

public ?string $failureMessage = null;
protected ?string $failureMessage = null;

public int $timeout = 1;
protected int $timeout = 1;

public int $retryTimes = 1;
protected int $retryTimes = 1;

public string $method = 'GET';
protected string $method = 'GET';

/** @var array<string, string> */
public array $headers = [];
protected array $headers = [];

public function url(string $url): self
{
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/ListHealthChecksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

class ListHealthChecksCommand extends Command
{
public $signature = 'health:list {--fresh} {--do-not-store-results} {--no-notification}
protected $signature = 'health:list {--fresh} {--do-not-store-results} {--no-notification}
{--fail-command-on-failing-check}';

public $description = 'List all health checks';
protected $description = 'List all health checks';

public function handle(): int
{
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/RunHealthChecksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

class RunHealthChecksCommand extends Command
{
public $signature = 'health:check {--do-not-store-results} {--no-notification} {--fail-command-on-failing-check}';
protected $signature = 'health:check {--do-not-store-results} {--no-notification} {--fail-command-on-failing-check}';

public $description = 'Run all health checks';
protected $description = 'Run all health checks';

/** @var array<int, Exception> */
protected array $thrownExceptions = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Health.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Health
protected array $checks = [];

/** @var array<int, string> */
public array $inlineStylesheets = [];
protected array $inlineStylesheets = [];

/** @param array<int, Check> $checks */
public function checks(array $checks): self
Expand Down
2 changes: 1 addition & 1 deletion src/Models/HealthCheckResultHistoryItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class HealthCheckResultHistoryItem extends Model
use HasFactory;
use MassPrunable;

public $guarded = [];
protected $guarded = [];

/** @var array<string,string> */
public $casts = [
Expand Down
4 changes: 2 additions & 2 deletions src/ResultStores/StoredCheckResults/StoredCheckResults.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public static function fromJson(string $json): StoredCheckResults
}

/**
* @param \DateTimeInterface|null $finishedAt
* @param DateTimeInterface|null $finishedAt
* @param ?Collection<int, StoredCheckResult> $checkResults
*/
public function __construct(
DateTimeInterface $finishedAt = null,
?DateTimeInterface $finishedAt = null,
?Collection $checkResults = null
) {
$this->finishedAt = $finishedAt ?? new DateTime();
Expand Down
2 changes: 1 addition & 1 deletion tests/Checks/HorizonCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
expect($result)
->status->toBe(Status::failed())
->notificationMessage->toBe('Horizon is not running.');
});
})->skip(fn () => extension_loaded('redis') !== true, 'The redis extension is not loaded.');

it('will send a warning when horizon is paused', function () {
$this->fakeHorizonStatus('paused');
Expand Down
2 changes: 1 addition & 1 deletion tests/Checks/RedisCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$result = RedisCheck::new()->run();

expect($result->status)->toBe(Status::ok());
});
})->skip(fn () => extension_loaded('redis') !== true, 'The redis extension is not loaded.');

it('will return an error when it cannot connect to Redis', function () {
$result = FakeRedisCheck::new()
Expand Down