generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add check 'requireVarsMatchValues' - wip
- Loading branch information
Showing
6 changed files
with
181 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Encodia\Health\Checks; | ||
|
||
final class CheckResultDto | ||
{ | ||
public function __construct( | ||
public bool $ok, | ||
/** @var array<string,mixed> */ | ||
public array $meta, | ||
public string $summary, | ||
public string $message | ||
) { | ||
// | ||
} | ||
|
||
public static function ok(): self | ||
{ | ||
return new self( | ||
ok: true, | ||
meta: [], | ||
summary: '', | ||
message: '' | ||
); | ||
} | ||
|
||
/** | ||
* @param array<string,mixed> $meta | ||
*/ | ||
public static function error(array $meta, string $summary, string $message): self | ||
{ | ||
return new self( | ||
ok: false, | ||
meta: $meta, | ||
summary: $summary, | ||
message: $message | ||
); | ||
} | ||
|
||
public function hasFailed(): bool | ||
{ | ||
return ! $this->ok; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters