| 1 |
<?php |
| 2 |
/** |
| 3 |
* The meta writer contract. |
| 4 |
* |
| 5 |
* @package SolidWP\Performance |
| 6 |
*/ |
| 7 |
|
| 8 |
declare( strict_types=1 ); |
| 9 |
|
| 10 |
namespace SolidWP\Performance\Page_Cache\Meta\Contracts; |
| 11 |
|
| 12 |
use SolidWP\Performance\Page_Cache\Meta\Exceptions\MetadataNotWritableException; |
| 13 |
use SolidWP\Performance\Page_Cache\Meta\Meta; |
| 14 |
|
| 15 |
/** |
| 16 |
* @internal |
| 17 |
*/ |
| 18 |
interface Meta_Writer { |
| 19 |
|
| 20 |
/** |
| 21 |
* Write a Meta value object's data somewhere. |
| 22 |
* |
| 23 |
* @param Meta $meta The Meta value object. |
| 24 |
* |
| 25 |
* @throws MetadataNotWritableException If we can't save the metadata. |
| 26 |
* |
| 27 |
* @return void |
| 28 |
*/ |
| 29 |
public function write( Meta $meta ): void; |
| 30 |
|
| 31 |
/** |
| 32 |
* Delete the metadata from the location it was written. |
| 33 |
* |
| 34 |
* @param Meta $meta The Meta value object. |
| 35 |
* |
| 36 |
* @return void |
| 37 |
*/ |
| 38 |
public function delete( Meta $meta ): void; |
| 39 |
} |
| 40 |
|