Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| CacheBase | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| should_enable | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setContainer | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getContainer | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace NewfoldLabs\WP\Module\Performance\Cache\Types; |
| 4 | |
| 5 | use NewfoldLabs\WP\ModuleLoader\Container; |
| 6 | |
| 7 | /** |
| 8 | * Base class for cache types. |
| 9 | */ |
| 10 | abstract class CacheBase { |
| 11 | |
| 12 | /** |
| 13 | * Dependency injection container. |
| 14 | * |
| 15 | * @var Container $container |
| 16 | */ |
| 17 | protected $container; |
| 18 | |
| 19 | /** |
| 20 | * Whether or not the code for this cache type should be loaded. |
| 21 | * |
| 22 | * @param Container $container Dependency injection container. |
| 23 | * |
| 24 | * @return bool True if the cache type should be enabled, false otherwise. |
| 25 | */ |
| 26 | public static function should_enable( Container $container ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found |
| 27 | return true; |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Set the dependency injection container |
| 32 | * |
| 33 | * @param Container $container Dependency injection container |
| 34 | * |
| 35 | * @return void |
| 36 | */ |
| 37 | public function setContainer( Container $container ) { |
| 38 | $this->container = $container; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Get the dependency injection container. |
| 43 | * |
| 44 | * @return Container |
| 45 | */ |
| 46 | public function getContainer() { |
| 47 | return $this->container; |
| 48 | } |
| 49 | } |