| 1 |
<?php // phpcs:disable WordPress.Files.FileName -- PSR-4 class file naming; renaming would break the autoloader. |
| 2 |
|
| 3 |
|
| 4 |
namespace GauchoPlugins\VersionInfo; |
| 5 |
|
| 6 |
defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
| 7 |
|
| 8 |
/** |
| 9 |
* Contract implemented by every System Resources data provider. |
| 10 |
*/ |
| 11 |
interface ProviderInterface { |
| 12 |
|
| 13 |
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid -- established camelCase provider API since 2.0; renaming would break every implementation. |
| 14 |
|
| 15 |
/** |
| 16 |
* Returns the human-readable provider name. |
| 17 |
*/ |
| 18 |
public function getName(); |
| 19 |
|
| 20 |
/** |
| 21 |
* Returns the provider key. |
| 22 |
*/ |
| 23 |
public function getKey(); |
| 24 |
|
| 25 |
/** |
| 26 |
* Whether this provider can collect data on the current host. |
| 27 |
*/ |
| 28 |
public function isAvailable(); |
| 29 |
|
| 30 |
// phpcs:enable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid |
| 31 |
|
| 32 |
/** |
| 33 |
* Collects the provider's data. |
| 34 |
* |
| 35 |
* @return array<string, mixed> |
| 36 |
*/ |
| 37 |
public function collect(); |
| 38 |
} |
| 39 |
|