mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 09:05:34 +08:00
use solution repository instead of built-in (#209)
* use solution repository instead of built-in * suppress static analysis
This commit is contained in:
30
src/ZM/Exception/Solution/Solution.php
Normal file
30
src/ZM/Exception/Solution/Solution.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZM\Exception\Solution;
|
||||
|
||||
class Solution
|
||||
{
|
||||
public function __construct(
|
||||
private string $title,
|
||||
private string $description,
|
||||
private array $links,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getSolutionTitle(): string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function getSolutionDescription(): string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function getDocumentationLinks(): array
|
||||
{
|
||||
return $this->links;
|
||||
}
|
||||
}
|
||||
22
src/ZM/Exception/Solution/SolutionRepository.php
Normal file
22
src/ZM/Exception/Solution/SolutionRepository.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/** @noinspection PhpUndefinedClassInspection */
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZM\Exception\Solution;
|
||||
|
||||
use NunoMaduro\Collision\Contracts\SolutionsRepository;
|
||||
|
||||
class SolutionRepository implements SolutionsRepository
|
||||
{
|
||||
/**
|
||||
* @return Solution[]
|
||||
*/
|
||||
public function getFromThrowable(\Throwable $throwable): array
|
||||
{
|
||||
return match ($throwable::class) {
|
||||
default => [],
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user