-
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.
refactor(telescope): improve storage driver configuration (#794)
* refactor(telescope): improve storage driver configuration - Add NullEntriesRepository as default storage driver - Rename compatibility method for legacy config - Update storage driver configuration structure - Fix storage options merging with default values * Fix --------- Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
- Loading branch information
1 parent
cb797d4
commit 7c3d244
Showing
3 changed files
with
96 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of friendsofhyperf/components. | ||
* | ||
* @link https://github.com/friendsofhyperf/components | ||
* @document https://github.com/friendsofhyperf/components/blob/main/README.md | ||
* @contact huangdijia@gmail.com | ||
*/ | ||
|
||
namespace FriendsOfHyperf\Telescope\Storage; | ||
|
||
use Carbon\Carbon; | ||
use DateTimeInterface; | ||
use FriendsOfHyperf\Telescope\Contract\ClearableRepository; | ||
use FriendsOfHyperf\Telescope\Contract\EntriesRepository; | ||
use FriendsOfHyperf\Telescope\Contract\PrunableRepository; | ||
use FriendsOfHyperf\Telescope\Contract\TerminableRepository; | ||
use FriendsOfHyperf\Telescope\EntryResult; | ||
|
||
use function Hyperf\Collection\collect; | ||
|
||
class NullEntriesRepository implements EntriesRepository, ClearableRepository, PrunableRepository, TerminableRepository | ||
{ | ||
public function store($entries): void | ||
{ | ||
} | ||
|
||
public function update($updates) | ||
{ | ||
} | ||
|
||
public function get(?string $type, EntryQueryOptions $options) | ||
{ | ||
return collect(); | ||
} | ||
|
||
public function find($id): EntryResult | ||
{ | ||
return new EntryResult( | ||
id: null, | ||
sequence: null, | ||
batchId: '', | ||
type: '', | ||
familyHash: '', | ||
content: [], | ||
createdAt: Carbon::now(), | ||
); | ||
} | ||
|
||
public function loadMonitoredTags(): void | ||
{ | ||
} | ||
|
||
public function isMonitoring(array $tags): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function monitoring(): array | ||
{ | ||
return []; | ||
} | ||
|
||
public function monitor(array $tags): void | ||
{ | ||
} | ||
|
||
public function stopMonitoring(array $tags): void | ||
{ | ||
} | ||
|
||
public function clear(): void | ||
{ | ||
} | ||
|
||
public function prune(DateTimeInterface $before, bool $keepExceptions): int | ||
{ | ||
return 0; | ||
} | ||
|
||
public function terminate(): void | ||
{ | ||
} | ||
} |
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