| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | namespace Nexus\Mcp\Core\Schema\Result; |
| 15: | |
| 16: | use Nexus\Assert\Assert; |
| 17: | use Nexus\Mcp\Core\Schema\Enum\CacheScope; |
| 18: | use Nexus\Mcp\Core\Schema\MetaObject; |
| 19: | use Nexus\Mcp\Core\Schema\Result; |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: | |
| 30: | abstract readonly class CacheableResult extends Result |
| 31: | { |
| 32: | public function __construct( |
| 33: | public int $ttlMs, |
| 34: | public CacheScope $cacheScope, |
| 35: | MetaObject $meta = new MetaObject(), |
| 36: | ) { |
| 37: | Assert::that($this->ttlMs)->isNaturalInt('"result.ttlMs" must be a non-negative integer, {value} given.'); |
| 38: | |
| 39: | parent::__construct(meta: $meta); |
| 40: | } |
| 41: | } |
| 42: | |