PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.37
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.37
3.37 3.36 3.35 3.34 3.33 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.40 2.41 2.42 2.43 All 142 releases
← All changes | Options/Options.php +7 -7 3.33 → 3.37 View file →
@@ -1,9 +1,9 @@
1 1 <?php
2 2 namespace Photonic_Plugin\Options;
3 3
4 4 class Options {
5 - private static $instance;
5 + private static ?Options $instance;
6 6
7 7 private function __construct() {
8 8 require_once 'Defaults.php';
9 9 }
@@ -14,9 +14,9 @@
14 14 public function prepare_options() {
15 15 global $photonic_setup_options;
16 16
17 17 $photonic_setup_options = [];
18 - if (is_admin() && !empty($_REQUEST['page']) && in_array($_REQUEST['page'], ['photonic-options-manager', 'photonic-options'], true)) {
18 + if (is_admin() && !empty($_REQUEST['page']) && in_array($_REQUEST['page'], ['photonic-options-manager', 'photonic-options'], true)) { // phpcs:ignore WordPress.Security.NonceVerification
19 19 require_once 'Option_Tab.php';
20 20
21 21 require_once 'Generic.php';
22 22 $options = Generic::get_instance()->get_options();
@@ -58,10 +58,10 @@
58 58 }
59 59 }
60 60 }
61 61
62 - public static function get_instance() {
63 - if (null === self::$instance) {
62 + public static function get_instance(): Options {
63 + if (!isset(self::$instance)) {
64 64 self::$instance = new Options();
65 65 }
66 66 return self::$instance;
67 67 }
@@ -66,12 +66,12 @@
66 66 return self::$instance;
67 67 }
68 68
69 69 /**
70 - * @param $options array
71 - * @param $photonic_setup_options array
70 + * @param array $options
71 + * @param array $photonic_setup_options
72 72 */
73 - public function add_options($options, &$photonic_setup_options) {
73 + public function add_options(array $options, array &$photonic_setup_options) {
74 74 foreach ($options as $option) {
75 75 $photonic_setup_options[] = $option;
76 76 }
77 77 }