| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Polylang |
| 4 |
*/ |
| 5 |
|
| 6 |
namespace WP_Syntex\Polylang\Options\Business; |
| 7 |
|
| 8 |
use WP_Syntex\Polylang\Options\Abstract_Option; |
| 9 |
|
| 10 |
defined( 'ABSPATH' ) || exit; |
| 11 |
|
| 12 |
/** |
| 13 |
* Class defining the first activation option. |
| 14 |
* |
| 15 |
* @since 3.7 |
| 16 |
*/ |
| 17 |
class First_Activation extends Abstract_Option { |
| 18 |
/** |
| 19 |
* Returns option key. |
| 20 |
* |
| 21 |
* @since 3.7 |
| 22 |
* |
| 23 |
* @return string |
| 24 |
* |
| 25 |
* @phpstan-return 'first_activation' |
| 26 |
*/ |
| 27 |
public static function key(): string { |
| 28 |
return 'first_activation'; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Returns the default value. |
| 33 |
* |
| 34 |
* @since 3.7 |
| 35 |
* |
| 36 |
* @return int |
| 37 |
* |
| 38 |
* @phpstan-return int<0, max> |
| 39 |
*/ |
| 40 |
protected function get_default() { |
| 41 |
return time(); |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Returns the JSON schema part specific to this option. |
| 46 |
* |
| 47 |
* @since 3.7 |
| 48 |
* |
| 49 |
* @return array Partial schema. |
| 50 |
* |
| 51 |
* @phpstan-return array{type: 'integer', minimum: 0, maximum: int<0, max>, readonly: true} |
| 52 |
*/ |
| 53 |
protected function get_data_structure(): array { |
| 54 |
return array( |
| 55 |
'type' => 'integer', |
| 56 |
'minimum' => 0, |
| 57 |
'maximum' => PHP_INT_MAX, |
| 58 |
'readonly' => true, |
| 59 |
); |
| 60 |
} |
| 61 |
|
| 62 |
/** |
| 63 |
* Returns the description used in the JSON schema. |
| 64 |
* |
| 65 |
* @since 3.7 |
| 66 |
* |
| 67 |
* @return string |
| 68 |
*/ |
| 69 |
protected function get_description(): string { |
| 70 |
return __( 'Time of first activation of Polylang.', 'polylang' ); |
| 71 |
} |
| 72 |
} |
| 73 |
|