summaryrefslogtreecommitdiff
path: root/classes/pluginhost.php
diff options
context:
space:
mode:
authorwn_ <[email protected]>2021-11-12 21:17:31 +0000
committerwn_ <[email protected]>2021-11-12 21:17:31 +0000
commitd3a81f598b24d6ae4f98415fac9509df6749eaf8 (patch)
tree79fcdaba8badc193595485c965e6150bcaaecd25 /classes/pluginhost.php
parent2c41bc7fbc9013e79e929a31e3824cf040afc54a (diff)
Switch class properties from PHP typing to PHPDoc for compatibility with PHP < 7.4.0
Diffstat (limited to 'classes/pluginhost.php')
-rwxr-xr-xclasses/pluginhost.php41
1 files changed, 26 insertions, 15 deletions
diff --git a/classes/pluginhost.php b/classes/pluginhost.php
index 36e050377..173a75611 100755
--- a/classes/pluginhost.php
+++ b/classes/pluginhost.php
@@ -1,38 +1,49 @@
<?php
class PluginHost {
- private ?\Pdo $pdo = null;
+ // TODO: class properties can be switched to PHP typing if/when the minimum PHP_VERSION is raised to 7.4.0+
+ /** @var PDO|null */
+ private $pdo = null;
- /* separate handle for plugin data so transaction while saving wouldn't clash with possible main
- tt-rss code transactions; only initialized when first needed */
- private ?\Pdo $pdo_data = null;
+ /**
+ * separate handle for plugin data so transaction while saving wouldn't clash with possible main
+ * tt-rss code transactions; only initialized when first needed
+ *
+ * @var PDO|null
+ */
+ private $pdo_data = null;
/** @var array<string, array<int, array<int, Plugin>>> hook types -> priority levels -> Plugins */
- private array $hooks = [];
+ private $hooks = [];
/** @var array<string, Plugin> */
- private array $plugins = [];
+ private $plugins = [];
/** @var array<string, array<string, Plugin>> handler type -> method type -> Plugin */
- private array $handlers = [];
+ private $handlers = [];
/** @var array<string, array{'description': string, 'suffix': string, 'arghelp': string, 'class': Plugin}> command type -> details array */
- private array $commands = [];
+ private $commands = [];
/** @var array<string, array<string, mixed>> plugin name -> (potential profile array) -> key -> value */
- private array $storage = [];
+ private $storage = [];
/** @var array<int, array<int, array{'id': int, 'title': string, 'sender': Plugin, 'icon': string}>> */
- private array $feeds = [];
+ private $feeds = [];
/** @var array<string, Plugin> API method name, Plugin sender */
- private array $api_methods = [];
+ private $api_methods = [];
/** @var array<string, array<int, array{'action': string, 'description': string, 'sender': Plugin}>> */
- private array $plugin_actions = [];
+ private $plugin_actions = [];
+
+ /** @var int|null */
+ private $owner_uid = null;
+
+ /** @var bool */
+ private $data_loaded = false;
- private ?int $owner_uid = null;
- private bool $data_loaded = false;
- private static ?PluginHost $instance = null;
+ /** @var PluginHost|null */
+ private static $instance = null;
const API_VERSION = 2;
const PUBLIC_METHOD_DELIMITER = "--";