| @@ -1,48 +1,20 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Templately\Utils; |
| 4 | 4 | |
| 5 | +use function get_transient; | |
| 6 | +use function set_transient; | |
| 7 | + | |
| 5 | 8 | class Database extends Base { |
| 6 | 9 | |
| 7 | - /** | |
| 8 | - * Set transient to options table | |
| 9 | - * | |
| 10 | - * @since 2.0.0 | |
| 11 | - * | |
| 12 | - * @param string $key | |
| 13 | - * @param mixed $value | |
| 14 | - * @param int $expiration | |
| 15 | - * | |
| 16 | - * @return bool | |
| 17 | - */ | |
| 18 | - public static function set_transient( $key, $value, $expiration = DAY_IN_SECONDS ) { | |
| 19 | - $key = '_templately_' . trim( $key ); | |
| 20 | - return set_transient( $key, $value, $expiration ); | |
| 21 | - } | |
| 10 | + public static function set_transient( $key, $value, $expiration = DAY_IN_SECONDS ) : bool { | |
| 11 | + $key = '_templately_' . trim( $key ); | |
| 12 | + return set_transient( $key, $value, $expiration ); | |
| 13 | + } | |
| 22 | 14 | |
| 23 | - /** | |
| 24 | - * Get transient data from options table. | |
| 25 | - * | |
| 26 | - * @since 2.0.0 | |
| 27 | - * @param string $key | |
| 28 | - * | |
| 29 | - * @return mixed | |
| 30 | - */ | |
| 31 | - public static function get_transient( $key ) { | |
| 32 | - $key = '_templately_' . trim( $key ); | |
| 33 | - return get_transient( $key ); | |
| 34 | - } | |
| 15 | + public static function get_transient( $key ){ | |
| 16 | + $key = '_templately_' . trim( $key ); | |
| 17 | + return get_transient( $key ); | |
| 18 | + } | |
| 35 | 19 | |
| 36 | - /** | |
| 37 | - * Delete transient data from options table. | |
| 38 | - * | |
| 39 | - * @param string $key Transient key. | |
| 40 | - * @return bool | |
| 41 | - */ | |
| 42 | - public static function delete_transient( $key ) { | |
| 43 | - $key = '_templately_' . trim( $key ); | |
| 44 | - return delete_transient( $key ); | |
| 45 | - } | |
| 46 | - | |
| 47 | - | |
| 48 | -} | |
| 20 | +} | |