| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | * Transient key |
| 16 | 16 | * |
| 17 | 17 | * @var string |
| 18 | 18 | */ |
| 19 | - const TRANSIENT_KEY_PLUGIN = 't15s-registry-plugins'; | |
| 19 | + public const TRANSIENT_KEY_PLUGIN = 't15s-registry-plugins'; | |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Project directory slug |
| 23 | 23 | * |
| @@ -34,9 +34,9 @@ | ||
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Installed translations. |
| 37 | 37 | * |
| 38 | - * @var array | |
| 38 | + * @var array|null | |
| 39 | 39 | */ |
| 40 | 40 | private static $installed_translations; |
| 41 | 41 | |
| 42 | 42 | /** |
| @@ -41,9 +41,9 @@ | ||
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Available languages. |
| 44 | 44 | * |
| 45 | - * @var array | |
| 45 | + * @var array|null | |
| 46 | 46 | */ |
| 47 | 47 | private static $available_languages; |
| 48 | 48 | |
| 49 | 49 | /** |
| @@ -57,9 +57,9 @@ | ||
| 57 | 57 | public function __construct( $slug, $api_url ) { |
| 58 | 58 | $this->slug = $slug; |
| 59 | 59 | $this->api_url = $api_url; |
| 60 | 60 | |
| 61 | - add_action( 'init', array( __CLASS__, 'register_clean_translations_cache' ), 9999 ); | |
| 61 | + add_action( 'init', array( self::class, 'register_clean_translations_cache' ), 9999 ); | |
| 62 | 62 | add_filter( 'translations_api', array( $this, 'translations_api' ), 10, 3 ); |
| 63 | 63 | add_filter( 'site_transient_update_plugins', array( $this, 'site_transient_update_plugins' ) ); |
| 64 | 64 | } |
| 65 | 65 | |
| @@ -88,8 +88,9 @@ | ||
| 88 | 88 | * |
| 89 | 89 | * @since 2.6 |
| 90 | 90 | * |
| 91 | 91 | * @param bool|array $value The transient value. |
| 92 | + * @return bool|array | |
| 92 | 93 | */ |
| 93 | 94 | public function site_transient_update_plugins( $value ) { |
| 94 | 95 | if ( ! $value ) { |
| 95 | 96 | $value = new stdClass(); |
| @@ -131,12 +132,14 @@ | ||
| 131 | 132 | /** |
| 132 | 133 | * Registers actions for clearing translation caches. |
| 133 | 134 | * |
| 134 | 135 | * @since 2.6 |
| 136 | + * | |
| 137 | + * @return void | |
| 135 | 138 | */ |
| 136 | 139 | public static function register_clean_translations_cache() { |
| 137 | - add_action( 'set_site_transient_update_plugins', array( __CLASS__, 'clean_translations_cache' ) ); | |
| 138 | - add_action( 'delete_site_transient_update_plugins', array( __CLASS__, 'clean_translations_cache' ) ); | |
| 140 | + add_action( 'set_site_transient_update_plugins', array( self::class, 'clean_translations_cache' ) ); | |
| 141 | + add_action( 'delete_site_transient_update_plugins', array( self::class, 'clean_translations_cache' ) ); | |
| 139 | 142 | } |
| 140 | 143 | |
| 141 | 144 | /** |
| 142 | 145 | * Clears existing translation cache. |
| @@ -141,8 +144,10 @@ | ||
| 141 | 144 | /** |
| 142 | 145 | * Clears existing translation cache. |
| 143 | 146 | * |
| 144 | 147 | * @since 2.6 |
| 148 | + * | |
| 149 | + * @return void | |
| 145 | 150 | */ |
| 146 | 151 | public static function clean_translations_cache() { |
| 147 | 152 | $translations = get_site_transient( self::TRANSIENT_KEY_PLUGIN ); |
| 148 | 153 | |