| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Polylang |
| 4 |
*/ |
| 5 |
|
| 6 |
namespace WP_Syntex\Polylang\Options\Business; |
| 7 |
|
| 8 |
use WP_Syntex\Polylang\Options\Primitive\Abstract_String; |
| 9 |
|
| 10 |
defined( 'ABSPATH' ) || exit; |
| 11 |
|
| 12 |
/** |
| 13 |
* Class defining the "version" option. |
| 14 |
* |
| 15 |
* @since 3.7 |
| 16 |
*/ |
| 17 |
class Version extends Abstract_String { |
| 18 |
/** |
| 19 |
* Returns option key. |
| 20 |
* |
| 21 |
* @since 3.7 |
| 22 |
* |
| 23 |
* @return string |
| 24 |
* |
| 25 |
* @phpstan-return 'version' |
| 26 |
*/ |
| 27 |
public static function key(): string { |
| 28 |
return 'version'; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Returns the description used in the JSON schema. |
| 33 |
* |
| 34 |
* @since 3.7 |
| 35 |
* |
| 36 |
* @return string |
| 37 |
*/ |
| 38 |
protected function get_description(): string { |
| 39 |
return __( "Polylang's version.", 'polylang' ); |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* Returns the JSON schema part specific to this option. |
| 44 |
* |
| 45 |
* @since 3.7 |
| 46 |
* |
| 47 |
* @return array Partial schema. |
| 48 |
* |
| 49 |
* @phpstan-return array{type: 'string', readonly: true, readonly: true} |
| 50 |
*/ |
| 51 |
protected function get_data_structure(): array { |
| 52 |
return array_merge( parent::get_data_structure(), array( 'readonly' => true ) ); |
| 53 |
} |
| 54 |
} |
| 55 |
|