From 15285dba1e114dca114457d87a47d7b7e019983e Mon Sep 17 00:00:00 2001 From: "J. King" Date: Fri, 14 Jul 2017 10:16:16 -0400 Subject: [PATCH] Add PHPHDoc type hints for certain class properties This should aid autocompletion in IDEs --- lib/Data.php | 12 ++++++++++++ lib/Database.php | 4 ++++ lib/User.php | 4 +++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/Data.php b/lib/Data.php index 290f5d38..0e90e8e8 100644 --- a/lib/Data.php +++ b/lib/Data.php @@ -3,9 +3,21 @@ declare(strict_types=1); namespace JKingWeb\Arsse; class Data { + /** + * @var Lang + */ public static $lang; + /** + * @var Conf + */ public static $conf; + /** + * @var Database + */ public static $db; + /** + * @var User + */ public static $user; static function load(Conf $conf) { diff --git a/lib/Database.php b/lib/Database.php index 6e7cb98e..848f08ca 100644 --- a/lib/Database.php +++ b/lib/Database.php @@ -13,6 +13,10 @@ class Database { const FORMAT_DATE = "Y-m-d"; const FORMAT_TIME = "h:i:s"; + + /** + * @var Db\Driver + */ public $db; public function __construct() { diff --git a/lib/User.php b/lib/User.php index dd2f7a6a..ac0e5ae3 100644 --- a/lib/User.php +++ b/lib/User.php @@ -11,6 +11,9 @@ class User { public $id = null; + /** + * @var User\Driver + */ protected $u; protected $authz = 0; protected $authzSupported = 0; @@ -31,7 +34,6 @@ class User { public function __construct() { $driver = Data::$conf->userDriver; $this->u = new $driver(); - $this->authzSupported = $this->u->driverFunctions("authorize"); } public function __toString() {