1 | <?php |
||
15 | class Premium_Blocks { |
||
16 | |||
17 | /** |
||
18 | * List of premium blocks. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | public $extensions = array( |
||
23 | 'core/audio', |
||
24 | 'core/cover', |
||
25 | 'core/video', |
||
26 | 'premium-content/container', |
||
27 | ); |
||
28 | |||
29 | /** |
||
30 | * Plan level required to access premium blocks. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | public $required_plan = 'jetpack_premium'; |
||
35 | |||
36 | /** |
||
37 | * Whether the current site is on WP.com. |
||
38 | * |
||
39 | * @var bool |
||
40 | */ |
||
41 | public $is_simple_site = false; |
||
42 | |||
43 | /** |
||
44 | * Singleton. |
||
45 | */ |
||
46 | public static function get_instance() { |
||
55 | |||
56 | /** |
||
57 | * Premium_Blocks constructor. |
||
58 | */ |
||
59 | private function __construct() { |
||
76 | |||
77 | /** |
||
78 | * Returns the availability status for an extension. |
||
79 | * |
||
80 | * @param string $extension_name Extension name. |
||
81 | * @return array |
||
82 | */ |
||
83 | public function check_extension_availability( $extension_name ) { |
||
97 | |||
98 | /** |
||
99 | * Set the Jetpack Gutenberg extension availability. |
||
100 | */ |
||
101 | public function set_extension_availability() { |
||
119 | } |
||
120 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.