| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Polylang |
| 4 |
*/ |
| 5 |
|
| 6 |
namespace WP_Syntex\Polylang\Options\Primitive; |
| 7 |
|
| 8 |
use WP_Syntex\Polylang\Options\Abstract_Option; |
| 9 |
use WP_Syntex\Polylang\Options\Options; |
| 10 |
|
| 11 |
defined( 'ABSPATH' ) || exit; |
| 12 |
|
| 13 |
/** |
| 14 |
* Class defining single string option. |
| 15 |
* |
| 16 |
* @since 3.7 |
| 17 |
*/ |
| 18 |
abstract class Abstract_String extends Abstract_Option { |
| 19 |
/** |
| 20 |
* Returns the default value. |
| 21 |
* |
| 22 |
* @since 3.7 |
| 23 |
* |
| 24 |
* @return string |
| 25 |
*/ |
| 26 |
protected function get_default() { |
| 27 |
return ''; |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Returns the JSON schema part specific to this option. |
| 32 |
* |
| 33 |
* @since 3.7 |
| 34 |
* |
| 35 |
* @return array Partial schema. |
| 36 |
* |
| 37 |
* @phpstan-return array{type: 'string'} |
| 38 |
*/ |
| 39 |
protected function get_data_structure(): array { |
| 40 |
return array( |
| 41 |
'type' => 'string', |
| 42 |
); |
| 43 |
} |
| 44 |
|
| 45 |
/** |
| 46 |
* Adds information to the site health info array. |
| 47 |
* |
| 48 |
* @since 3.8 |
| 49 |
* |
| 50 |
* @param Options $options An instance of the Options class providing additional configuration. |
| 51 |
* |
| 52 |
* @return array The updated site health information. |
| 53 |
*/ |
| 54 |
public function get_site_health_info( Options $options ): array { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
| 55 |
return $this->format_single_value_for_site_health_info( $this->get() ); |
| 56 |
} |
| 57 |
} |
| 58 |
|