From 93276ce8d01b9aad9ce79d1a892c7b57fe5fc829 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sun, 26 Dec 2021 21:32:09 +0000 Subject: [PATCH] [AUTOGENERATED] Update autogenerated code --- components/Attachment/Entity/Attachment.php | 20 ++++++------ .../Attachment/Entity/AttachmentThumbnail.php | 6 ++-- .../Attachment/Entity/AttachmentToNote.php | 2 +- components/Avatar/Entity/Avatar.php | 4 +-- components/Bridge/Entity/ForeignLink.php | 14 ++++---- components/Bridge/Entity/ForeignService.php | 4 +-- components/Bridge/Entity/ForeignUser.php | 4 +-- .../Entity/FreeNetworkActorProtocol.php | 4 +-- components/Language/Entity/Language.php | 12 +++---- components/Link/Entity/Link.php | 10 +++--- .../Notification/Entity/Notification.php | 4 +-- .../Entity/UserNotificationPrefs.php | 4 +-- .../ActivityPub/Entity/ActivitypubActor.php | 4 +-- plugins/ActivityPub/Entity/ActivitypubRsa.php | 2 +- .../Entity/Collection.php | 4 +-- plugins/Embed/Entity/AttachmentEmbed.php | 14 ++++---- plugins/Oomox/Entity/Oomox.php | 20 ++++++------ plugins/Poll/Entity/Poll.php | 10 +++--- plugins/Poll/Entity/PollResponse.php | 8 ++--- plugins/ProfileColor/Entity/ProfileColor.php | 4 +-- src/Entity/Activity.php | 4 +-- src/Entity/ActorCircle.php | 6 ++-- src/Entity/ConfirmAddress.php | 8 ++--- src/Entity/GroupMember.php | 6 ++-- src/Entity/Invitation.php | 2 +- src/Entity/LocalGroup.php | 4 +-- src/Entity/LocalUser.php | 32 +++++++++---------- src/Entity/LocationService.php | 4 +-- src/Entity/Note.php | 14 ++++---- src/Entity/NoteLocation.php | 8 ++--- src/Entity/NoteTag.php | 2 +- src/Entity/ResetPasswordRequest.php | 8 ++--- src/Entity/SmsCarrier.php | 4 +-- src/Entity/UserLocationPrefs.php | 2 +- src/Entity/UserUrlShortenerPrefs.php | 4 +-- 35 files changed, 131 insertions(+), 131 deletions(-) diff --git a/components/Attachment/Entity/Attachment.php b/components/Attachment/Entity/Attachment.php index d92dfae887..dea3e1fde6 100644 --- a/components/Attachment/Entity/Attachment.php +++ b/components/Attachment/Entity/Attachment.php @@ -59,13 +59,13 @@ class Attachment extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private int $lives = 1; - private ?string $filehash; - private ?string $mimetype; - private ?string $filename; - private ?int $size; - private ?int $width; - private ?int $height; + private int $lives = 1; + private ?string $filehash = null; + private ?string $mimetype = null; + private ?string $filename = null; + private ?int $size = null; + private ?int $width = null; + private ?int $height = null; private DateTimeInterface $modified; public function setId(int $id): self @@ -92,7 +92,7 @@ class Attachment extends Entity public function setFilehash(?string $filehash): self { - $this->filehash = mb_substr($filehash, 0, 64); + $this->filehash = \is_null($filehash) ? null : mb_substr($filehash, 0, 64); return $this; } @@ -103,7 +103,7 @@ class Attachment extends Entity public function setMimetype(?string $mimetype): self { - $this->mimetype = mb_substr($mimetype, 0, 255); + $this->mimetype = \is_null($mimetype) ? null : mb_substr($mimetype, 0, 255); return $this; } @@ -114,7 +114,7 @@ class Attachment extends Entity public function setFilename(?string $filename): self { - $this->filename = mb_substr($filename, 0, 191); + $this->filename = \is_null($filename) ? null : mb_substr($filename, 0, 191); return $this; } diff --git a/components/Attachment/Entity/AttachmentThumbnail.php b/components/Attachment/Entity/AttachmentThumbnail.php index fbf4248d1b..8ea866c690 100644 --- a/components/Attachment/Entity/AttachmentThumbnail.php +++ b/components/Attachment/Entity/AttachmentThumbnail.php @@ -69,8 +69,8 @@ class AttachmentThumbnail extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $attachment_id; - private ?string $mimetype; - private int $size = 0; + private ?string $mimetype = null; + private int $size = 0; private string $filename; private int $width; private int $height; @@ -89,7 +89,7 @@ class AttachmentThumbnail extends Entity public function setMimetype(?string $mimetype): self { - $this->mimetype = mb_substr($mimetype, 0, 129); + $this->mimetype = \is_null($mimetype) ? null : mb_substr($mimetype, 0, 129); return $this; } diff --git a/components/Attachment/Entity/AttachmentToNote.php b/components/Attachment/Entity/AttachmentToNote.php index 7b9da6dfac..de2d0274cd 100644 --- a/components/Attachment/Entity/AttachmentToNote.php +++ b/components/Attachment/Entity/AttachmentToNote.php @@ -45,7 +45,7 @@ class AttachmentToNote extends Entity // @codeCoverageIgnoreStart private int $attachment_id; private int $note_id; - private ?string $title; + private ?string $title = null; private DateTimeInterface $modified; public function setAttachmentId(int $attachment_id): self diff --git a/components/Avatar/Entity/Avatar.php b/components/Avatar/Entity/Avatar.php index 15a321dc20..3b9bd4bbf2 100644 --- a/components/Avatar/Entity/Avatar.php +++ b/components/Avatar/Entity/Avatar.php @@ -51,7 +51,7 @@ class Avatar extends Entity // @codeCoverageIgnoreStart private int $actor_id; private int $attachment_id; - private ?string $title; + private ?string $title = null; private DateTimeInterface $created; private DateTimeInterface $modified; @@ -79,7 +79,7 @@ class Avatar extends Entity public function setTitle(?string $title): self { - $this->title = mb_substr($title, 0, 191); + $this->title = \is_null($title) ? null : mb_substr($title, 0, 191); return $this; } diff --git a/components/Bridge/Entity/ForeignLink.php b/components/Bridge/Entity/ForeignLink.php index a90e153c52..467a95b388 100644 --- a/components/Bridge/Entity/ForeignLink.php +++ b/components/Bridge/Entity/ForeignLink.php @@ -44,12 +44,12 @@ class ForeignLink private int $user_id; private int $foreign_id; private int $service; - private ?string $credentials; - private int $noticesync = 1; - private int $friendsync = 2; - private int $profilesync = 1; - private ?DateTimeInterface $last_noticesync; - private ?DateTimeInterface $last_friendsync; + private ?string $credentials = null; + private int $noticesync = 1; + private int $friendsync = 2; + private int $profilesync = 1; + private ?DateTimeInterface $last_noticesync = null; + private ?DateTimeInterface $last_friendsync = null; private DateTimeInterface $created; private DateTimeInterface $modified; @@ -88,7 +88,7 @@ class ForeignLink public function setCredentials(?string $credentials): self { - $this->credentials = mb_substr($credentials, 0, 191); + $this->credentials = \is_null($credentials) ? null : mb_substr($credentials, 0, 191); return $this; } diff --git a/components/Bridge/Entity/ForeignService.php b/components/Bridge/Entity/ForeignService.php index 09850ded6d..a84482a1e6 100644 --- a/components/Bridge/Entity/ForeignService.php +++ b/components/Bridge/Entity/ForeignService.php @@ -43,7 +43,7 @@ class ForeignService // @codeCoverageIgnoreStart private int $id; private string $name; - private ?string $description; + private ?string $description = null; private DateTimeInterface $created; private DateTimeInterface $modified; @@ -71,7 +71,7 @@ class ForeignService public function setDescription(?string $description): self { - $this->description = mb_substr($description, 0, 191); + $this->description = \is_null($description) ? null : mb_substr($description, 0, 191); return $this; } diff --git a/components/Bridge/Entity/ForeignUser.php b/components/Bridge/Entity/ForeignUser.php index 70746606c7..d460b74b31 100644 --- a/components/Bridge/Entity/ForeignUser.php +++ b/components/Bridge/Entity/ForeignUser.php @@ -44,7 +44,7 @@ class ForeignUser private int $id; private int $service; private string $uri; - private ?string $nickname; + private ?string $nickname = null; private DateTimeInterface $created; private DateTimeInterface $modified; @@ -83,7 +83,7 @@ class ForeignUser public function setNickname(?string $nickname): self { - $this->nickname = mb_substr($nickname, 0, 191); + $this->nickname = \is_null($nickname) ? null : mb_substr($nickname, 0, 191); return $this; } diff --git a/components/FreeNetwork/Entity/FreeNetworkActorProtocol.php b/components/FreeNetwork/Entity/FreeNetworkActorProtocol.php index d53050185d..96d847367b 100644 --- a/components/FreeNetwork/Entity/FreeNetworkActorProtocol.php +++ b/components/FreeNetwork/Entity/FreeNetworkActorProtocol.php @@ -49,7 +49,7 @@ class FreeNetworkActorProtocol extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $actor_id; - private ?string $protocol; + private ?string $protocol = null; private string $addr; private DateTimeInterface $created; private DateTimeInterface $modified; @@ -67,7 +67,7 @@ class FreeNetworkActorProtocol extends Entity public function setProtocol(?string $protocol): self { - $this->protocol = mb_substr($protocol, 0, 32); + $this->protocol = \is_null($protocol) ? null : mb_substr($protocol, 0, 32); return $this; } diff --git a/components/Language/Entity/Language.php b/components/Language/Entity/Language.php index 52cbf44d20..d5e8801151 100644 --- a/components/Language/Entity/Language.php +++ b/components/Language/Entity/Language.php @@ -48,9 +48,9 @@ class Language extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private ?string $locale; - private ?string $long_display; - private ?string $short_display; + private ?string $locale = null; + private ?string $long_display = null; + private ?string $short_display = null; private DateTimeInterface $created; public function setId(int $id): self @@ -66,7 +66,7 @@ class Language extends Entity public function setLocale(?string $locale): self { - $this->locale = mb_substr($locale, 0, 64); + $this->locale = \is_null($locale) ? null : mb_substr($locale, 0, 64); return $this; } @@ -77,7 +77,7 @@ class Language extends Entity public function setLongDisplay(?string $long_display): self { - $this->long_display = mb_substr($long_display, 0, 64); + $this->long_display = \is_null($long_display) ? null : mb_substr($long_display, 0, 64); return $this; } @@ -88,7 +88,7 @@ class Language extends Entity public function setShortDisplay(?string $short_display): self { - $this->short_display = mb_substr($short_display, 0, 12); + $this->short_display = \is_null($short_display) ? null : mb_substr($short_display, 0, 12); return $this; } diff --git a/components/Link/Entity/Link.php b/components/Link/Entity/Link.php index 641dc0ec02..d5d65c0d14 100644 --- a/components/Link/Entity/Link.php +++ b/components/Link/Entity/Link.php @@ -49,9 +49,9 @@ class Link extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private ?string $url; - private ?string $url_hash; - private ?string $mimetype; + private ?string $url = null; + private ?string $url_hash = null; + private ?string $mimetype = null; private DateTimeInterface $modified; public function setId(int $id): self @@ -78,7 +78,7 @@ class Link extends Entity public function setUrlHash(?string $url_hash): self { - $this->url_hash = mb_substr($url_hash, 0, 64); + $this->url_hash = \is_null($url_hash) ? null : mb_substr($url_hash, 0, 64); return $this; } @@ -89,7 +89,7 @@ class Link extends Entity public function setMimetype(?string $mimetype): self { - $this->mimetype = mb_substr($mimetype, 0, 50); + $this->mimetype = \is_null($mimetype) ? null : mb_substr($mimetype, 0, 50); return $this; } diff --git a/components/Notification/Entity/Notification.php b/components/Notification/Entity/Notification.php index 46ff0ade62..6d790069ff 100644 --- a/components/Notification/Entity/Notification.php +++ b/components/Notification/Entity/Notification.php @@ -47,7 +47,7 @@ class Notification extends Entity // @codeCoverageIgnoreStart private int $activity_id; private int $target_id; - private ?string $reason; + private ?string $reason = null; private DateTimeInterface $created; private DateTimeInterface $modified; @@ -75,7 +75,7 @@ class Notification extends Entity public function setReason(?string $reason): self { - $this->reason = mb_substr($reason, 0, 191); + $this->reason = \is_null($reason) ? null : mb_substr($reason, 0, 191); return $this; } diff --git a/components/Notification/Entity/UserNotificationPrefs.php b/components/Notification/Entity/UserNotificationPrefs.php index dfbc547c9d..d2b29c897a 100644 --- a/components/Notification/Entity/UserNotificationPrefs.php +++ b/components/Notification/Entity/UserNotificationPrefs.php @@ -40,7 +40,7 @@ class UserNotificationPrefs extends Entity // @codeCoverageIgnoreStart private int $user_id; private string $transport; - private ?int $target_actor_id; + private ?int $target_actor_id = null; private bool $activity_by_subscribed = true; private bool $mention = true; private bool $reply = true; @@ -49,7 +49,7 @@ class UserNotificationPrefs extends Entity private bool $nudge = false; private bool $dm = true; private bool $post_on_status_change = false; - private ?bool $enable_posting; + private ?bool $enable_posting = true; private DateTimeInterface $created; private DateTimeInterface $modified; diff --git a/plugins/ActivityPub/Entity/ActivitypubActor.php b/plugins/ActivityPub/Entity/ActivitypubActor.php index 85816f5a05..f15368a7f3 100644 --- a/plugins/ActivityPub/Entity/ActivitypubActor.php +++ b/plugins/ActivityPub/Entity/ActivitypubActor.php @@ -57,8 +57,8 @@ class ActivitypubActor extends Entity private string $uri; private int $actor_id; private string $inbox_uri; - private ?string $inbox_shared_uri; - private ?string $url; + private ?string $inbox_shared_uri = null; + private ?string $url = null; private DateTimeInterface $created; private DateTimeInterface $modified; diff --git a/plugins/ActivityPub/Entity/ActivitypubRsa.php b/plugins/ActivityPub/Entity/ActivitypubRsa.php index de25dfea9a..e873f9e995 100644 --- a/plugins/ActivityPub/Entity/ActivitypubRsa.php +++ b/plugins/ActivityPub/Entity/ActivitypubRsa.php @@ -50,7 +50,7 @@ class ActivitypubRsa extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $actor_id; - private ?string $private_key; + private ?string $private_key = null; private string $public_key; private DateTimeInterface $created; private DateTimeInterface $modified; diff --git a/plugins/AttachmentCollections/Entity/Collection.php b/plugins/AttachmentCollections/Entity/Collection.php index 706c043c72..296f79325f 100644 --- a/plugins/AttachmentCollections/Entity/Collection.php +++ b/plugins/AttachmentCollections/Entity/Collection.php @@ -12,7 +12,7 @@ class Collection extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private ?string $name; + private ?string $name = null; private int $actor_id; public function setId(int $id): self @@ -28,7 +28,7 @@ class Collection extends Entity public function setName(?string $name): self { - $this->name = mb_substr($name, 0, 255); + $this->name = \is_null($name) ? null : mb_substr($name, 0, 255); return $this; } diff --git a/plugins/Embed/Entity/AttachmentEmbed.php b/plugins/Embed/Entity/AttachmentEmbed.php index e72dcc10fd..51e0ed48a2 100644 --- a/plugins/Embed/Entity/AttachmentEmbed.php +++ b/plugins/Embed/Entity/AttachmentEmbed.php @@ -52,13 +52,13 @@ class AttachmentEmbed extends Entity // @codeCoverageIgnoreStart private int $link_id; private int $attachment_id; - private ?string $provider_name; - private ?string $provider_url; - private ?string $title; - private ?string $description; - private ?string $author_name; - private ?string $author_url; - private ?string $thumbnail_url; + private ?string $provider_name = null; + private ?string $provider_url = null; + private ?string $title = null; + private ?string $description = null; + private ?string $author_name = null; + private ?string $author_url = null; + private ?string $thumbnail_url = null; private DateTimeInterface $modified; public function setLinkId(int $link_id): self diff --git a/plugins/Oomox/Entity/Oomox.php b/plugins/Oomox/Entity/Oomox.php index 014742fd99..46fe04128e 100644 --- a/plugins/Oomox/Entity/Oomox.php +++ b/plugins/Oomox/Entity/Oomox.php @@ -41,16 +41,16 @@ class Oomox extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $actor_id; - private ?string $colour_foreground_light; - private ?string $colour_background_hard_light; - private ?string $colour_background_card_light; - private ?string $colour_border_light; - private ?string $colour_accent_light; - private ?string $colour_foreground_dark; - private ?string $colour_background_hard_dark; - private ?string $colour_background_card_dark; - private ?string $colour_border_dark; - private ?string $colour_accent_dark; + private ?string $colour_foreground_light = null; + private ?string $colour_background_hard_light = null; + private ?string $colour_background_card_light = null; + private ?string $colour_border_light = null; + private ?string $colour_accent_light = null; + private ?string $colour_foreground_dark = null; + private ?string $colour_background_hard_dark = null; + private ?string $colour_background_card_dark = null; + private ?string $colour_border_dark = null; + private ?string $colour_accent_dark = null; private DateTimeInterface $created; private DateTimeInterface $modified; diff --git a/plugins/Poll/Entity/Poll.php b/plugins/Poll/Entity/Poll.php index 4c420ae6ef..cb073b8577 100644 --- a/plugins/Poll/Entity/Poll.php +++ b/plugins/Poll/Entity/Poll.php @@ -42,11 +42,11 @@ class Poll extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private ?string $uri; - private ?int $actor_id; + private ?string $uri = null; + private ?int $actor_id = null; private int $note_id; - private ?string $question; - private ?string $options; + private ?string $question = null; + private ?string $options = null; private DateTimeInterface $created; private DateTimeInterface $modified; @@ -63,7 +63,7 @@ class Poll extends Entity public function setUri(?string $uri): self { - $this->uri = mb_substr($uri, 0, 191); + $this->uri = \is_null($uri) ? null : mb_substr($uri, 0, 191); return $this; } diff --git a/plugins/Poll/Entity/PollResponse.php b/plugins/Poll/Entity/PollResponse.php index 3d5395081a..3ea4eb2925 100644 --- a/plugins/Poll/Entity/PollResponse.php +++ b/plugins/Poll/Entity/PollResponse.php @@ -42,10 +42,10 @@ class PollResponse extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private ?string $uri; + private ?string $uri = null; private int $poll_id; - private ?int $actor_id; - private ?int $selection; + private ?int $actor_id = null; + private ?int $selection = null; private DateTimeInterface $created; private DateTimeInterface $modified; @@ -62,7 +62,7 @@ class PollResponse extends Entity public function setUri(?string $uri): self { - $this->uri = mb_substr($uri, 0, 191); + $this->uri = \is_null($uri) ? null : mb_substr($uri, 0, 191); return $this; } diff --git a/plugins/ProfileColor/Entity/ProfileColor.php b/plugins/ProfileColor/Entity/ProfileColor.php index 8d4bae66f3..f275c839b0 100644 --- a/plugins/ProfileColor/Entity/ProfileColor.php +++ b/plugins/ProfileColor/Entity/ProfileColor.php @@ -41,8 +41,8 @@ class ProfileColor extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $actor_id; - private ?string $background; - private ?string $color; + private ?string $background = null; + private ?string $color = null; private DateTimeInterface $created; private DateTimeInterface $modified; diff --git a/src/Entity/Activity.php b/src/Entity/Activity.php index 8b6db97630..1ddacc990a 100644 --- a/src/Entity/Activity.php +++ b/src/Entity/Activity.php @@ -49,7 +49,7 @@ class Activity extends Entity private string $verb; private string $object_type; private int $object_id; - private ?string $source; + private ?string $source = null; private \DateTimeInterface $created; public function setId(int $id): self @@ -109,7 +109,7 @@ class Activity extends Entity public function setSource(?string $source): self { - $this->source = \mb_substr($source, 0, 32); + $this->source = \is_null($source) ? null : \mb_substr($source, 0, 32); return $this; } diff --git a/src/Entity/ActorCircle.php b/src/Entity/ActorCircle.php index badeeb4c7f..4106812270 100644 --- a/src/Entity/ActorCircle.php +++ b/src/Entity/ActorCircle.php @@ -48,12 +48,12 @@ class ActorCircle extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private ?int $tagger; + private ?int $tagger = null; private int $tagged; private string $tag; private bool $use_canonical; - private ?string $description; - private ?bool $private; + private ?string $description = null; + private ?bool $private = false; private \DateTimeInterface $created; private \DateTimeInterface $modified; diff --git a/src/Entity/ConfirmAddress.php b/src/Entity/ConfirmAddress.php index 3e3c37f808..af19a0cd66 100644 --- a/src/Entity/ConfirmAddress.php +++ b/src/Entity/ConfirmAddress.php @@ -41,11 +41,11 @@ class ConfirmAddress extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private string $code; - private ?int $user_id; + private ?int $user_id = 0; private string $address; - private ?string $address_extra; + private ?string $address_extra = null; private string $address_type; - private ?\DateTimeInterface $claimed; + private ?\DateTimeInterface $claimed = null; private \DateTimeInterface $sent; private \DateTimeInterface $modified; @@ -84,7 +84,7 @@ class ConfirmAddress extends Entity public function setAddressExtra(?string $address_extra): self { - $this->address_extra = \mb_substr($address_extra, 0, 191); + $this->address_extra = \is_null($address_extra) ? null : \mb_substr($address_extra, 0, 191); return $this; } diff --git a/src/Entity/GroupMember.php b/src/Entity/GroupMember.php index 00a00b3afc..3b96505547 100644 --- a/src/Entity/GroupMember.php +++ b/src/Entity/GroupMember.php @@ -44,8 +44,8 @@ class GroupMember extends Entity // @codeCoverageIgnoreStart private int $group_id; private int $actor_id; - private ?bool $is_admin; - private ?string $uri; + private ?bool $is_admin = false; + private ?string $uri = null; private \DateTimeInterface $created; private \DateTimeInterface $modified; @@ -84,7 +84,7 @@ class GroupMember extends Entity public function setUri(?string $uri): self { - $this->uri = \mb_substr($uri, 0, 191); + $this->uri = \is_null($uri) ? null : \mb_substr($uri, 0, 191); return $this; } diff --git a/src/Entity/Invitation.php b/src/Entity/Invitation.php index 08e7b36f7f..85fe398982 100644 --- a/src/Entity/Invitation.php +++ b/src/Entity/Invitation.php @@ -44,7 +44,7 @@ class Invitation extends Entity private int $user_id; private string $address; private string $address_type; - private ?int $registered_user_id; + private ?int $registered_user_id = null; private \DateTimeInterface $created; public function setCode(string $code): self diff --git a/src/Entity/LocalGroup.php b/src/Entity/LocalGroup.php index ae58f9297a..c75186a913 100644 --- a/src/Entity/LocalGroup.php +++ b/src/Entity/LocalGroup.php @@ -43,7 +43,7 @@ class LocalGroup extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $group_id; - private ?string $nickname; + private ?string $nickname = null; private \DateTimeInterface $created; private \DateTimeInterface $modified; @@ -60,7 +60,7 @@ class LocalGroup extends Entity public function setNickname(?string $nickname): self { - $this->nickname = \mb_substr($nickname, 0, 64); + $this->nickname = \is_null($nickname) ? null : \mb_substr($nickname, 0, 64); return $this; } diff --git a/src/Entity/LocalUser.php b/src/Entity/LocalUser.php index 5970035be6..fc5147819f 100644 --- a/src/Entity/LocalUser.php +++ b/src/Entity/LocalUser.php @@ -60,17 +60,17 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs // @codeCoverageIgnoreStart private int $id; private string $nickname; - private ?string $password; - private ?string $outgoing_email; - private ?string $incoming_email; - private ?bool $is_email_verified; - private ?string $timezone; - private ?PhoneNumber $phone_number; - private ?int $sms_carrier; - private ?string $sms_email; - private ?bool $auto_subscribe_back; - private ?int $subscription_policy; - private ?bool $is_stream_private; + private ?string $password = null; + private ?string $outgoing_email = null; + private ?string $incoming_email = null; + private ?bool $is_email_verified = false; + private ?string $timezone = null; + private ?PhoneNumber $phone_number = null; + private ?int $sms_carrier = null; + private ?string $sms_email = null; + private ?bool $auto_subscribe_back = false; + private ?int $subscription_policy = 0; + private ?bool $is_stream_private = false; private \DateTimeInterface $created; private \DateTimeInterface $modified; @@ -98,7 +98,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs public function setPassword(?string $password): self { - $this->password = \mb_substr($password, 0, 191); + $this->password = \is_null($password) ? null : \mb_substr($password, 0, 191); return $this; } @@ -109,7 +109,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs public function setOutgoingEmail(?string $outgoing_email): self { - $this->outgoing_email = \mb_substr($outgoing_email, 0, 191); + $this->outgoing_email = \is_null($outgoing_email) ? null : \mb_substr($outgoing_email, 0, 191); return $this; } @@ -120,7 +120,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs public function setIncomingEmail(?string $incoming_email): self { - $this->incoming_email = \mb_substr($incoming_email, 0, 191); + $this->incoming_email = \is_null($incoming_email) ? null : \mb_substr($incoming_email, 0, 191); return $this; } @@ -142,7 +142,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs public function setTimezone(?string $timezone): self { - $this->timezone = \mb_substr($timezone, 0, 50); + $this->timezone = \is_null($timezone) ? null : \mb_substr($timezone, 0, 50); return $this; } @@ -175,7 +175,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs public function setSmsEmail(?string $sms_email): self { - $this->sms_email = \mb_substr($sms_email, 0, 191); + $this->sms_email = \is_null($sms_email) ? null : \mb_substr($sms_email, 0, 191); return $this; } diff --git a/src/Entity/LocationService.php b/src/Entity/LocationService.php index d67d9f2ab0..a2e24c0d2a 100644 --- a/src/Entity/LocationService.php +++ b/src/Entity/LocationService.php @@ -41,7 +41,7 @@ class LocationService extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private ?string $description; + private ?string $description = null; private \DateTimeInterface $created; private \DateTimeInterface $modified; @@ -58,7 +58,7 @@ class LocationService extends Entity public function setDescription(?string $description): self { - $this->description = \mb_substr($description, 0, 191); + $this->description = \is_null($description) ? null : \mb_substr($description, 0, 191); return $this; } diff --git a/src/Entity/Note.php b/src/Entity/Note.php index 083f0606b4..78232f0ae1 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -52,16 +52,16 @@ class Note extends Entity // @codeCoverageIgnoreStart private int $id; private int $actor_id; - private ?string $content; + private ?string $content = null; private string $content_type = 'text/plain'; - private ?string $rendered; + private ?string $rendered = null; private int $conversation_id; private ?int $reply_to = null; private bool $is_local; - private ?string $source; - private int $scope = 1; //VisibilityScope::EVERYWHERE->value; - private ?string $url; - private ?int $language_id; + private ?string $source = null; + private int $scope = 1; //VisibilityScope::EVERYWHERE->value; + private ?string $url = null; + private ?int $language_id = null; private \DateTimeInterface $created; private \DateTimeInterface $modified; @@ -155,7 +155,7 @@ class Note extends Entity public function setSource(?string $source): self { - $this->source = \mb_substr($source, 0, 32); + $this->source = \is_null($source) ? null : \mb_substr($source, 0, 32); return $this; } diff --git a/src/Entity/NoteLocation.php b/src/Entity/NoteLocation.php index 08b2b8551d..e042367287 100644 --- a/src/Entity/NoteLocation.php +++ b/src/Entity/NoteLocation.php @@ -41,10 +41,10 @@ class NoteLocation extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $note_id; - private ?float $lat; - private ?float $lon; - private ?int $location_id; - private ?int $location_service; + private ?float $lat = null; + private ?float $lon = null; + private ?int $location_id = null; + private ?int $location_service = null; private \DateTimeInterface $modified; public function setNoteId(int $note_id): self diff --git a/src/Entity/NoteTag.php b/src/Entity/NoteTag.php index 30387c67c0..a0260b81e9 100644 --- a/src/Entity/NoteTag.php +++ b/src/Entity/NoteTag.php @@ -50,7 +50,7 @@ class NoteTag extends Entity private string $canonical; private int $note_id; private bool $use_canonical; - private ?int $language_id; + private ?int $language_id = null; private \DateTimeInterface $created; public function setTag(string $tag): self diff --git a/src/Entity/ResetPasswordRequest.php b/src/Entity/ResetPasswordRequest.php index 4833757bb1..7f52d24344 100644 --- a/src/Entity/ResetPasswordRequest.php +++ b/src/Entity/ResetPasswordRequest.php @@ -14,8 +14,8 @@ class ResetPasswordRequest extends Entity implements ResetPasswordRequestInterfa // @codeCoverageIgnoreStart private int $id; private int $user_id; - private ?string $selector; - private ?string $token; + private ?string $selector = null; + private ?string $token = null; private \DateTimeInterface $expires; private \DateTimeInterface $created; @@ -43,7 +43,7 @@ class ResetPasswordRequest extends Entity implements ResetPasswordRequestInterfa public function setSelector(?string $selector): self { - $this->selector = \mb_substr($selector, 0, 20); + $this->selector = \is_null($selector) ? null : \mb_substr($selector, 0, 20); return $this; } @@ -54,7 +54,7 @@ class ResetPasswordRequest extends Entity implements ResetPasswordRequestInterfa public function setToken(?string $token): self { - $this->token = \mb_substr($token, 0, 100); + $this->token = \is_null($token) ? null : \mb_substr($token, 0, 100); return $this; } diff --git a/src/Entity/SmsCarrier.php b/src/Entity/SmsCarrier.php index ddf131f769..70fb511afd 100644 --- a/src/Entity/SmsCarrier.php +++ b/src/Entity/SmsCarrier.php @@ -41,7 +41,7 @@ class SmsCarrier extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private ?string $name; + private ?string $name = null; private string $email_pattern; private \DateTimeInterface $created; private \DateTimeInterface $modified; @@ -59,7 +59,7 @@ class SmsCarrier extends Entity public function setName(?string $name): self { - $this->name = \mb_substr($name, 0, 64); + $this->name = \is_null($name) ? null : \mb_substr($name, 0, 64); return $this; } diff --git a/src/Entity/UserLocationPrefs.php b/src/Entity/UserLocationPrefs.php index a26b00ba8a..1f151a2011 100644 --- a/src/Entity/UserLocationPrefs.php +++ b/src/Entity/UserLocationPrefs.php @@ -39,7 +39,7 @@ class UserLocationPrefs extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $user_id; - private ?bool $share_location; + private ?bool $share_location = true; private \DateTimeInterface $created; private \DateTimeInterface $modified; diff --git a/src/Entity/UserUrlShortenerPrefs.php b/src/Entity/UserUrlShortenerPrefs.php index cee4227eb3..f4a57ce2b7 100644 --- a/src/Entity/UserUrlShortenerPrefs.php +++ b/src/Entity/UserUrlShortenerPrefs.php @@ -41,7 +41,7 @@ class UserUrlShortenerPrefs extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $user_id; - private ?string $url_shortening_service; + private ?string $url_shortening_service = 'internal'; private int $max_url_length; private int $max_notice_length; private \DateTimeInterface $created; @@ -60,7 +60,7 @@ class UserUrlShortenerPrefs extends Entity public function setUrlShorteningService(?string $url_shortening_service): self { - $this->url_shortening_service = \mb_substr($url_shortening_service, 0, 50); + $this->url_shortening_service = \is_null($url_shortening_service) ? null : \mb_substr($url_shortening_service, 0, 50); return $this; }