| 1 |
<?php |
| 2 |
/** |
| 3 |
* A class that handles saving and retrieving config values. |
| 4 |
* |
| 5 |
* @since 0.1.0 |
| 6 |
* |
| 7 |
* @package SolidWP\Performance |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace SolidWP\Performance\Config\Strategies; |
| 11 |
|
| 12 |
use SolidWP\Performance\Config\Contracts\Strategy; |
| 13 |
use SolidWP\Performance\StellarWP\Pipeline\Pipeline as StellarPipeline; |
| 14 |
|
| 15 |
/** |
| 16 |
* A class that handles saving and retrieving config values. |
| 17 |
* |
| 18 |
* @since 0.1.0 |
| 19 |
* |
| 20 |
* @package SolidWP\Performance |
| 21 |
*/ |
| 22 |
class Pipeline extends StellarPipeline implements Strategy { |
| 23 |
|
| 24 |
/** |
| 25 |
* {@inheritdoc} |
| 26 |
*/ |
| 27 |
public function get( string $key ) { |
| 28 |
return $this->via( 'get' )->send( $key )->then( |
| 29 |
static function () { |
| 30 |
return null; |
| 31 |
} |
| 32 |
); |
| 33 |
} |
| 34 |
|
| 35 |
/** |
| 36 |
* {@inheritdoc} |
| 37 |
*/ |
| 38 |
public function save( array $changes ) { |
| 39 |
return $this->via( 'save' )->send( $changes )->run(); |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* {@inheritDoc} |
| 44 |
*/ |
| 45 |
public function is_responsible_for( string $option ): bool { |
| 46 |
return true; |
| 47 |
} |
| 48 |
} |
| 49 |
|