From 52ce09cb27255dab6bdbc5790ffaa52f8adf6fb7 Mon Sep 17 00:00:00 2001 From: Carl Bennett Date: Sun, 24 Nov 2024 05:15:22 -0600 Subject: [PATCH] Add more missing type hints --- src/Models/Document/Edit.php | 19 +++++++++---------- src/Models/Document/Index.php | 6 +++--- src/Models/Document/View.php | 8 ++++---- src/Models/EventLog/Index.php | 15 +++++++-------- src/Models/News/Delete.php | 10 +++++----- src/Models/News/Edit.php | 2 +- src/Models/News/View.php | 8 ++++---- src/Models/Packet/Index.php | 9 ++++----- src/Models/Server/UpdateJob.php | 4 ++-- 9 files changed, 39 insertions(+), 42 deletions(-) diff --git a/src/Models/Document/Edit.php b/src/Models/Document/Edit.php index 758a517e..e92a8904 100644 --- a/src/Models/Document/Edit.php +++ b/src/Models/Document/Edit.php @@ -4,15 +4,14 @@ class Edit extends \BNETDocs\Models\ActiveUser { - public $acl_allowed; - public $brief; - public $category; + public bool $acl_allowed = false; + public ?string $brief = null; + public ?string $category = null; public ?array $comments = null; - public $content; - public $document; - public $document_id; - public $markdown; - public $published; - public $title; - public $user; + public ?string $content = null; + public ?\BNETDocs\Libraries\Document $document = null; + public ?int $document_id = null; + public ?bool $markdown = null; + public ?bool $published = null; + public ?string $title = null; } diff --git a/src/Models/Document/Index.php b/src/Models/Document/Index.php index 077cad52..0a5645ef 100644 --- a/src/Models/Document/Index.php +++ b/src/Models/Document/Index.php @@ -4,7 +4,7 @@ class Index extends \BNETDocs\Models\ActiveUser { - public $documents; - public $order; - public $sum_documents; + public array|false $documents = false; + public string $order = ''; + public int $sum_documents = 0; } diff --git a/src/Models/Document/View.php b/src/Models/Document/View.php index 1b2f09d3..dd10ad43 100644 --- a/src/Models/Document/View.php +++ b/src/Models/Document/View.php @@ -4,8 +4,8 @@ class View extends \BNETDocs\Models\ActiveUser { - public $acl_allowed; - public $comments; - public $document; - public $document_id; + public bool $acl_allowed = false; + public ?array $comments = null; + public ?\BNETDocs\Libraries\Document $document = null; + public ?int $document_id = null; } diff --git a/src/Models/EventLog/Index.php b/src/Models/EventLog/Index.php index 4b6ca210..9e4ff2e9 100644 --- a/src/Models/EventLog/Index.php +++ b/src/Models/EventLog/Index.php @@ -4,12 +4,11 @@ class Index extends \BNETDocs\Models\ActiveUser { - public $acl_allowed; - public $events; - public $limit; - public $order; - public $page; - public $pages; - public $sum_events; - public $user; + public bool $acl_allowed = false; + public ?array $events = null; + public int $limit = 0; + public string $order = ''; + public int $page = 0; + public int $pages = 0; + public int $sum_events = 0; } diff --git a/src/Models/News/Delete.php b/src/Models/News/Delete.php index 379601a8..a9701710 100644 --- a/src/Models/News/Delete.php +++ b/src/Models/News/Delete.php @@ -4,9 +4,9 @@ class Delete extends \BNETDocs\Models\ActiveUser { - public bool $acl_allowed; - public ?int $id; - public ?\BNETDocs\Libraries\NewsPost $news_post; - public string $title; - public ?\BNETDocs\Libraries\User $user; + public bool $acl_allowed = false; + public ?int $id = null; + public ?\BNETDocs\Libraries\NewsPost $news_post = null; + public string $title = ''; + public ?\BNETDocs\Libraries\User $user = null; } diff --git a/src/Models/News/Edit.php b/src/Models/News/Edit.php index fc3418ce..69a97096 100644 --- a/src/Models/News/Edit.php +++ b/src/Models/News/Edit.php @@ -10,7 +10,7 @@ class Edit extends \BNETDocs\Models\ActiveUser public ?string $content = null; public bool $markdown = false; public ?array $news_categories = null; - public ?\BNETDocs\Libraries\NewsPost $news_post; + public ?\BNETDocs\Libraries\NewsPost $news_post = null; public ?int $news_post_id = null; public bool $published = false; public bool $rss_exempt = true; diff --git a/src/Models/News/View.php b/src/Models/News/View.php index de56b6fe..c2d7f629 100644 --- a/src/Models/News/View.php +++ b/src/Models/News/View.php @@ -4,8 +4,8 @@ class View extends \BNETDocs\Models\ActiveUser { - public bool $acl_allowed; - public ?array $comments; - public ?\BNETDocs\Libraries\NewsPost $news_post; - public ?int $news_post_id; + public bool $acl_allowed = false; + public ?array $comments = null; + public ?\BNETDocs\Libraries\NewsPost $news_post = null; + public ?int $news_post_id = null; } diff --git a/src/Models/Packet/Index.php b/src/Models/Packet/Index.php index 7a744235..b85d3ce0 100644 --- a/src/Models/Packet/Index.php +++ b/src/Models/Packet/Index.php @@ -5,9 +5,8 @@ class Index extends \BNETDocs\Models\ActiveUser { public $application_layers; - public $order; - public $packets; - public $pktapplayer; - public $timestamp; - public $user; + public array|string|null $order = null; + public array|false $packets = false; + public array $pktapplayer = []; + public ?\DateTimeInterface $timestamp = null; } diff --git a/src/Models/Server/UpdateJob.php b/src/Models/Server/UpdateJob.php index 75a30efb..b616040c 100644 --- a/src/Models/Server/UpdateJob.php +++ b/src/Models/Server/UpdateJob.php @@ -4,6 +4,6 @@ class UpdateJob extends \BNETDocs\Models\ActiveUser { - public $old_status_bitmask; - public $server; + public int $old_status_bitmask = 0; + public ?\BNETDocs\Libraries\Server $server = null; }