From 3a4dd0041a3fcd43cb0190ee2a11bf8d1c1da00e Mon Sep 17 00:00:00 2001 From: ju5t Date: Sat, 1 Nov 2025 12:49:48 +0100 Subject: [PATCH 01/19] chore: add docblocks for autocompletion --- src/Model/Core/Brand.php | 37 ++++++++++++++ src/Model/Core/BrandTranslation.php | 5 ++ src/Model/Core/IpBan.php | 12 +++++ src/Model/Core/Language.php | 11 ++++ src/Model/Core/Request/CreateIpBan.php | 9 ++++ src/Model/Core/Request/CreateSpamRule.php | 6 +++ .../Core/Request/CreateWhitelistedIp.php | 7 +++ src/Model/Core/SpamRule.php | 9 ++++ src/Model/Core/Upload.php | 11 ++++ src/Model/Core/WhitelistedIp.php | 10 ++++ src/Model/Model.php | 6 +++ src/Model/SelfService/Article.php | 24 +++++++++ src/Model/SelfService/ArticleTranslation.php | 9 ++++ src/Model/SelfService/Attachment.php | 9 ++++ src/Model/SelfService/Category.php | 15 ++++++ src/Model/SelfService/CategoryTranslation.php | 5 ++ src/Model/SelfService/Comment.php | 18 +++++++ .../SelfService/Request/CreateArticle.php | 13 +++++ .../SelfService/Request/CreateAttachment.php | 5 ++ .../SelfService/Request/CreateComment.php | 10 ++++ src/Model/SelfService/Tag.php | 8 +++ src/Model/SelfService/TagTranslation.php | 6 +++ src/Model/SelfService/Type.php | 21 ++++++++ src/Model/SelfService/TypeTranslation.php | 7 +++ src/Model/Shared/CustomField.php | 20 ++++++++ src/Model/Shared/Option.php | 9 ++++ src/Model/Shared/OptionTranslation.php | 4 ++ src/Model/Ticket/Attachment.php | 15 ++++++ src/Model/Ticket/Channel.php | 11 ++++ src/Model/Ticket/ChannelSettings.php | 6 +++ src/Model/Ticket/Department.php | 24 +++++++++ src/Model/Ticket/DepartmentEmail.php | 18 +++++++ src/Model/Ticket/DepartmentEmailTemplates.php | 19 +++++++ src/Model/Ticket/DepartmentTranslation.php | 6 +++ src/Model/Ticket/Extra.php | 5 ++ src/Model/Ticket/Message.php | 20 ++++++++ src/Model/Ticket/Priority.php | 12 +++++ src/Model/Ticket/PriorityTranslation.php | 5 ++ src/Model/Ticket/Request/CreateMessage.php | 13 +++++ src/Model/Ticket/Request/CreateTicket.php | 25 ++++++++++ src/Model/Ticket/Request/UpdateMessage.php | 3 ++ src/Model/Ticket/Request/UpdateTicket.php | 21 ++++++++ src/Model/Ticket/SlaPlan.php | 11 ++++ src/Model/Ticket/SlaPlanTranslation.php | 6 +++ src/Model/Ticket/Status.php | 12 +++++ src/Model/Ticket/StatusTranslation.php | 5 ++ src/Model/Ticket/Tag.php | 10 ++++ src/Model/Ticket/TagTranslation.php | 5 ++ src/Model/Ticket/Ticket.php | 50 +++++++++++++++++++ src/Model/Ticket/TicketCustomField.php | 6 +++ .../Ticket/TicketCustomFieldTranslation.php | 8 +++ src/Model/Translation.php | 3 ++ src/Model/User/Domain.php | 5 ++ src/Model/User/Group.php | 10 ++++ src/Model/User/GroupTranslation.php | 6 +++ src/Model/User/Organisation.php | 15 ++++++ .../OrganisationCustomFieldTranslation.php | 8 +++ src/Model/User/Request/CreateOperator.php | 13 +++++ src/Model/User/Request/CreateOrganisation.php | 11 ++++ src/Model/User/Request/CreateUser.php | 21 ++++++++ src/Model/User/User.php | 37 ++++++++++++++ src/Model/User/UserCustomField.php | 3 ++ src/Model/User/UserCustomFieldTranslation.php | 8 +++ 63 files changed, 762 insertions(+) diff --git a/src/Model/Core/Brand.php b/src/Model/Core/Brand.php index 11813391..abfecadb 100644 --- a/src/Model/Core/Brand.php +++ b/src/Model/Core/Brand.php @@ -4,6 +4,43 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property int $enabled + * @property string $system_url + * @property int|null $enable_ssl + * @property string|null $brand_colour + * @property string|null $frontend_logo + * @property string|null $frontend_logo_dark_mode + * @property string|null $website_url + * @property string|null $favicon + * @property string|null $favicon_dark_mode + * @property string $frontend_template + * @property string|null $operator_icon + * @property string|null $operator_template + * @property string $default_email + * @property string $global_email_header + * @property string $global_email_footer + * @property string $email_method + * @property string|null $smtp_host + * @property int|null $smtp_port + * @property string|null $smtp_encryption + * @property int|null $smtp_requires_auth + * @property string $smtp_auth_mech + * @property string|null $smtp_username + * @property string|null $smtp_password + * @property string $smtp_oauth + * @property string $default_country + * @property string $default_timezone + * @property string $date_format + * @property string $time_format + * @property string $default_language + * @property int $language_toggle + * @property int $created_at + * @property int $updated_at + * @property BrandTranslation[] $translations + */ class Brand extends Model { /** @var array */ diff --git a/src/Model/Core/BrandTranslation.php b/src/Model/Core/BrandTranslation.php index 5169367d..7884cac7 100644 --- a/src/Model/Core/BrandTranslation.php +++ b/src/Model/Core/BrandTranslation.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property string $name + * @property int $brand_id + */ class BrandTranslation extends Translation { /** @var array */ diff --git a/src/Model/Core/IpBan.php b/src/Model/Core/IpBan.php index 19bd7d4b..9e08433e 100644 --- a/src/Model/Core/IpBan.php +++ b/src/Model/Core/IpBan.php @@ -4,6 +4,18 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $ip + * @property string $reason + * @property bool $event_user + * @property bool $event_operator + * @property bool $event_api + * @property int $type + * @property int $expiry + * @property int $created_at + * @property int $updated_at + */ class IpBan extends Model { /** @var array */ diff --git a/src/Model/Core/Language.php b/src/Model/Core/Language.php index d9377a8c..da3e9798 100644 --- a/src/Model/Core/Language.php +++ b/src/Model/Core/Language.php @@ -4,6 +4,17 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $code + * @property bool $enabled + * @property bool $upgrade_available + * @property string $version + * @property int $created_at + * @property int $updated_at + * @property string $formatted_name + */ class Language extends Model { /** @var array */ diff --git a/src/Model/Core/Request/CreateIpBan.php b/src/Model/Core/Request/CreateIpBan.php index 96d58dbe..bada712c 100644 --- a/src/Model/Core/Request/CreateIpBan.php +++ b/src/Model/Core/Request/CreateIpBan.php @@ -4,6 +4,15 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $ip + * @property string $reason + * @property int $type + * @property bool $event_user + * @property bool $event_operator + * @property bool $event_api + * @property int $expiry_time + */ class CreateIpBan extends Model { /** @var array */ diff --git a/src/Model/Core/Request/CreateSpamRule.php b/src/Model/Core/Request/CreateSpamRule.php index 88cc32d9..593db2c2 100644 --- a/src/Model/Core/Request/CreateSpamRule.php +++ b/src/Model/Core/Request/CreateSpamRule.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $text + * @property int $type + * @property bool $event_message + * @property bool $event_comment + */ class CreateSpamRule extends Model { /** @var array */ diff --git a/src/Model/Core/Request/CreateWhitelistedIp.php b/src/Model/Core/Request/CreateWhitelistedIp.php index f1eb0498..9c485137 100644 --- a/src/Model/Core/Request/CreateWhitelistedIp.php +++ b/src/Model/Core/Request/CreateWhitelistedIp.php @@ -4,6 +4,13 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $ip + * @property string $description + * @property bool $event_user + * @property bool $event_operator + * @property bool $event_api + */ class CreateWhitelistedIp extends Model { /** @var array */ diff --git a/src/Model/Core/SpamRule.php b/src/Model/Core/SpamRule.php index 946f18e6..242a4b04 100644 --- a/src/Model/Core/SpamRule.php +++ b/src/Model/Core/SpamRule.php @@ -4,6 +4,15 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $text + * @property bool $event_message + * @property bool $event_comment + * @property int $type + * @property int $created_at + * @property int $updated_at + */ class SpamRule extends Model { /** @var array */ diff --git a/src/Model/Core/Upload.php b/src/Model/Core/Upload.php index 0205b976..081f047f 100644 --- a/src/Model/Core/Upload.php +++ b/src/Model/Core/Upload.php @@ -4,6 +4,17 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $hash + * @property string $filename + * @property string $folder + * @property string $mime + * @property string $size + * @property string|null $token + * @property string $session_id + * @property int $created_at + * @property int $updated_at + */ class Upload extends Model { /** @var array */ diff --git a/src/Model/Core/WhitelistedIp.php b/src/Model/Core/WhitelistedIp.php index 68753eab..b7abd951 100644 --- a/src/Model/Core/WhitelistedIp.php +++ b/src/Model/Core/WhitelistedIp.php @@ -4,6 +4,16 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $ip + * @property string $description + * @property bool $event_user + * @property bool $event_operator + * @property bool $event_api + * @property int $created_at + * @property int $updated_at + */ class WhitelistedIp extends Model { /** @var array */ diff --git a/src/Model/Model.php b/src/Model/Model.php index a15c6a1c..f510ae50 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -2,6 +2,12 @@ namespace SupportPal\ApiClient\Model; +/** + * @method mixed __get(string $key) + * @method void __set(string $key, mixed $value) + * @method bool __isset(string $key) + * @method void __unset(string $key) + */ abstract class Model extends \Jenssegers\Model\Model { /** @var string[] */ diff --git a/src/Model/SelfService/Article.php b/src/Model/SelfService/Article.php index 8bac959d..d5bb12ab 100644 --- a/src/Model/SelfService/Article.php +++ b/src/Model/SelfService/Article.php @@ -4,6 +4,30 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $author_id + * @property string $title + * @property string $slug + * @property string $excerpt + * @property string $plain_text + * @property string $text + * @property string $purified_text + * @property int $published + * @property int $published_at + * @property int $protected + * @property int $pinned + * @property int $created_at + * @property int $updated_at + * @property int $views + * @property int $positive_rating + * @property int $total_rating + * @property ArticleTranslation[] $translations + * @property Category[] $categories + * @property Type[] $types + * @property Attachment[] $attachments + * @property Tag[] $tags + */ class Article extends Model { /** @var array */ diff --git a/src/Model/SelfService/ArticleTranslation.php b/src/Model/SelfService/ArticleTranslation.php index 5d233de1..cbde44d9 100644 --- a/src/Model/SelfService/ArticleTranslation.php +++ b/src/Model/SelfService/ArticleTranslation.php @@ -4,6 +4,15 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $article_id + * @property string $title + * @property string $slug + * @property string|null $excerpt + * @property string $plain_text + * @property string $text + * @property string $purified_text + */ class ArticleTranslation extends Translation { /** @var array */ diff --git a/src/Model/SelfService/Attachment.php b/src/Model/SelfService/Attachment.php index 076f2797..4b6cf28b 100644 --- a/src/Model/SelfService/Attachment.php +++ b/src/Model/SelfService/Attachment.php @@ -5,6 +5,15 @@ use SupportPal\ApiClient\Model\Core\Upload; use SupportPal\ApiClient\Model\Model; +/** + * @property string $upload_hash + * @property int $article_id + * @property string|null $locale + * @property string $original_name + * @property int $created_at + * @property int $updated_at + * @property Upload $upload + */ class Attachment extends Model { /** @var array */ diff --git a/src/Model/SelfService/Category.php b/src/Model/SelfService/Category.php index 27e8a522..a15ce46a 100644 --- a/src/Model/SelfService/Category.php +++ b/src/Model/SelfService/Category.php @@ -4,6 +4,21 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $type_id + * @property int|null $parent_id + * @property string $name + * @property string $slug + * @property int $public + * @property int $parent_public + * @property int $created_at + * @property int $updated_at + * @property string $frontend_url + * @property Type $type + * @property CategoryTranslation[] $translations + * @property int $pinned + */ class Category extends Model { /** @var array */ diff --git a/src/Model/SelfService/CategoryTranslation.php b/src/Model/SelfService/CategoryTranslation.php index efed7a0d..1359d7e0 100644 --- a/src/Model/SelfService/CategoryTranslation.php +++ b/src/Model/SelfService/CategoryTranslation.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $category_id + * @property string $name + * @property string $slug + */ class CategoryTranslation extends Translation { /** @var array */ diff --git a/src/Model/SelfService/Comment.php b/src/Model/SelfService/Comment.php index 946bfe09..e4c91402 100644 --- a/src/Model/SelfService/Comment.php +++ b/src/Model/SelfService/Comment.php @@ -5,6 +5,24 @@ use SupportPal\ApiClient\Model\Model; use SupportPal\ApiClient\Model\User\User; +/** + * @property int $id + * @property int $article_id + * @property int $type_id + * @property int $author_id + * @property string $name + * @property string $text + * @property string $purified_text + * @property int|null $parent_id + * @property int|null $root_parent_id + * @property int $rating + * @property int $status + * @property int $notify_reply + * @property int $created_at + * @property int $updated_at + * @property int $deleted_at + * @property User $author + */ class Comment extends Model { /** @var array */ diff --git a/src/Model/SelfService/Request/CreateArticle.php b/src/Model/SelfService/Request/CreateArticle.php index e1480750..96e47b96 100644 --- a/src/Model/SelfService/Request/CreateArticle.php +++ b/src/Model/SelfService/Request/CreateArticle.php @@ -4,6 +4,19 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $author_id + * @property string $title + * @property string $slug + * @property string $excerpt + * @property string $text + * @property array $category + * @property array $tag + * @property bool $published + * @property int $published_at + * @property bool $protected + * @property bool $pinned + */ class CreateArticle extends Model { /** @var array */ diff --git a/src/Model/SelfService/Request/CreateAttachment.php b/src/Model/SelfService/Request/CreateAttachment.php index acbfb8ae..e2444b86 100644 --- a/src/Model/SelfService/Request/CreateAttachment.php +++ b/src/Model/SelfService/Request/CreateAttachment.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $article_id + * @property string $filename + * @property string $contents + */ class CreateAttachment extends Model { /** @var array */ diff --git a/src/Model/SelfService/Request/CreateComment.php b/src/Model/SelfService/Request/CreateComment.php index af454fc3..5f552f89 100644 --- a/src/Model/SelfService/Request/CreateComment.php +++ b/src/Model/SelfService/Request/CreateComment.php @@ -4,6 +4,16 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $article_id + * @property int $type_id + * @property int $parent_id + * @property int $author_id + * @property string $name + * @property string $text + * @property int $status + * @property bool $notify_reply + */ class CreateComment extends Model { /** @var array */ diff --git a/src/Model/SelfService/Tag.php b/src/Model/SelfService/Tag.php index 1ca9c857..d211d1a2 100644 --- a/src/Model/SelfService/Tag.php +++ b/src/Model/SelfService/Tag.php @@ -4,6 +4,14 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $slug + * @property int $created_at + * @property int $updated_at + * @property TagTranslation[] $translations + */ class Tag extends Model { /** @var array */ diff --git a/src/Model/SelfService/TagTranslation.php b/src/Model/SelfService/TagTranslation.php index d89767ec..087e8cd6 100644 --- a/src/Model/SelfService/TagTranslation.php +++ b/src/Model/SelfService/TagTranslation.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $tag_id + * @property string $name + * @property string $slug + */ class TagTranslation extends Translation { /** @var array */ diff --git a/src/Model/SelfService/Type.php b/src/Model/SelfService/Type.php index 76f3ad9a..62de91af 100644 --- a/src/Model/SelfService/Type.php +++ b/src/Model/SelfService/Type.php @@ -5,6 +5,27 @@ use SupportPal\ApiClient\Model\Core\Brand; use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $brand_id + * @property string $name + * @property string $slug + * @property string $description + * @property int $order + * @property int $enabled + * @property int $protected + * @property int $internal + * @property int $content + * @property int $view + * @property string $icon + * @property int $article_ordering + * @property int $show_on_dashboard + * @property string|null $external_link + * @property int $created_at + * @property int $updated_at + * @property TypeTranslation[] $translations + * @property Brand $brand + */ class Type extends Model { /** @var array */ diff --git a/src/Model/SelfService/TypeTranslation.php b/src/Model/SelfService/TypeTranslation.php index a844121b..db73c7f0 100644 --- a/src/Model/SelfService/TypeTranslation.php +++ b/src/Model/SelfService/TypeTranslation.php @@ -4,6 +4,13 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $type_id + * @property string $name + * @property string $description + * @property string $slug + */ class TypeTranslation extends Translation { /** @var array */ diff --git a/src/Model/Shared/CustomField.php b/src/Model/Shared/CustomField.php index c312dd11..e9505c18 100644 --- a/src/Model/Shared/CustomField.php +++ b/src/Model/Shared/CustomField.php @@ -5,6 +5,26 @@ use SupportPal\ApiClient\Model\Core\Brand; use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $description + * @property string $purified_description + * @property int $type + * @property int|null $depends_on_field_id + * @property int|null $depends_on_option_id + * @property int $order + * @property int $required + * @property int $public + * @property int $encrypted + * @property int $locked + * @property string $regex + * @property string $regex_error_message + * @property int $created_at + * @property int $updated_at + * @property Option[] $options + * @property Brand[] $brands + */ abstract class CustomField extends Model { public const TYPE_BOOLEAN = 0; diff --git a/src/Model/Shared/Option.php b/src/Model/Shared/Option.php index 54fa9783..7f739fc0 100644 --- a/src/Model/Shared/Option.php +++ b/src/Model/Shared/Option.php @@ -4,6 +4,15 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $field_id + * @property int $order + * @property string $value + * @property int $created_at + * @property int $updated_at + * @property OptionTranslation[] $translations + */ class Option extends Model { /** @var array */ diff --git a/src/Model/Shared/OptionTranslation.php b/src/Model/Shared/OptionTranslation.php index a49ac24a..914d09cb 100644 --- a/src/Model/Shared/OptionTranslation.php +++ b/src/Model/Shared/OptionTranslation.php @@ -4,6 +4,10 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property string $value + */ class OptionTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Attachment.php b/src/Model/Ticket/Attachment.php index 0e7705b6..0020151b 100644 --- a/src/Model/Ticket/Attachment.php +++ b/src/Model/Ticket/Attachment.php @@ -5,6 +5,21 @@ use SupportPal\ApiClient\Model\Core\Upload; use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $upload_hash + * @property int $ticket_id + * @property int $message_id + * @property string $original_name + * @property int $created_at + * @property int $updated_at + * @property string $operator_url + * @property string $frontend_url + * @property string $direct_operator_url + * @property string $direct_frontend_url + * @property Upload $upload + * @property Ticket $ticket + */ class Attachment extends Model { /** @var array */ diff --git a/src/Model/Ticket/Channel.php b/src/Model/Ticket/Channel.php index 2d1b81ed..6f5d5b8c 100644 --- a/src/Model/Ticket/Channel.php +++ b/src/Model/Ticket/Channel.php @@ -4,6 +4,17 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property int $enabled + * @property int $upgrade_available + * @property string|null $version + * @property int $created_at + * @property int $updated_at + * @property int $show_on_frontend + * @property string $formatted_name + */ class Channel extends Model { /** @var array */ diff --git a/src/Model/Ticket/ChannelSettings.php b/src/Model/Ticket/ChannelSettings.php index 42f0d103..e2008af8 100644 --- a/src/Model/Ticket/ChannelSettings.php +++ b/src/Model/Ticket/ChannelSettings.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $unauthenticated_users + * @property string $show_captcha + * @property string $append_ip_address + * @property string $show_related_articles + */ class ChannelSettings extends Model { /** @var array */ diff --git a/src/Model/Ticket/Department.php b/src/Model/Ticket/Department.php index 58ce2050..fbe29385 100644 --- a/src/Model/Ticket/Department.php +++ b/src/Model/Ticket/Department.php @@ -6,6 +6,30 @@ use SupportPal\ApiClient\Model\User\Group; use SupportPal\ApiClient\Model\User\User; +/** + * @property int $id + * @property string $name + * @property string $description + * @property int $order + * @property int|null $parent_id + * @property int $public + * @property string|null $ticket_number_format + * @property string|null $from_name + * @property int $notify_frontend_ticket + * @property int $notify_email_ticket + * @property int $notify_operators + * @property int $disable_user_email_replies + * @property int $registered_only + * @property int $created_at + * @property int $updated_at + * @property DepartmentEmailTemplates[] $email_templates + * @property DepartmentEmail[] $emails + * @property DepartmentTranslation[] $translations + * @property Group[] $groups + * @property User[] $operators + * @property Department[] $parent + * @property User[] $default_assignedto + */ class Department extends Model { /** @var array */ diff --git a/src/Model/Ticket/DepartmentEmail.php b/src/Model/Ticket/DepartmentEmail.php index dc3cc71e..831421d8 100644 --- a/src/Model/Ticket/DepartmentEmail.php +++ b/src/Model/Ticket/DepartmentEmail.php @@ -4,6 +4,24 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $department_id + * @property int $brand_id + * @property string $address + * @property int $type + * @property int $protocol + * @property string $server + * @property string $username + * @property string $auth_mech + * @property string $password + * @property string $oauth + * @property string $port + * @property int $encryption + * @property int $consume_all + * @property int $delete_downloaded + * @property int $created_at + * @property int $updated_at + */ class DepartmentEmail extends Model { /** @var array */ diff --git a/src/Model/Ticket/DepartmentEmailTemplates.php b/src/Model/Ticket/DepartmentEmailTemplates.php index d82d6789..c86ed13e 100644 --- a/src/Model/Ticket/DepartmentEmailTemplates.php +++ b/src/Model/Ticket/DepartmentEmailTemplates.php @@ -4,6 +4,25 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $operator_department_changed + * @property int $operator_internal_opened + * @property int $user_ticket_locked + * @property int $user_ticket_reply + * @property int $operator_assigned + * @property int $operator_ticket_note + * @property int $user_ticket_opened + * @property int $user_ticket_operatorclose + * @property int $operator_ticket_opened + * @property int $user_ticket_registeredonly + * @property int $user_ticket_autoclose + * @property int $user_email_attachmentrejected + * @property int $operator_operator_ticket_reply + * @property int $user_ticket_waitingresponse + * @property int $user_user_ticket_reply + * @property int $user_ticket_disablereplies + * @property int $operator_user_ticket_reply + */ class DepartmentEmailTemplates extends Model { /** @var array */ diff --git a/src/Model/Ticket/DepartmentTranslation.php b/src/Model/Ticket/DepartmentTranslation.php index 8ce2aae5..2037ea02 100644 --- a/src/Model/Ticket/DepartmentTranslation.php +++ b/src/Model/Ticket/DepartmentTranslation.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property string $name + * @property string $description + * @property int $department_id + */ class DepartmentTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Extra.php b/src/Model/Ticket/Extra.php index 85632898..d1589b2b 100644 --- a/src/Model/Ticket/Extra.php +++ b/src/Model/Ticket/Extra.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property array $bcc_address + * @property array $to_address + * @property array $cc_address + */ class Extra extends Model { /** @var array */ diff --git a/src/Model/Ticket/Message.php b/src/Model/Ticket/Message.php index d812f058..5ce2a931 100644 --- a/src/Model/Ticket/Message.php +++ b/src/Model/Ticket/Message.php @@ -5,6 +5,26 @@ use SupportPal\ApiClient\Model\Model; use SupportPal\ApiClient\Model\User\User; +/** + * @property int $id + * @property int $ticket_id + * @property int $channel_id + * @property int $user_id + * @property string $user_name + * @property string|null $user_ip_address + * @property int $by + * @property int $type + * @property string $excerpt + * @property string $text + * @property string $purified_text + * @property int $is_draft + * @property string|null $social_id + * @property Extra $extra + * @property int $created_at + * @property int $updated_at + * @property Attachment[] $attachments + * @property User $user + */ class Message extends Model { /** @var array */ diff --git a/src/Model/Ticket/Priority.php b/src/Model/Ticket/Priority.php index 5e32fb7d..3c43529c 100644 --- a/src/Model/Ticket/Priority.php +++ b/src/Model/Ticket/Priority.php @@ -4,6 +4,18 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $colour + * @property int $order + * @property int $created_at + * @property int $updated_at + * @property string $icon + * @property string $icon_without_tooltip + * @property Department[] $departments + * @property PriorityTranslation[] $translations + */ class Priority extends Model { /** @var array */ diff --git a/src/Model/Ticket/PriorityTranslation.php b/src/Model/Ticket/PriorityTranslation.php index ed340e4d..2384fff9 100644 --- a/src/Model/Ticket/PriorityTranslation.php +++ b/src/Model/Ticket/PriorityTranslation.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $priority_id + * @property string $name + */ class PriorityTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Request/CreateMessage.php b/src/Model/Ticket/Request/CreateMessage.php index 61b0912d..acc77ac4 100644 --- a/src/Model/Ticket/Request/CreateMessage.php +++ b/src/Model/Ticket/Request/CreateMessage.php @@ -8,6 +8,19 @@ use function array_unique; use function trim; +/** + * @property int $ticket_id + * @property int $user_id + * @property string $user_ip_address + * @property int $message_type + * @property string $text + * @property array $attachment + * @property array $cc + * @property bool $is_draft + * @property bool $send_user_email + * @property bool $send_operators_email + * @property int $created_at + */ class CreateMessage extends Model { /** @var array */ diff --git a/src/Model/Ticket/Request/CreateTicket.php b/src/Model/Ticket/Request/CreateTicket.php index 3cc2a92d..00baf808 100644 --- a/src/Model/Ticket/Request/CreateTicket.php +++ b/src/Model/Ticket/Request/CreateTicket.php @@ -8,6 +8,31 @@ use function array_unique; use function trim; +/** + * @property int $user + * @property int $on_behalf_of + * @property string $user_firstname + * @property string $user_lastname + * @property string $user_email + * @property string $user_organisation + * @property string $user_ip_address + * @property int $department + * @property int $brand + * @property int $status + * @property int $priority + * @property bool $internal + * @property string $subject + * @property string $text + * @property array $tag + * @property array $assignedto + * @property array $watching + * @property array $customfield + * @property array $cc + * @property int $send_user_email + * @property int $send_operators_email + * @property array $attachment + * @property int $created_at + */ class CreateTicket extends Model { /** @var array */ diff --git a/src/Model/Ticket/Request/UpdateMessage.php b/src/Model/Ticket/Request/UpdateMessage.php index 7a91ff4a..e05e2f6a 100644 --- a/src/Model/Ticket/Request/UpdateMessage.php +++ b/src/Model/Ticket/Request/UpdateMessage.php @@ -4,6 +4,9 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property string $text + */ class UpdateMessage extends Model { /** @var array */ diff --git a/src/Model/Ticket/Request/UpdateTicket.php b/src/Model/Ticket/Request/UpdateTicket.php index 46eb4562..d228b81a 100644 --- a/src/Model/Ticket/Request/UpdateTicket.php +++ b/src/Model/Ticket/Request/UpdateTicket.php @@ -8,6 +8,27 @@ use function array_unique; use function trim; +/** + * @property int $brand + * @property int $user + * @property int $department + * @property int $department_email + * @property int $status + * @property int $priority + * @property string $subject + * @property array $tag + * @property array $assignedto + * @property array $watching + * @property array $link + * @property array $unlink + * @property int $sla_plan + * @property int $reply_due_time + * @property int $resolve_due_time + * @property array $customfield + * @property bool $overwrite_customfield_values + * @property array $cc + * @property bool $locked + */ class UpdateTicket extends Model { /** @var array */ diff --git a/src/Model/Ticket/SlaPlan.php b/src/Model/Ticket/SlaPlan.php index 0a0e68bd..41305e9f 100644 --- a/src/Model/Ticket/SlaPlan.php +++ b/src/Model/Ticket/SlaPlan.php @@ -4,6 +4,17 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $description + * @property int $order + * @property int $all_hours + * @property int $condition_group_type + * @property int $created_at + * @property int $updated_at + * @property SlaPlanTranslation[] $translations + */ class SlaPlan extends Model { /** @var array */ diff --git a/src/Model/Ticket/SlaPlanTranslation.php b/src/Model/Ticket/SlaPlanTranslation.php index ec77957f..917d4dfd 100644 --- a/src/Model/Ticket/SlaPlanTranslation.php +++ b/src/Model/Ticket/SlaPlanTranslation.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $sla_plan_id + * @property string $name + * @property string $description + */ class SlaPlanTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Status.php b/src/Model/Ticket/Status.php index d223f2c1..8a70d3dd 100644 --- a/src/Model/Ticket/Status.php +++ b/src/Model/Ticket/Status.php @@ -4,6 +4,18 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $colour + * @property int $auto_close + * @property int $order + * @property int $created_at + * @property int $updated_at + * @property string $icon + * @property string $icon_without_tooltip + * @property StatusTranslation[] $translations + */ class Status extends Model { /** diff --git a/src/Model/Ticket/StatusTranslation.php b/src/Model/Ticket/StatusTranslation.php index 93bc03e1..b845cde5 100644 --- a/src/Model/Ticket/StatusTranslation.php +++ b/src/Model/Ticket/StatusTranslation.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $status_id + * @property string $name + */ class StatusTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Tag.php b/src/Model/Ticket/Tag.php index 546eb52a..e8b233f1 100644 --- a/src/Model/Ticket/Tag.php +++ b/src/Model/Ticket/Tag.php @@ -4,6 +4,16 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $colour + * @property int $created_at + * @property int $updated_at + * @property string $colour_text + * @property string $original_name + * @property TagTranslation[] $translations + */ class Tag extends Model { /** @var array */ diff --git a/src/Model/Ticket/TagTranslation.php b/src/Model/Ticket/TagTranslation.php index 67ebc64a..77ea8840 100644 --- a/src/Model/Ticket/TagTranslation.php +++ b/src/Model/Ticket/TagTranslation.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $tag_id + * @property string $name + */ class TagTranslation extends Translation { /** @var array */ diff --git a/src/Model/Ticket/Ticket.php b/src/Model/Ticket/Ticket.php index 351c2ceb..0fd21128 100644 --- a/src/Model/Ticket/Ticket.php +++ b/src/Model/Ticket/Ticket.php @@ -6,6 +6,56 @@ use SupportPal\ApiClient\Model\Model; use SupportPal\ApiClient\Model\User\User; +/** + * @property int $id + * @property string $number + * @property int $department_id + * @property int $department_email_id + * @property int $brand_id + * @property int $channel_id + * @property int $user_id + * @property int $status_id + * @property int $priority_id + * @property int|null $sla_plan_id + * @property string $subject + * @property int|null $due_time + * @property int|null $paused_time + * @property int $time_while_paused + * @property int|null $resolved_time + * @property int|null $reopened_time + * @property array $cc + * @property int $locked + * @property int $merged + * @property int $internal + * @property int $response_email_sent + * @property int $messages_count + * @property int $notes_count + * @property int $has_attachments + * @property bool $has_draft + * @property int $last_reply_time + * @property int $last_message_time + * @property int $last_reply_id + * @property int $last_message_id + * @property int $last_reply_by + * @property int $last_message_by + * @property int|null $deleted_at + * @property int $created_at + * @property int $updated_at + * @property string $frontend_url + * @property string $operator_url + * @property Channel $channel + * @property Department $department + * @property Tag[] $tags + * @property User $user + * @property User[] $watching + * @property User[] $assigned + * @property Brand $brand + * @property Message $last_reply + * @property SlaPlan|null $slaplan + * @property TicketCustomField[] $customfields + * @property Status $status + * @property Priority $priority + */ class Ticket extends Model { /** @var array */ diff --git a/src/Model/Ticket/TicketCustomField.php b/src/Model/Ticket/TicketCustomField.php index aa8edaae..b8593daa 100644 --- a/src/Model/Ticket/TicketCustomField.php +++ b/src/Model/Ticket/TicketCustomField.php @@ -6,6 +6,12 @@ use function array_merge; +/** + * @property int $purge + * @property int $ticket_id + * @property Department[] $departments + * @property TicketCustomFieldTranslation[] $translations + */ class TicketCustomField extends CustomField { /** diff --git a/src/Model/Ticket/TicketCustomFieldTranslation.php b/src/Model/Ticket/TicketCustomFieldTranslation.php index 89214fd0..dd4a1fd1 100644 --- a/src/Model/Ticket/TicketCustomFieldTranslation.php +++ b/src/Model/Ticket/TicketCustomFieldTranslation.php @@ -4,6 +4,14 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $ticket_custom_field_id + * @property string $name + * @property string $description + * @property string $purified_description + * @property string $regex_error_message + */ class TicketCustomFieldTranslation extends Translation { /** @var array */ diff --git a/src/Model/Translation.php b/src/Model/Translation.php index 3159f088..c9bdb5b1 100644 --- a/src/Model/Translation.php +++ b/src/Model/Translation.php @@ -4,6 +4,9 @@ use function array_merge; +/** + * @property string $locale + */ abstract class Translation extends Model { /** diff --git a/src/Model/User/Domain.php b/src/Model/User/Domain.php index 703a2bc6..020b20f1 100644 --- a/src/Model/User/Domain.php +++ b/src/Model/User/Domain.php @@ -4,6 +4,11 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $organisation_id + * @property string $domain + */ class Domain extends Model { /** @var array */ diff --git a/src/Model/User/Group.php b/src/Model/User/Group.php index 389cdf77..14cd274e 100644 --- a/src/Model/User/Group.php +++ b/src/Model/User/Group.php @@ -4,6 +4,16 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property string $name + * @property string $description + * @property string $colour + * @property int $administrator + * @property int $created_at + * @property int $updated_at + * @property GroupTranslation[] $translations + */ class Group extends Model { /** @var array */ diff --git a/src/Model/User/GroupTranslation.php b/src/Model/User/GroupTranslation.php index abfbe7a2..0205b745 100644 --- a/src/Model/User/GroupTranslation.php +++ b/src/Model/User/GroupTranslation.php @@ -4,6 +4,12 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $user_group_id + * @property string $name + * @property string|null $description + */ class GroupTranslation extends Translation { /** @var array */ diff --git a/src/Model/User/Organisation.php b/src/Model/User/Organisation.php index 47a522f9..b58424eb 100644 --- a/src/Model/User/Organisation.php +++ b/src/Model/User/Organisation.php @@ -4,6 +4,21 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $brand_id + * @property int|null $owner_id + * @property string $name + * @property string|null $country + * @property string|null $language_code + * @property string|null $timezone + * @property string|null $notes + * @property int $created_at + * @property int $updated_at + * @property Domain[] $domains + * @property User[] $users + * @property UserCustomField[] $customfields + */ class Organisation extends Model { /** @var array */ diff --git a/src/Model/User/OrganisationCustomFieldTranslation.php b/src/Model/User/OrganisationCustomFieldTranslation.php index 52019905..120ed38b 100644 --- a/src/Model/User/OrganisationCustomFieldTranslation.php +++ b/src/Model/User/OrganisationCustomFieldTranslation.php @@ -4,6 +4,14 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $user_organisation_custom_field_id + * @property string $name + * @property string $description + * @property string $purified_description + * @property string $regex_error_message + */ class OrganisationCustomFieldTranslation extends Translation { /** @var array */ diff --git a/src/Model/User/Request/CreateOperator.php b/src/Model/User/Request/CreateOperator.php index 6297f65d..a238c72d 100644 --- a/src/Model/User/Request/CreateOperator.php +++ b/src/Model/User/Request/CreateOperator.php @@ -7,6 +7,19 @@ use function array_unique; +/** + * @property string $firstname + * @property string $lastname + * @property string $email + * @property string $password + * @property array $phone + * @property string $country + * @property string $language_code + * @property string $timezone + * @property int $active + * @property array $groups + * @property array $depts + */ class CreateOperator extends Model { /** @var array */ diff --git a/src/Model/User/Request/CreateOrganisation.php b/src/Model/User/Request/CreateOrganisation.php index 7c416903..1616c2f4 100644 --- a/src/Model/User/Request/CreateOrganisation.php +++ b/src/Model/User/Request/CreateOrganisation.php @@ -8,6 +8,17 @@ use function array_unique; use function trim; +/** + * @property int $brand_id + * @property string $name + * @property array $customfield + * @property string $country + * @property string $language_code + * @property string $timezone + * @property string $notes + * @property array $domain + * @property array $access_level + */ class CreateOrganisation extends Model { /** @var array */ diff --git a/src/Model/User/Request/CreateUser.php b/src/Model/User/Request/CreateUser.php index 208d5c7b..361e8c9e 100644 --- a/src/Model/User/Request/CreateUser.php +++ b/src/Model/User/Request/CreateUser.php @@ -9,6 +9,27 @@ use function array_unique; use function trim; +/** + * @property int $brand_id + * @property string $firstname + * @property string $lastname + * @property string $email + * @property array $additional_email + * @property string $password + * @property bool $send_email + * @property array $phone + * @property string $country + * @property string $language_code + * @property string $timezone + * @property bool $email_verified + * @property int $active + * @property string $organisation + * @property int $organisation_id + * @property int $organisation_access_level + * @property int $organisation_notifications + * @property array $customfield + * @property array $groups + */ class CreateUser extends Model { /** @var array */ diff --git a/src/Model/User/User.php b/src/Model/User/User.php index a2930339..9b15b26e 100644 --- a/src/Model/User/User.php +++ b/src/Model/User/User.php @@ -4,6 +4,43 @@ use SupportPal\ApiClient\Model\Model; +/** + * @property int $id + * @property int $brand_id + * @property int $role + * @property string $firstname + * @property string $lastname + * @property string $email + * @property string $password + * @property string $session + * @property string $remember_token + * @property int $email_verified + * @property int $active + * @property int $organisation_id + * @property int $organisation_access_level + * @property int $organisation_notifications + * @property string $country + * @property string $language_code + * @property string $timezone + * @property string $avatar + * @property int|null $template_mode + * @property string|null $notes + * @property int $twofa_enabled + * @property string|null $twofa_secret + * @property string|null $twofa_token + * @property string|null $twitter_id + * @property string|null $twitter_handle + * @property string|null $facebook_id + * @property int $last_active_at + * @property int $created_at + * @property int $updated_at + * @property string $avatar_url + * @property string $formatted_name + * @property array $phone + * @property Group[] $groups + * @property UserCustomField[] $customfields + * @property Organisation $organisation + */ class User extends Model { /** @var array */ diff --git a/src/Model/User/UserCustomField.php b/src/Model/User/UserCustomField.php index 0c1ad733..ae7b7378 100644 --- a/src/Model/User/UserCustomField.php +++ b/src/Model/User/UserCustomField.php @@ -6,6 +6,9 @@ use function array_merge; +/** + * @property UserCustomFieldTranslation[] $translations + */ class UserCustomField extends CustomField { /** diff --git a/src/Model/User/UserCustomFieldTranslation.php b/src/Model/User/UserCustomFieldTranslation.php index 8e8ce6e9..bb57cdc5 100644 --- a/src/Model/User/UserCustomFieldTranslation.php +++ b/src/Model/User/UserCustomFieldTranslation.php @@ -4,6 +4,14 @@ use SupportPal\ApiClient\Model\Translation; +/** + * @property int $id + * @property int $user_custom_field_id + * @property string $name + * @property string $description + * @property string $purified_description + * @property string $regex_error_message + */ class UserCustomFieldTranslation extends Translation { /** @var array */ From 81c7ad25a87d79f08c47c1866ec5a60f6c6cf596 Mon Sep 17 00:00:00 2001 From: ju5t Date: Mon, 3 Nov 2025 13:07:22 +0100 Subject: [PATCH 02/19] fix: support model casting --- src/Model/Model.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/Model/Model.php b/src/Model/Model.php index f510ae50..fa282197 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -12,4 +12,29 @@ abstract class Model extends \Jenssegers\Model\Model { /** @var string[] */ protected $guarded = []; + +protected function castAttribute($key, $value) +{ + if (is_null($value)) { + return $value; + } + + $castType = $this->casts[$key] ?? null; + + if ($castType && str_starts_with($castType, 'array:')) { + $className = substr($castType, 6); + + if (class_exists($className) && is_array($value)) { + return array_map(function ($item) use ($className) { + return is_array($item) ? new $className($item) : $item; + }, $value); + } + } + + if ($castType && class_exists($castType) && is_array($value)) { + return new $castType($value); + } + + return parent::castAttribute($key, $value); +} } From b03424059c5a7e4cae5133a86011b938209db189 Mon Sep 17 00:00:00 2001 From: Jay <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:49:20 +0000 Subject: [PATCH 03/19] fix phpcs and add comments --- src/Model/Model.php | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Model/Model.php b/src/Model/Model.php index fa282197..c64eb6d6 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -13,28 +13,30 @@ abstract class Model extends \Jenssegers\Model\Model /** @var string[] */ protected $guarded = []; -protected function castAttribute($key, $value) -{ - if (is_null($value)) { - return $value; - } + protected function castAttribute($key, $value) + { + $castType = $this->casts[$key] ?? null; + + if ($value === null || $castType === null) { + return $value; + } - $castType = $this->casts[$key] ?? null; + // Handle class typing. + if ($castType && class_exists($castType) && is_array($value)) { + return new $castType($value); + } - if ($castType && str_starts_with($castType, 'array:')) { - $className = substr($castType, 6); + // Handle class typing as an array. + if ($castType && str_starts_with($castType, 'array:')) { + $className = substr($castType, 6); - if (class_exists($className) && is_array($value)) { - return array_map(function ($item) use ($className) { - return is_array($item) ? new $className($item) : $item; - }, $value); + if (class_exists($className) && is_array($value)) { + return array_map(function ($item) use ($className) { + return is_array($item) ? new $className($item) : $item; + }, $value); + } } - } - if ($castType && class_exists($castType) && is_array($value)) { - return new $castType($value); + return parent::castAttribute($key, $value); } - - return parent::castAttribute($key, $value); -} } From a60a0756f8adcba6985def2192067bfd868d7fcf Mon Sep 17 00:00:00 2001 From: Jay <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:50:05 +0000 Subject: [PATCH 04/19] Fix property type for parent in Department model --- src/Model/Ticket/Department.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Ticket/Department.php b/src/Model/Ticket/Department.php index fbe29385..48e93648 100644 --- a/src/Model/Ticket/Department.php +++ b/src/Model/Ticket/Department.php @@ -27,7 +27,7 @@ * @property DepartmentTranslation[] $translations * @property Group[] $groups * @property User[] $operators - * @property Department[] $parent + * @property Department $parent * @property User[] $default_assignedto */ class Department extends Model @@ -54,7 +54,7 @@ class Department extends Model 'translations' => 'array:' . DepartmentTranslation::class, 'groups' => 'array:' . Group::class, 'operators' => 'array:' . User::class, - 'parent' => 'array:' . self::class, + 'parent' => self::class, 'default_assignedto' => 'array:' . User::class, ]; } From 6d2222517964bda33553f3a6ce9f2d049b1ebd0b Mon Sep 17 00:00:00 2001 From: Jay <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:54:14 +0000 Subject: [PATCH 05/19] fix phpcs --- src/Model/Model.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Model/Model.php b/src/Model/Model.php index c64eb6d6..3b6413f4 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -2,6 +2,12 @@ namespace SupportPal\ApiClient\Model; +use function array_map; +use function class_exists; +use function is_array; +use function str_starts_with; +use function substr; + /** * @method mixed __get(string $key) * @method void __set(string $key, mixed $value) @@ -13,10 +19,17 @@ abstract class Model extends \Jenssegers\Model\Model /** @var string[] */ protected $guarded = []; + /** + * Cast an attribute to a native PHP type. + * + * @param string $key + * @param mixed $value + * @return mixed + */ protected function castAttribute($key, $value) { $castType = $this->casts[$key] ?? null; - + if ($value === null || $castType === null) { return $value; } From 806588a922af444d8199b676c7861d47ce3ac1e7 Mon Sep 17 00:00:00 2001 From: Jay <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:56:46 +0000 Subject: [PATCH 06/19] Update castAttribute method signature to typed parameters --- src/Model/Model.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Model/Model.php b/src/Model/Model.php index 3b6413f4..5e731174 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -21,12 +21,8 @@ abstract class Model extends \Jenssegers\Model\Model /** * Cast an attribute to a native PHP type. - * - * @param string $key - * @param mixed $value - * @return mixed */ - protected function castAttribute($key, $value) + protected function castAttribute(string $key, mixed $value): mixed { $castType = $this->casts[$key] ?? null; From 4824cc9610689409abf74dba5c1bb3ad879a9b32 Mon Sep 17 00:00:00 2001 From: Jay <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 14:59:06 +0000 Subject: [PATCH 07/19] set iterable types in CreateArticle --- src/Model/SelfService/Request/CreateArticle.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/SelfService/Request/CreateArticle.php b/src/Model/SelfService/Request/CreateArticle.php index 96e47b96..209c69d3 100644 --- a/src/Model/SelfService/Request/CreateArticle.php +++ b/src/Model/SelfService/Request/CreateArticle.php @@ -10,8 +10,8 @@ * @property string $slug * @property string $excerpt * @property string $text - * @property array $category - * @property array $tag + * @property int[] $category + * @property string[] $tag * @property bool $published * @property int $published_at * @property bool $protected From 5aa4c2b997ab31032e4c513e3acf791cf2d75a8f Mon Sep 17 00:00:00 2001 From: Jay <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:01:40 +0000 Subject: [PATCH 08/19] set iterable types in CreateMessage --- src/Model/Ticket/Request/CreateMessage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Ticket/Request/CreateMessage.php b/src/Model/Ticket/Request/CreateMessage.php index acc77ac4..00cee491 100644 --- a/src/Model/Ticket/Request/CreateMessage.php +++ b/src/Model/Ticket/Request/CreateMessage.php @@ -14,8 +14,8 @@ * @property string $user_ip_address * @property int $message_type * @property string $text - * @property array $attachment - * @property array $cc + * @property array $attachment + * @property string[] $cc * @property bool $is_draft * @property bool $send_user_email * @property bool $send_operators_email From 22e0f7eac08dd5ebd2b43d9c783acf5aa65c363c Mon Sep 17 00:00:00 2001 From: Jay Shah <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:04:55 +0000 Subject: [PATCH 09/19] set iterable types in CreateTicket --- src/Model/Ticket/Request/CreateTicket.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Model/Ticket/Request/CreateTicket.php b/src/Model/Ticket/Request/CreateTicket.php index 00baf808..c68d54d7 100644 --- a/src/Model/Ticket/Request/CreateTicket.php +++ b/src/Model/Ticket/Request/CreateTicket.php @@ -23,14 +23,14 @@ * @property bool $internal * @property string $subject * @property string $text - * @property array $tag - * @property array $assignedto - * @property array $watching - * @property array $customfield - * @property array $cc + * @property int[] $tag + * @property int[] $assignedto + * @property int[] $watching + * @property array $customfield + * @property string[] $cc * @property int $send_user_email * @property int $send_operators_email - * @property array $attachment + * @property array $attachment * @property int $created_at */ class CreateTicket extends Model From a1f6ce388dade2c7dbf00ddf1517077a8eb3353e Mon Sep 17 00:00:00 2001 From: Jay Shah <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:07:13 +0000 Subject: [PATCH 10/19] set iterable types in UpdateTicket --- src/Model/Ticket/Request/UpdateTicket.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Model/Ticket/Request/UpdateTicket.php b/src/Model/Ticket/Request/UpdateTicket.php index d228b81a..dc358d0c 100644 --- a/src/Model/Ticket/Request/UpdateTicket.php +++ b/src/Model/Ticket/Request/UpdateTicket.php @@ -16,17 +16,17 @@ * @property int $status * @property int $priority * @property string $subject - * @property array $tag - * @property array $assignedto - * @property array $watching - * @property array $link - * @property array $unlink + * @property int[] $tag + * @property int[] $assignedto + * @property int[] $watching + * @property int[] $link + * @property int[] $unlink * @property int $sla_plan * @property int $reply_due_time * @property int $resolve_due_time - * @property array $customfield + * @property array $customfield * @property bool $overwrite_customfield_values - * @property array $cc + * @property string[] $cc * @property bool $locked */ class UpdateTicket extends Model From 22f8fd94432d5ca5e3cd7615993d669b30c4cedd Mon Sep 17 00:00:00 2001 From: Jay Shah <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:10:51 +0000 Subject: [PATCH 11/19] set iterable types in User Requests --- src/Model/User/Request/CreateOperator.php | 6 +++--- src/Model/User/Request/CreateOrganisation.php | 6 +++--- src/Model/User/Request/CreateUser.php | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Model/User/Request/CreateOperator.php b/src/Model/User/Request/CreateOperator.php index a238c72d..d897ce4e 100644 --- a/src/Model/User/Request/CreateOperator.php +++ b/src/Model/User/Request/CreateOperator.php @@ -12,13 +12,13 @@ * @property string $lastname * @property string $email * @property string $password - * @property array $phone + * @property string[] $phone * @property string $country * @property string $language_code * @property string $timezone * @property int $active - * @property array $groups - * @property array $depts + * @property int[] $groups + * @property int[] $depts */ class CreateOperator extends Model { diff --git a/src/Model/User/Request/CreateOrganisation.php b/src/Model/User/Request/CreateOrganisation.php index 1616c2f4..c516975a 100644 --- a/src/Model/User/Request/CreateOrganisation.php +++ b/src/Model/User/Request/CreateOrganisation.php @@ -11,13 +11,13 @@ /** * @property int $brand_id * @property string $name - * @property array $customfield + * @property array $customfield * @property string $country * @property string $language_code * @property string $timezone * @property string $notes - * @property array $domain - * @property array $access_level + * @property string[] $domain + * @property array $access_level */ class CreateOrganisation extends Model { diff --git a/src/Model/User/Request/CreateUser.php b/src/Model/User/Request/CreateUser.php index 361e8c9e..72977b46 100644 --- a/src/Model/User/Request/CreateUser.php +++ b/src/Model/User/Request/CreateUser.php @@ -14,10 +14,10 @@ * @property string $firstname * @property string $lastname * @property string $email - * @property array $additional_email + * @property string[] $additional_email * @property string $password * @property bool $send_email - * @property array $phone + * @property string[] $phone * @property string $country * @property string $language_code * @property string $timezone @@ -27,8 +27,8 @@ * @property int $organisation_id * @property int $organisation_access_level * @property int $organisation_notifications - * @property array $customfield - * @property array $groups + * @property int[] $customfield + * @property int[] $groups */ class CreateUser extends Model { From eb058c308808f097fa402cd1c979c4059375ef48 Mon Sep 17 00:00:00 2001 From: Jay Shah <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:11:00 +0000 Subject: [PATCH 12/19] set iterable types in models --- src/Model/Ticket/Extra.php | 6 +++--- src/Model/Ticket/Ticket.php | 2 +- src/Model/User/User.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Model/Ticket/Extra.php b/src/Model/Ticket/Extra.php index d1589b2b..e1ed407e 100644 --- a/src/Model/Ticket/Extra.php +++ b/src/Model/Ticket/Extra.php @@ -5,9 +5,9 @@ use SupportPal\ApiClient\Model\Model; /** - * @property array $bcc_address - * @property array $to_address - * @property array $cc_address + * @property string[] $bcc_address + * @property string[] $to_address + * @property string[] $cc_address */ class Extra extends Model { diff --git a/src/Model/Ticket/Ticket.php b/src/Model/Ticket/Ticket.php index 0fd21128..356692a5 100644 --- a/src/Model/Ticket/Ticket.php +++ b/src/Model/Ticket/Ticket.php @@ -23,7 +23,7 @@ * @property int $time_while_paused * @property int|null $resolved_time * @property int|null $reopened_time - * @property array $cc + * @property string[] $cc * @property int $locked * @property int $merged * @property int $internal diff --git a/src/Model/User/User.php b/src/Model/User/User.php index 9b15b26e..4fc30cd8 100644 --- a/src/Model/User/User.php +++ b/src/Model/User/User.php @@ -36,7 +36,7 @@ * @property int $updated_at * @property string $avatar_url * @property string $formatted_name - * @property array $phone + * @property string[] $phone * @property Group[] $groups * @property UserCustomField[] $customfields * @property Organisation $organisation From d912a0af355c909868ac4ec23d65d48b7717d81d Mon Sep 17 00:00:00 2001 From: Jay Shah <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:19:11 +0000 Subject: [PATCH 13/19] fix phpstan contravariant error --- src/Model/Model.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Model/Model.php b/src/Model/Model.php index 5e731174..dcc4c16f 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -5,6 +5,7 @@ use function array_map; use function class_exists; use function is_array; +use function is_string; use function str_starts_with; use function substr; @@ -22,8 +23,12 @@ abstract class Model extends \Jenssegers\Model\Model /** * Cast an attribute to a native PHP type. */ - protected function castAttribute(string $key, mixed $value): mixed + protected function castAttribute(mixed $key, mixed $value): mixed { + if (! is_string($key)) { + $key = (string) $key; + } + $castType = $this->casts[$key] ?? null; if ($value === null || $castType === null) { From d26bdfc9789b1aa34597c6b981bfdc13352aed17 Mon Sep 17 00:00:00 2001 From: Jay Shah <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:21:48 +0000 Subject: [PATCH 14/19] fix? --- src/Model/Model.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Model/Model.php b/src/Model/Model.php index dcc4c16f..9a2f4c75 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -25,10 +25,6 @@ abstract class Model extends \Jenssegers\Model\Model */ protected function castAttribute(mixed $key, mixed $value): mixed { - if (! is_string($key)) { - $key = (string) $key; - } - $castType = $this->casts[$key] ?? null; if ($value === null || $castType === null) { From 2d08ded309bd18182ad90cb440dfe8881c66e495 Mon Sep 17 00:00:00 2001 From: Jay Shah <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:23:04 +0000 Subject: [PATCH 15/19] fix phpcs --- src/Model/Model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Model/Model.php b/src/Model/Model.php index 9a2f4c75..7b1efecb 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -5,7 +5,6 @@ use function array_map; use function class_exists; use function is_array; -use function is_string; use function str_starts_with; use function substr; From 9179f2306cac64cb80ce59fb5e89b69674ce9f43 Mon Sep 17 00:00:00 2001 From: Jay Shah <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:44:42 +0000 Subject: [PATCH 16/19] refactor code --- src/Model/Model.php | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/src/Model/Model.php b/src/Model/Model.php index 7b1efecb..780f58f2 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -30,22 +30,44 @@ protected function castAttribute(mixed $key, mixed $value): mixed return $value; } - // Handle class typing. - if ($castType && class_exists($castType) && is_array($value)) { - return new $castType($value); - } + if (is_array($value)) { + if (str_starts_with($castType, 'array:')) { + $className = substr($castType, 6); - // Handle class typing as an array. - if ($castType && str_starts_with($castType, 'array:')) { - $className = substr($castType, 6); + if (class_exists($className)) { + return $this->castToArrayOfObjects($castType, $value); + } + } - if (class_exists($className) && is_array($value)) { - return array_map(function ($item) use ($className) { - return is_array($item) ? new $className($item) : $item; - }, $value); + if (class_exists($castType)) { + return $this->castToObject($castType, $value); } } return parent::castAttribute($key, $value); } + + /** + * @template T of object + * @param class-string $castType + * @param array $value + * @return T + */ + private function castToObject(string $castType, array $value): mixed + { + return new $castType($value); + } + + /** + * @template T of object + * @param class-string $className + * @param array $value + * @return array + */ + private function castToArrayOfObjects(string $className, array $value): array + { + return array_map(function ($item) use ($className) { + return is_array($item) ? new $className($item) : $item; + }, $value); + } } From 666243e2d45891264437da19d2f18a5e907a8adf Mon Sep 17 00:00:00 2001 From: Jay Shah <602425+jshah4517@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:47:17 +0000 Subject: [PATCH 17/19] fix --- src/Model/Model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Model/Model.php b/src/Model/Model.php index 780f58f2..1daffc86 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -35,7 +35,7 @@ protected function castAttribute(mixed $key, mixed $value): mixed $className = substr($castType, 6); if (class_exists($className)) { - return $this->castToArrayOfObjects($castType, $value); + return $this->castToArrayOfObjects($className, $value); } } @@ -49,13 +49,13 @@ protected function castAttribute(mixed $key, mixed $value): mixed /** * @template T of object - * @param class-string $castType + * @param class-string $className * @param array $value * @return T */ - private function castToObject(string $castType, array $value): mixed + private function castToObject(string $className, array $value): mixed { - return new $castType($value); + return new $className($value); } /** From 02b94963b89f4d25ccb497e6b705418b9072455e Mon Sep 17 00:00:00 2001 From: ju5t Date: Mon, 3 Nov 2025 21:35:44 +0100 Subject: [PATCH 18/19] chore: add missing `null` to properties --- src/Model/Core/Brand.php | 4 ++-- src/Model/Core/IpBan.php | 6 +++--- src/Model/Core/Language.php | 2 +- src/Model/Core/Upload.php | 2 +- src/Model/SelfService/Article.php | 6 +++--- src/Model/SelfService/Comment.php | 2 +- src/Model/Ticket/Department.php | 8 ++++---- src/Model/Ticket/SlaPlan.php | 4 ++-- src/Model/Ticket/Ticket.php | 20 ++++++++++---------- src/Model/User/User.php | 30 +++++++++++++++--------------- 10 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/Model/Core/Brand.php b/src/Model/Core/Brand.php index abfecadb..46e0c8fb 100644 --- a/src/Model/Core/Brand.php +++ b/src/Model/Core/Brand.php @@ -27,10 +27,10 @@ * @property int|null $smtp_port * @property string|null $smtp_encryption * @property int|null $smtp_requires_auth - * @property string $smtp_auth_mech + * @property string|null $smtp_auth_mech * @property string|null $smtp_username * @property string|null $smtp_password - * @property string $smtp_oauth + * @property string|null $smtp_oauth * @property string $default_country * @property string $default_timezone * @property string $date_format diff --git a/src/Model/Core/IpBan.php b/src/Model/Core/IpBan.php index 9e08433e..298948d0 100644 --- a/src/Model/Core/IpBan.php +++ b/src/Model/Core/IpBan.php @@ -6,13 +6,13 @@ /** * @property int $id - * @property string $ip - * @property string $reason + * @property string|null $ip + * @property string|null $reason * @property bool $event_user * @property bool $event_operator * @property bool $event_api * @property int $type - * @property int $expiry + * @property int|null $expiry * @property int $created_at * @property int $updated_at */ diff --git a/src/Model/Core/Language.php b/src/Model/Core/Language.php index da3e9798..285fc17f 100644 --- a/src/Model/Core/Language.php +++ b/src/Model/Core/Language.php @@ -10,7 +10,7 @@ * @property string $code * @property bool $enabled * @property bool $upgrade_available - * @property string $version + * @property string|null $version * @property int $created_at * @property int $updated_at * @property string $formatted_name diff --git a/src/Model/Core/Upload.php b/src/Model/Core/Upload.php index 081f047f..52de1d74 100644 --- a/src/Model/Core/Upload.php +++ b/src/Model/Core/Upload.php @@ -11,7 +11,7 @@ * @property string $mime * @property string $size * @property string|null $token - * @property string $session_id + * @property string|null $session_id * @property int $created_at * @property int $updated_at */ diff --git a/src/Model/SelfService/Article.php b/src/Model/SelfService/Article.php index d5bb12ab..bc9728c4 100644 --- a/src/Model/SelfService/Article.php +++ b/src/Model/SelfService/Article.php @@ -6,15 +6,15 @@ /** * @property int $id - * @property int $author_id + * @property int|null $author_id * @property string $title * @property string $slug - * @property string $excerpt + * @property string|null $excerpt * @property string $plain_text * @property string $text * @property string $purified_text * @property int $published - * @property int $published_at + * @property int|null $published_at * @property int $protected * @property int $pinned * @property int $created_at diff --git a/src/Model/SelfService/Comment.php b/src/Model/SelfService/Comment.php index e4c91402..85db7713 100644 --- a/src/Model/SelfService/Comment.php +++ b/src/Model/SelfService/Comment.php @@ -20,7 +20,7 @@ * @property int $notify_reply * @property int $created_at * @property int $updated_at - * @property int $deleted_at + * @property int|null $deleted_at * @property User $author */ class Comment extends Model diff --git a/src/Model/Ticket/Department.php b/src/Model/Ticket/Department.php index 48e93648..3fb564a3 100644 --- a/src/Model/Ticket/Department.php +++ b/src/Model/Ticket/Department.php @@ -9,8 +9,8 @@ /** * @property int $id * @property string $name - * @property string $description - * @property int $order + * @property string|null $description + * @property int|null $order * @property int|null $parent_id * @property int $public * @property string|null $ticket_number_format @@ -22,13 +22,13 @@ * @property int $registered_only * @property int $created_at * @property int $updated_at - * @property DepartmentEmailTemplates[] $email_templates + * @property DepartmentEmailTemplates[]|null $email_templates * @property DepartmentEmail[] $emails * @property DepartmentTranslation[] $translations * @property Group[] $groups * @property User[] $operators * @property Department $parent - * @property User[] $default_assignedto + * @property User[]|null $default_assignedto */ class Department extends Model { diff --git a/src/Model/Ticket/SlaPlan.php b/src/Model/Ticket/SlaPlan.php index 41305e9f..bd006732 100644 --- a/src/Model/Ticket/SlaPlan.php +++ b/src/Model/Ticket/SlaPlan.php @@ -7,8 +7,8 @@ /** * @property int $id * @property string $name - * @property string $description - * @property int $order + * @property string|null $description + * @property int|null $order * @property int $all_hours * @property int $condition_group_type * @property int $created_at diff --git a/src/Model/Ticket/Ticket.php b/src/Model/Ticket/Ticket.php index 356692a5..18dc978a 100644 --- a/src/Model/Ticket/Ticket.php +++ b/src/Model/Ticket/Ticket.php @@ -8,9 +8,9 @@ /** * @property int $id - * @property string $number + * @property string|null $number * @property int $department_id - * @property int $department_email_id + * @property int|null $department_email_id * @property int $brand_id * @property int $channel_id * @property int $user_id @@ -23,21 +23,21 @@ * @property int $time_while_paused * @property int|null $resolved_time * @property int|null $reopened_time - * @property string[] $cc + * @property string[]|null $cc * @property int $locked * @property int $merged * @property int $internal * @property int $response_email_sent - * @property int $messages_count - * @property int $notes_count - * @property int $has_attachments + * @property int|null $messages_count + * @property int|null $notes_count + * @property int|null $has_attachments * @property bool $has_draft * @property int $last_reply_time * @property int $last_message_time - * @property int $last_reply_id - * @property int $last_message_id - * @property int $last_reply_by - * @property int $last_message_by + * @property int|null $last_reply_id + * @property int|null $last_message_id + * @property int|null $last_reply_by + * @property int|null $last_message_by * @property int|null $deleted_at * @property int $created_at * @property int $updated_at diff --git a/src/Model/User/User.php b/src/Model/User/User.php index 4fc30cd8..921978d6 100644 --- a/src/Model/User/User.php +++ b/src/Model/User/User.php @@ -6,23 +6,23 @@ /** * @property int $id - * @property int $brand_id + * @property int|null $brand_id * @property int $role - * @property string $firstname - * @property string $lastname - * @property string $email - * @property string $password - * @property string $session - * @property string $remember_token + * @property string|null $firstname + * @property string|null $lastname + * @property string|null $email + * @property string|null $password + * @property string|null $session + * @property string|null $remember_token * @property int $email_verified * @property int $active - * @property int $organisation_id - * @property int $organisation_access_level - * @property int $organisation_notifications - * @property string $country - * @property string $language_code - * @property string $timezone - * @property string $avatar + * @property int|null $organisation_id + * @property int|null $organisation_access_level + * @property int|null $organisation_notifications + * @property string|null $country + * @property string|null $language_code + * @property string|null $timezone + * @property string|null $avatar * @property int|null $template_mode * @property string|null $notes * @property int $twofa_enabled @@ -31,7 +31,7 @@ * @property string|null $twitter_id * @property string|null $twitter_handle * @property string|null $facebook_id - * @property int $last_active_at + * @property int|null $last_active_at * @property int $created_at * @property int $updated_at * @property string $avatar_url From 9c8baacf4bcf16bcbff98baf0a87c37634687a1a Mon Sep 17 00:00:00 2001 From: ju5t Date: Tue, 4 Nov 2025 12:03:24 +0100 Subject: [PATCH 19/19] chore: add missing null types --- src/Model/Core/WhitelistedIp.php | 4 ++-- src/Model/Shared/CustomField.php | 10 +++++----- src/Model/Shared/Option.php | 2 +- src/Model/Ticket/Message.php | 4 ++-- src/Model/Ticket/Priority.php | 2 +- src/Model/Ticket/Status.php | 2 +- src/Model/User/Group.php | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Model/Core/WhitelistedIp.php b/src/Model/Core/WhitelistedIp.php index b7abd951..8c6acf6d 100644 --- a/src/Model/Core/WhitelistedIp.php +++ b/src/Model/Core/WhitelistedIp.php @@ -6,8 +6,8 @@ /** * @property int $id - * @property string $ip - * @property string $description + * @property string|null $ip + * @property string|null $description * @property bool $event_user * @property bool $event_operator * @property bool $event_api diff --git a/src/Model/Shared/CustomField.php b/src/Model/Shared/CustomField.php index e9505c18..465cf87d 100644 --- a/src/Model/Shared/CustomField.php +++ b/src/Model/Shared/CustomField.php @@ -8,18 +8,18 @@ /** * @property int $id * @property string $name - * @property string $description - * @property string $purified_description + * @property string|null $description + * @property string|null $purified_description * @property int $type * @property int|null $depends_on_field_id * @property int|null $depends_on_option_id - * @property int $order + * @property int|null $order * @property int $required * @property int $public * @property int $encrypted * @property int $locked - * @property string $regex - * @property string $regex_error_message + * @property string|null $regex + * @property string|null $regex_error_message * @property int $created_at * @property int $updated_at * @property Option[] $options diff --git a/src/Model/Shared/Option.php b/src/Model/Shared/Option.php index 7f739fc0..86b28ddd 100644 --- a/src/Model/Shared/Option.php +++ b/src/Model/Shared/Option.php @@ -7,7 +7,7 @@ /** * @property int $id * @property int $field_id - * @property int $order + * @property int|null $order * @property string $value * @property int $created_at * @property int $updated_at diff --git a/src/Model/Ticket/Message.php b/src/Model/Ticket/Message.php index 5ce2a931..ad4e7f40 100644 --- a/src/Model/Ticket/Message.php +++ b/src/Model/Ticket/Message.php @@ -9,7 +9,7 @@ * @property int $id * @property int $ticket_id * @property int $channel_id - * @property int $user_id + * @property int|null $user_id * @property string $user_name * @property string|null $user_ip_address * @property int $by @@ -19,7 +19,7 @@ * @property string $purified_text * @property int $is_draft * @property string|null $social_id - * @property Extra $extra + * @property Extra|null $extra * @property int $created_at * @property int $updated_at * @property Attachment[] $attachments diff --git a/src/Model/Ticket/Priority.php b/src/Model/Ticket/Priority.php index 3c43529c..35e87447 100644 --- a/src/Model/Ticket/Priority.php +++ b/src/Model/Ticket/Priority.php @@ -8,7 +8,7 @@ * @property int $id * @property string $name * @property string $colour - * @property int $order + * @property int|null $order * @property int $created_at * @property int $updated_at * @property string $icon diff --git a/src/Model/Ticket/Status.php b/src/Model/Ticket/Status.php index 8a70d3dd..956e7803 100644 --- a/src/Model/Ticket/Status.php +++ b/src/Model/Ticket/Status.php @@ -9,7 +9,7 @@ * @property string $name * @property string $colour * @property int $auto_close - * @property int $order + * @property int|null $order * @property int $created_at * @property int $updated_at * @property string $icon diff --git a/src/Model/User/Group.php b/src/Model/User/Group.php index 14cd274e..bd76d11b 100644 --- a/src/Model/User/Group.php +++ b/src/Model/User/Group.php @@ -7,8 +7,8 @@ /** * @property int $id * @property string $name - * @property string $description - * @property string $colour + * @property string|null $description + * @property string|null $colour * @property int $administrator * @property int $created_at * @property int $updated_at