From c79b1e4c9485773e60f9f435e56893630fa60df8 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sun, 26 Dec 2021 15:12:06 +0000 Subject: [PATCH] [AUTOGENERATED] Update auto generated code --- components/Attachment/Entity/Attachment.php | 20 +++--- .../Attachment/Entity/AttachmentThumbnail.php | 61 +++++++++---------- .../Attachment/Entity/AttachmentToLink.php | 24 ++++---- components/Avatar/Entity/Avatar.php | 11 ++-- components/Bridge/Entity/ForeignLink.php | 2 +- components/Bridge/Entity/ForeignService.php | 4 +- components/Bridge/Entity/ForeignUser.php | 4 +- .../Conversation/Entity/Conversation.php | 1 - components/Feed/Util/FeedController.php | 17 +++--- .../Entity/FreeNetworkActorProtocol.php | 31 +++++----- components/Language/Entity/ActorLanguage.php | 11 ++-- components/Language/Entity/Language.php | 25 ++++---- components/Language/Language.php | 2 +- components/Link/Entity/Link.php | 38 ++++++------ components/Link/Entity/NoteToLink.php | 1 + .../Notification/Entity/Notification.php | 2 +- .../Entity/UserNotificationPrefs.php | 2 +- components/Posting/Posting.php | 50 ++++++--------- .../Entity/ActivitypubActivity.php | 10 +-- .../ActivityPub/Entity/ActivitypubActor.php | 59 +++++++++--------- .../ActivityPub/Entity/ActivitypubObject.php | 24 ++++---- plugins/ActivityPub/Entity/ActivitypubRsa.php | 31 +++++----- plugins/ActivityPub/Util/Model/Activity.php | 2 +- .../Entity/Collection.php | 2 +- plugins/Embed/Entity/AttachmentEmbed.php | 37 +++++------ plugins/Favourite/Entity/Favourite.php | 1 - plugins/Oomox/Entity/Oomox.php | 5 +- plugins/Poll/Entity/Poll.php | 2 +- plugins/Poll/Entity/PollResponse.php | 4 +- plugins/ProfileColor/Entity/ProfileColor.php | 26 ++++---- src/Entity/Activity.php | 12 ++-- src/Entity/Actor.php | 27 ++++---- src/Entity/ActorBlock.php | 4 +- src/Entity/ActorCircle.php | 14 ++--- src/Entity/ActorCircleSubscription.php | 16 ++--- src/Entity/ActorTag.php | 10 +-- src/Entity/ActorTagBlock.php | 10 +-- src/Entity/ConfirmAddress.php | 20 +++--- src/Entity/Feed.php | 12 ++-- src/Entity/GroupAlias.php | 6 +- src/Entity/GroupBlock.php | 4 +- src/Entity/GroupInbox.php | 4 +- src/Entity/GroupMember.php | 14 ++--- src/Entity/Invitation.php | 10 +-- src/Entity/LocalGroup.php | 10 +-- src/Entity/LocalUser.php | 24 ++++---- src/Entity/LocationService.php | 10 +-- src/Entity/Note.php | 24 ++++---- src/Entity/NoteLocation.php | 4 +- src/Entity/NoteSource.php | 10 +-- src/Entity/NoteTag.php | 16 ++--- src/Entity/NoteTagBlock.php | 10 +-- src/Entity/RelatedGroup.php | 4 +- src/Entity/RememberMeToken.php | 12 ++-- src/Entity/ReservedNickname.php | 6 +- src/Entity/ResetPasswordRequest.php | 16 ++--- src/Entity/SmsCarrier.php | 12 ++-- src/Entity/Subscription.php | 8 +-- src/Entity/SubscriptionQueue.php | 4 +- src/Entity/UserLocationPrefs.php | 8 +-- src/Entity/UserUrlShortenerPrefs.php | 10 +-- 61 files changed, 426 insertions(+), 434 deletions(-) diff --git a/components/Attachment/Entity/Attachment.php b/components/Attachment/Entity/Attachment.php index 45f1abf5a0..9191e7c6ac 100644 --- a/components/Attachment/Entity/Attachment.php +++ b/components/Attachment/Entity/Attachment.php @@ -59,7 +59,7 @@ class Attachment extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private int $lives = 1; + private int $lives; private ?string $filehash; private ?string $mimetype; private ?string $filename; @@ -79,19 +79,20 @@ class Attachment extends Entity return $this->id; } + public function setLives(int $lives): self + { + $this->lives = $lives; + return $this; + } + public function getLives(): int { return $this->lives; } - public function setLives(int $lives): void - { - $this->lives = $lives; - } - public function setFilehash(?string $filehash): self { - $this->filehash = $filehash; + $this->filehash = mb_substr($filehash, 0, 64); return $this; } @@ -102,7 +103,7 @@ class Attachment extends Entity public function setMimetype(?string $mimetype): self { - $this->mimetype = $mimetype; + $this->mimetype = mb_substr($mimetype, 0, 255); return $this; } @@ -113,7 +114,7 @@ class Attachment extends Entity public function setFilename(?string $filename): self { - $this->filename = $filename; + $this->filename = mb_substr($filename, 0, 191); return $this; } @@ -317,7 +318,6 @@ class Attachment extends Entity Event::handle('AttachmentGetBestTitle', [$this, $note, &$title]); return $title; } - }); if ($title != null) { return $title; diff --git a/components/Attachment/Entity/AttachmentThumbnail.php b/components/Attachment/Entity/AttachmentThumbnail.php index 83b674e2ef..fbf4248d1b 100644 --- a/components/Attachment/Entity/AttachmentThumbnail.php +++ b/components/Attachment/Entity/AttachmentThumbnail.php @@ -66,12 +66,11 @@ class AttachmentThumbnail extends Entity 'medium' => self::SIZE_MEDIUM, 'big' => self::SIZE_BIG, ]; - // {{{ Autocode // @codeCoverageIgnoreStart private int $attachment_id; private ?string $mimetype; - private int $size = self::SIZE_SMALL; + private int $size = 0; private string $filename; private int $width; private int $height; @@ -90,7 +89,7 @@ class AttachmentThumbnail extends Entity public function setMimetype(?string $mimetype): self { - $this->mimetype = $mimetype; + $this->mimetype = mb_substr($mimetype, 0, 129); return $this; } @@ -99,20 +98,20 @@ class AttachmentThumbnail extends Entity return $this->mimetype; } - public function getSize(): int - { - return $this->size; - } - public function setSize(int $size): self { $this->size = $size; return $this; } + public function getSize(): int + { + return $this->size; + } + public function setFilename(string $filename): self { - $this->filename = $filename; + $this->filename = mb_substr($filename, 0, 191); return $this; } @@ -121,6 +120,28 @@ class AttachmentThumbnail extends Entity return $this->filename; } + public function setWidth(int $width): self + { + $this->width = $width; + return $this; + } + + public function getWidth(): int + { + return $this->width; + } + + public function setHeight(int $height): self + { + $this->height = $height; + return $this; + } + + public function getHeight(): int + { + return $this->height; + } + public function setModified(DateTimeInterface $modified): self { $this->modified = $modified; @@ -132,28 +153,6 @@ class AttachmentThumbnail extends Entity return $this->modified; } - public function getWidth(): int - { - return $this->width; - } - - public function setWidth(int $width): self - { - $this->width = $width; - return $this; - } - - public function getHeight(): int - { - return $this->height; - } - - public function setHeight(int $height): self - { - $this->height = $height; - return $this; - } - // @codeCoverageIgnoreEnd // }}} Autocode diff --git a/components/Attachment/Entity/AttachmentToLink.php b/components/Attachment/Entity/AttachmentToLink.php index 5af047cd98..cf16582736 100644 --- a/components/Attachment/Entity/AttachmentToLink.php +++ b/components/Attachment/Entity/AttachmentToLink.php @@ -39,21 +39,10 @@ class AttachmentToLink extends Entity { // {{{ Autocode // @codeCoverageIgnoreStart - private int $attachment_id; private int $link_id; + private int $attachment_id; private DateTimeInterface $modified; - public function setAttachmentId(int $attachment_id): self - { - $this->attachment_id = $attachment_id; - return $this; - } - - public function getAttachmentId(): int - { - return $this->attachment_id; - } - public function setLinkId(int $link_id): self { $this->link_id = $link_id; @@ -65,6 +54,17 @@ class AttachmentToLink extends Entity return $this->link_id; } + public function setAttachmentId(int $attachment_id): self + { + $this->attachment_id = $attachment_id; + return $this; + } + + public function getAttachmentId(): int + { + return $this->attachment_id; + } + public function setModified(DateTimeInterface $modified): self { $this->modified = $modified; diff --git a/components/Avatar/Entity/Avatar.php b/components/Avatar/Entity/Avatar.php index 570c9f0dbe..15a321dc20 100644 --- a/components/Avatar/Entity/Avatar.php +++ b/components/Avatar/Entity/Avatar.php @@ -77,16 +77,17 @@ class Avatar extends Entity return $this->attachment_id; } + public function setTitle(?string $title): self + { + $this->title = mb_substr($title, 0, 191); + return $this; + } + public function getTitle(): ?string { return $this->title; } - public function setTitle(?string $title): void - { - $this->title = $title; - } - public function setCreated(DateTimeInterface $created): self { $this->created = $created; diff --git a/components/Bridge/Entity/ForeignLink.php b/components/Bridge/Entity/ForeignLink.php index aa6d7a140a..a90e153c52 100644 --- a/components/Bridge/Entity/ForeignLink.php +++ b/components/Bridge/Entity/ForeignLink.php @@ -88,7 +88,7 @@ class ForeignLink public function setCredentials(?string $credentials): self { - $this->credentials = $credentials; + $this->credentials = mb_substr($credentials, 0, 191); return $this; } diff --git a/components/Bridge/Entity/ForeignService.php b/components/Bridge/Entity/ForeignService.php index 20a67bd6c9..09850ded6d 100644 --- a/components/Bridge/Entity/ForeignService.php +++ b/components/Bridge/Entity/ForeignService.php @@ -60,7 +60,7 @@ class ForeignService public function setName(string $name): self { - $this->name = $name; + $this->name = mb_substr($name, 0, 32); return $this; } @@ -71,7 +71,7 @@ class ForeignService public function setDescription(?string $description): self { - $this->description = $description; + $this->description = mb_substr($description, 0, 191); return $this; } diff --git a/components/Bridge/Entity/ForeignUser.php b/components/Bridge/Entity/ForeignUser.php index 42ee046b1f..70746606c7 100644 --- a/components/Bridge/Entity/ForeignUser.php +++ b/components/Bridge/Entity/ForeignUser.php @@ -72,7 +72,7 @@ class ForeignUser public function setUri(string $uri): self { - $this->uri = $uri; + $this->uri = mb_substr($uri, 0, 191); return $this; } @@ -83,7 +83,7 @@ class ForeignUser public function setNickname(?string $nickname): self { - $this->nickname = $nickname; + $this->nickname = mb_substr($nickname, 0, 191); return $this; } diff --git a/components/Conversation/Entity/Conversation.php b/components/Conversation/Entity/Conversation.php index 3060283b40..fce7a5ee9c 100644 --- a/components/Conversation/Entity/Conversation.php +++ b/components/Conversation/Entity/Conversation.php @@ -46,7 +46,6 @@ class Conversation extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $id; - private string $uri; private int $initial_note_id; public function setId(int $id): self diff --git a/components/Feed/Util/FeedController.php b/components/Feed/Util/FeedController.php index 7ac7afbcce..ba1a678f64 100644 --- a/components/Feed/Util/FeedController.php +++ b/components/Feed/Util/FeedController.php @@ -38,7 +38,6 @@ use App\Core\Log; use App\Core\VisibilityScope; use App\Entity\Actor; use App\Util\Common; -use function array_key_exists; abstract class FeedController extends Controller { @@ -51,7 +50,7 @@ abstract class FeedController extends Controller { $actor = Common::actor(); - if (array_key_exists('notes', $result)) { + if (\array_key_exists('notes', $result)) { $notes = $result['notes']; self::enforceScope($notes, $actor); Event::handle('FilterNoteList', [$actor, &$notes, $result['request']]); @@ -64,20 +63,20 @@ abstract class FeedController extends Controller private static function enforceScope(array &$notes, ?Actor $actor): void { $filtered_notes = []; - foreach($notes as $note) { - switch($note->getScope()) { + foreach ($notes as $note) { + switch ($note->getScope()) { case VisibilityScope::LOCAL: // The controller handles it if private case VisibilityScope::PUBLIC: $filtered_notes[] = $note; break; case VisibilityScope::ADDRESSEE: // If the actor is logged in and - if (!is_null($actor) && - ( + if (!\is_null($actor) + && ( // Is either the author Or - $note->getActorId() == $actor->getId() || + $note->getActorId() == $actor->getId() // one of the targets - in_array($actor->getId(), $note->getNotificationTargetIds()) + || \in_array($actor->getId(), $note->getNotificationTargetIds()) )) { $filtered_notes[] = $note; } @@ -85,7 +84,7 @@ abstract class FeedController extends Controller case VisibilityScope::GROUP: // Only for the group to see break; - case VisibilityScope::COLLECTION: // no break + case VisibilityScope::COLLECTION: case VisibilityScope::MESSAGE: // Only for the collection to see (they will only find it in their notifications) break; diff --git a/components/FreeNetwork/Entity/FreeNetworkActorProtocol.php b/components/FreeNetwork/Entity/FreeNetworkActorProtocol.php index ae5fca598d..d53050185d 100644 --- a/components/FreeNetwork/Entity/FreeNetworkActorProtocol.php +++ b/components/FreeNetwork/Entity/FreeNetworkActorProtocol.php @@ -47,27 +47,27 @@ use DateTimeInterface; class FreeNetworkActorProtocol extends Entity { // {{{ Autocode - // @codeCoverageIgnoreStart; + // @codeCoverageIgnoreStart private int $actor_id; private ?string $protocol; - private ?string $addr; + private string $addr; private DateTimeInterface $created; private DateTimeInterface $modified; - public function getActorId(): int - { - return $this->actor_id; - } - public function setActorId(int $actor_id): self { $this->actor_id = $actor_id; return $this; } + public function getActorId(): int + { + return $this->actor_id; + } + public function setProtocol(?string $protocol): self { - $this->protocol = $protocol; + $this->protocol = mb_substr($protocol, 0, 32); return $this; } @@ -87,14 +87,20 @@ class FreeNetworkActorProtocol extends Entity return $this->addr; } + public function setCreated(DateTimeInterface $created): self + { + $this->created = $created; + return $this; + } + public function getCreated(): DateTimeInterface { return $this->created; } - public function setCreated(DateTimeInterface $created): self + public function setModified(DateTimeInterface $modified): self { - $this->created = $created; + $this->modified = $modified; return $this; } @@ -103,11 +109,6 @@ class FreeNetworkActorProtocol extends Entity return $this->modified; } - public function setModified(DateTimeInterface $modified): self - { - $this->modified = $modified; - return $this; - } // @codeCoverageIgnoreEnd // }}} Autocode diff --git a/components/Language/Entity/ActorLanguage.php b/components/Language/Entity/ActorLanguage.php index 0238f994ca..de452fabdc 100644 --- a/components/Language/Entity/ActorLanguage.php +++ b/components/Language/Entity/ActorLanguage.php @@ -71,16 +71,17 @@ class ActorLanguage extends Entity return $this->language_id; } - public function getOrdering(): int - { - return $this->ordering; - } - public function setOrdering(int $ordering): self { $this->ordering = $ordering; return $this; } + + public function getOrdering(): int + { + return $this->ordering; + } + // @codeCoverageIgnoreEnd // }}} Autocode diff --git a/components/Language/Entity/Language.php b/components/Language/Entity/Language.php index fc9dd44316..52cbf44d20 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; + private ?string $long_display; + private ?string $short_display; private DateTimeInterface $created; public function setId(int $id): self @@ -64,35 +64,35 @@ class Language extends Entity return $this->id; } - public function setLocale(string $locale): self + public function setLocale(?string $locale): self { - $this->locale = $locale; + $this->locale = mb_substr($locale, 0, 64); return $this; } - public function getLocale(): string + public function getLocale(): ?string { return $this->locale; } - public function setLongDisplay(string $long_display): self + public function setLongDisplay(?string $long_display): self { - $this->long_display = $long_display; + $this->long_display = mb_substr($long_display, 0, 64); return $this; } - public function getLongDisplay(): string + public function getLongDisplay(): ?string { return $this->long_display; } - public function setShortDisplay(string $short_display): self + public function setShortDisplay(?string $short_display): self { - $this->short_display = $short_display; + $this->short_display = mb_substr($short_display, 0, 12); return $this; } - public function getShortDisplay(): string + public function getShortDisplay(): ?string { return $this->short_display; } @@ -107,6 +107,7 @@ class Language extends Entity { return $this->created; } + // @codeCoverageIgnoreEnd // }}} Autocode diff --git a/components/Language/Language.php b/components/Language/Language.php index ed9e5e49f8..c50be9c701 100644 --- a/components/Language/Language.php +++ b/components/Language/Language.php @@ -51,7 +51,7 @@ class Language extends Component } $notes = F\select( $notes, - fn (Note $n) => is_null($n->getLanguageId()) || \in_array($n->getLanguageId(), ActorLanguage::getActorRelatedLanguagesIds($actor)), + fn (Note $n) => \is_null($n->getLanguageId()) || \in_array($n->getLanguageId(), ActorLanguage::getActorRelatedLanguagesIds($actor)), ); return Event::next; diff --git a/components/Link/Entity/Link.php b/components/Link/Entity/Link.php index 812bc7a840..641dc0ec02 100644 --- a/components/Link/Entity/Link.php +++ b/components/Link/Entity/Link.php @@ -65,20 +65,20 @@ class Link extends Entity return $this->id; } - public function getUrl(): ?string - { - return $this->url; - } - public function setUrl(?string $url): self { $this->url = $url; return $this; } + public function getUrl(): ?string + { + return $this->url; + } + public function setUrlHash(?string $url_hash): self { - $this->url_hash = $url_hash; + $this->url_hash = mb_substr($url_hash, 0, 64); return $this; } @@ -89,7 +89,7 @@ class Link extends Entity public function setMimetype(?string $mimetype): self { - $this->mimetype = $mimetype; + $this->mimetype = mb_substr($mimetype, 0, 50); return $this; } @@ -98,18 +98,6 @@ class Link extends Entity return $this->mimetype; } - public function getMimetypeMajor(): ?string - { - $mime = $this->getMimetype(); - return \is_null($mime) ? $mime : GSFile::mimetypeMajor($mime); - } - - public function getMimetypeMinor(): ?string - { - $mime = $this->getMimetype(); - return \is_null($mime) ? $mime : GSFile::mimetypeMinor($mime); - } - public function setModified(DateTimeInterface $modified): self { $this->modified = $modified; @@ -172,6 +160,18 @@ class Link extends Entity } } + public function getMimetypeMajor(): ?string + { + $mime = $this->getMimetype(); + return \is_null($mime) ? $mime : GSFile::mimetypeMajor($mime); + } + + public function getMimetypeMinor(): ?string + { + $mime = $this->getMimetype(); + return \is_null($mime) ? $mime : GSFile::mimetypeMinor($mime); + } + public static function schemaDef(): array { return [ diff --git a/components/Link/Entity/NoteToLink.php b/components/Link/Entity/NoteToLink.php index a72720377f..b2f37d5134 100644 --- a/components/Link/Entity/NoteToLink.php +++ b/components/Link/Entity/NoteToLink.php @@ -76,6 +76,7 @@ class NoteToLink extends Entity { return $this->modified; } + // @codeCoverageIgnoreEnd // }}} Autocode diff --git a/components/Notification/Entity/Notification.php b/components/Notification/Entity/Notification.php index 6a0db9983d..46ff0ade62 100644 --- a/components/Notification/Entity/Notification.php +++ b/components/Notification/Entity/Notification.php @@ -75,7 +75,7 @@ class Notification extends Entity public function setReason(?string $reason): self { - $this->reason = $reason; + $this->reason = mb_substr($reason, 0, 191); return $this; } diff --git a/components/Notification/Entity/UserNotificationPrefs.php b/components/Notification/Entity/UserNotificationPrefs.php index 76d8626ee0..dfbc547c9d 100644 --- a/components/Notification/Entity/UserNotificationPrefs.php +++ b/components/Notification/Entity/UserNotificationPrefs.php @@ -66,7 +66,7 @@ class UserNotificationPrefs extends Entity public function setTransport(string $transport): self { - $this->transport = $transport; + $this->transport = mb_substr($transport, 0, 191); return $this; } diff --git a/components/Posting/Posting.php b/components/Posting/Posting.php index dbcf64cd5d..768496ab4d 100644 --- a/components/Posting/Posting.php +++ b/components/Posting/Posting.php @@ -24,21 +24,20 @@ declare(strict_types = 1); namespace Component\Posting; use App\Core\DB\DB; -use App\Core\Entity; use App\Core\Event; use App\Core\Form; use App\Core\GSFile; -use App\Core\VisibilityScope; -use App\Util\Exception\BugFoundException; use function App\Core\I18n\_m; use App\Core\Modules\Component; use App\Core\Router\Router; use App\Core\Security; +use App\Core\VisibilityScope; use App\Entity\Activity; use App\Entity\Actor; use App\Entity\GroupInbox; use App\Entity\Note; use App\Util\Common; +use App\Util\Exception\BugFoundException; use App\Util\Exception\ClientException; use App\Util\Exception\DuplicateFoundException; use App\Util\Exception\RedirectException; @@ -58,8 +57,6 @@ use Symfony\Component\HttpFoundation\File\Exception\FormSizeFileException; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Validator\Constraints\Length; -use function count; -use function is_null; class Posting extends Component { @@ -73,7 +70,7 @@ class Posting extends Component */ public function onAppendRightPostingBlock(Request $request, array &$res): bool { - if (is_null($user = Common::user())) { + if (\is_null($user = Common::user())) { return Event::next; } @@ -105,15 +102,15 @@ class Posting extends Component // TODO: if in group page, add GROUP visibility to the choices. $form_params[] = ['visibility', ChoiceType::class, ['label' => _m('Visibility:'), 'multiple' => false, 'expanded' => false, 'data' => 'public', 'choices' => [ - _m('Public') => VisibilityScope::PUBLIC, - _m('Local') => VisibilityScope::LOCAL, - _m('Addressee') => VisibilityScope::ADDRESSEE + _m('Public') => VisibilityScope::PUBLIC, + _m('Local') => VisibilityScope::LOCAL, + _m('Addressee') => VisibilityScope::ADDRESSEE, ]]]; $form_params[] = ['content', TextareaType::class, ['label' => _m('Content:'), 'data' => $initial_content, 'attr' => ['placeholder' => _m($placeholder)], 'constraints' => [new Length(['max' => Common::config('site', 'text_limit')])]]]; $form_params[] = ['attachments', FileType::class, ['label' => _m('Attachments:'), 'multiple' => true, 'required' => false, 'invalid_message' => _m('Attachment not valid.')]]; $form_params[] = FormFields::language($actor, $context_actor, label: _m('Note language'), help: _m('The selected language will be federated and added as a lang attribute, preferred language can be set up in settings')); - if (count($available_content_types) > 1) { + if (\count($available_content_types) > 1) { $form_params[] = ['content_type', ChoiceType::class, [ 'label' => _m('Text format:'), 'multiple' => false, 'expanded' => false, @@ -174,32 +171,25 @@ class Posting extends Component * $actor_id, possibly as a reply to note $reply_to and with flag * $is_local. Sanitizes $content and $attachments * - * @param Actor $actor - * @param string|null $content - * @param string $content_type - * @param string|null $language - * @param int|null $scope - * @param string|null $target - * @param array $attachments Array of UploadedFile to be stored as GSFiles associated to this note - * @param array $processed_attachments Array of [Attachment, Attachment's name] to be associated to this $actor and Note + * @param array $attachments Array of UploadedFile to be stored as GSFiles associated to this note + * @param array $processed_attachments Array of [Attachment, Attachment's name] to be associated to this $actor and Note * @param array $process_note_content_extra_args Extra arguments for the event ProcessNoteContent * - * @return Note + * @throws BugFoundException * @throws ClientException * @throws DuplicateFoundException * @throws ServerException - * @throws BugFoundException */ public static function storeLocalNote( - Actor $actor, + Actor $actor, ?string $content, - string $content_type, + string $content_type, ?string $language = null, - ?int $scope = null, + ?int $scope = null, ?string $target = null, - array $attachments = [], - array $processed_attachments = [], - array $process_note_content_extra_args = [], + array $attachments = [], + array $processed_attachments = [], + array $process_note_content_extra_args = [], ): Note { $scope ??= VisibilityScope::PUBLIC; // TODO: If site is private, default to LOCAL $rendered = null; @@ -213,9 +203,9 @@ class Posting extends Component 'content' => $content, 'content_type' => $content_type, 'rendered' => $rendered, - 'language_id' => !is_null($language) ? Language::getByLocale($language)->getId() : null, + 'language_id' => !\is_null($language) ? Language::getByLocale($language)->getId() : null, 'is_local' => true, - 'scope' => $scope, + 'scope' => $scope, ]); /** @var UploadedFile[] $attachments */ @@ -261,7 +251,7 @@ class Posting extends Component ]); DB::persist($activity); - if (!is_null($target)) { + if (!\is_null($target)) { switch ($target[0]) { case '!': $mentions[] = [ @@ -277,7 +267,7 @@ class Posting extends Component $mentioned = []; foreach (F\unique(F\flat_map($mentions, fn (array $m) => $m['mentioned'] ?? []), fn (Actor $a) => $a->getId()) as $m) { - if (!is_null($m)) { + if (!\is_null($m)) { $mentioned[] = $m->getId(); if ($m->isGroup()) { diff --git a/plugins/ActivityPub/Entity/ActivitypubActivity.php b/plugins/ActivityPub/Entity/ActivitypubActivity.php index eb52ec6cb8..75b842c129 100644 --- a/plugins/ActivityPub/Entity/ActivitypubActivity.php +++ b/plugins/ActivityPub/Entity/ActivitypubActivity.php @@ -63,17 +63,17 @@ class ActivitypubActivity extends Entity return $this->activity_id; } - public function getActivityUri(): string - { - return $this->activity_uri; - } - public function setActivityUri(string $activity_uri): self { $this->activity_uri = $activity_uri; return $this; } + public function getActivityUri(): string + { + return $this->activity_uri; + } + public function setCreated(DateTimeInterface $created): self { $this->created = $created; diff --git a/plugins/ActivityPub/Entity/ActivitypubActor.php b/plugins/ActivityPub/Entity/ActivitypubActor.php index a1659cea9b..85816f5a05 100644 --- a/plugins/ActivityPub/Entity/ActivitypubActor.php +++ b/plugins/ActivityPub/Entity/ActivitypubActor.php @@ -57,36 +57,20 @@ class ActivitypubActor extends Entity private string $uri; private int $actor_id; private string $inbox_uri; - private ?string $inbox_shared_uri = null; - private string $url; + private ?string $inbox_shared_uri; + private ?string $url; private DateTimeInterface $created; private DateTimeInterface $modified; - public function getUri(): string - { - return $this->uri; - } - public function setUri(string $uri): self { $this->uri = $uri; return $this; } - public function getUrl(): string + public function getUri(): string { - return $this->url; - } - - public function setUrl(string $url): self - { - $this->url = $url; - return $this; - } - - public function getActorId(): int - { - return $this->actor_id; + return $this->uri; } public function setActorId(int $actor_id): self @@ -95,9 +79,9 @@ class ActivitypubActor extends Entity return $this; } - public function getInboxUri(): string + public function getActorId(): int { - return $this->inbox_uri; + return $this->actor_id; } public function setInboxUri(string $inbox_uri): self @@ -106,20 +90,31 @@ class ActivitypubActor extends Entity return $this; } - public function getInboxSharedUri(): ?string + public function getInboxUri(): string { - return $this->inbox_shared_uri; + return $this->inbox_uri; } - public function setInboxSharedUri(?string $inbox_shared_uri = null): self + public function setInboxSharedUri(?string $inbox_shared_uri): self { $this->inbox_shared_uri = $inbox_shared_uri; return $this; } - public function getCreated(): DateTimeInterface + public function getInboxSharedUri(): ?string { - return $this->created; + return $this->inbox_shared_uri; + } + + public function setUrl(?string $url): self + { + $this->url = $url; + return $this; + } + + public function getUrl(): ?string + { + return $this->url; } public function setCreated(DateTimeInterface $created): self @@ -128,9 +123,9 @@ class ActivitypubActor extends Entity return $this; } - public function getModified(): DateTimeInterface + public function getCreated(): DateTimeInterface { - return $this->modified; + return $this->created; } public function setModified(DateTimeInterface $modified): self @@ -138,6 +133,12 @@ class ActivitypubActor extends Entity $this->modified = $modified; return $this; } + + public function getModified(): DateTimeInterface + { + return $this->modified; + } + // @codeCoverageIgnoreEnd // }}} Autocode diff --git a/plugins/ActivityPub/Entity/ActivitypubObject.php b/plugins/ActivityPub/Entity/ActivitypubObject.php index cdccdac441..7a24ffd5b8 100644 --- a/plugins/ActivityPub/Entity/ActivitypubObject.php +++ b/plugins/ActivityPub/Entity/ActivitypubObject.php @@ -47,30 +47,25 @@ class ActivitypubObject extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private string $object_uri; - private int $object_id; private string $object_type; + private int $object_id; private DateTimeInterface $created; private DateTimeInterface $modified; - public function getObjectUri(): string - { - return $this->object_uri; - } - public function setObjectUri(string $object_uri): self { $this->object_uri = $object_uri; return $this; } - public function getObjectId(): int + public function getObjectUri(): string { - return $this->object_id; + return $this->object_uri; } - public function setObjectId(int $object_id): self + public function setObjectType(string $object_type): self { - $this->object_id = $object_id; + $this->object_type = mb_substr($object_type, 0, 32); return $this; } @@ -79,12 +74,17 @@ class ActivitypubObject extends Entity return $this->object_type; } - public function setObjectType(string $object_type): self + public function setObjectId(int $object_id): self { - $this->object_type = $object_type; + $this->object_id = $object_id; return $this; } + public function getObjectId(): int + { + return $this->object_id; + } + public function setCreated(DateTimeInterface $created): self { $this->created = $created; diff --git a/plugins/ActivityPub/Entity/ActivitypubRsa.php b/plugins/ActivityPub/Entity/ActivitypubRsa.php index a0b3098cf5..de25dfea9a 100644 --- a/plugins/ActivityPub/Entity/ActivitypubRsa.php +++ b/plugins/ActivityPub/Entity/ActivitypubRsa.php @@ -50,36 +50,31 @@ class ActivitypubRsa extends Entity // {{{ Autocode // @codeCoverageIgnoreStart private int $actor_id; - private ?string $private_key = null; + private ?string $private_key; private string $public_key; private DateTimeInterface $created; private DateTimeInterface $modified; - public function getActorId(): int - { - return $this->actor_id; - } - public function setActorId(int $actor_id): self { $this->actor_id = $actor_id; return $this; } - public function getPrivateKey(): string + public function getActorId(): int { - return $this->private_key; + return $this->actor_id; } - public function setPrivateKey(string $private_key): self + public function setPrivateKey(?string $private_key): self { $this->private_key = $private_key; return $this; } - public function getPublicKey(): string + public function getPrivateKey(): ?string { - return $this->public_key; + return $this->private_key; } public function setPublicKey(string $public_key): self @@ -88,9 +83,9 @@ class ActivitypubRsa extends Entity return $this; } - public function getCreated(): DateTimeInterface + public function getPublicKey(): string { - return $this->created; + return $this->public_key; } public function setCreated(DateTimeInterface $created): self @@ -99,9 +94,9 @@ class ActivitypubRsa extends Entity return $this; } - public function getModified(): DateTimeInterface + public function getCreated(): DateTimeInterface { - return $this->modified; + return $this->created; } public function setModified(DateTimeInterface $modified): self @@ -109,6 +104,12 @@ class ActivitypubRsa extends Entity $this->modified = $modified; return $this; } + + public function getModified(): DateTimeInterface + { + return $this->modified; + } + // @codeCoverageIgnoreEnd // }}} Autocode diff --git a/plugins/ActivityPub/Util/Model/Activity.php b/plugins/ActivityPub/Util/Model/Activity.php index 170e9446f3..278fa73e12 100644 --- a/plugins/ActivityPub/Util/Model/Activity.php +++ b/plugins/ActivityPub/Util/Model/Activity.php @@ -167,7 +167,7 @@ class Activity extends Model ]; $attr['object'] = ($attr['type'] === 'Create') ? self::jsonToType(Model::toJson($object->getObject())) : ActivityPub::getUriByObject($object->getObject()); - if (!is_string($attr['object'])) { + if (!\is_string($attr['object'])) { $attr['to'] = array_unique(array_merge($attr['to'], $attr['object']->get('to'))); $attr['cc'] = array_unique(array_merge($attr['cc'], $attr['object']->get('cc'))); } diff --git a/plugins/AttachmentCollections/Entity/Collection.php b/plugins/AttachmentCollections/Entity/Collection.php index beb8772589..706c043c72 100644 --- a/plugins/AttachmentCollections/Entity/Collection.php +++ b/plugins/AttachmentCollections/Entity/Collection.php @@ -28,7 +28,7 @@ class Collection extends Entity public function setName(?string $name): self { - $this->name = $name; + $this->name = mb_substr($name, 0, 255); return $this; } diff --git a/plugins/Embed/Entity/AttachmentEmbed.php b/plugins/Embed/Entity/AttachmentEmbed.php index cb8e118640..e72dcc10fd 100644 --- a/plugins/Embed/Entity/AttachmentEmbed.php +++ b/plugins/Embed/Entity/AttachmentEmbed.php @@ -52,10 +52,10 @@ class AttachmentEmbed extends Entity // @codeCoverageIgnoreStart private int $link_id; private int $attachment_id; - private ?string $title; - private ?string $description; 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; @@ -72,16 +72,17 @@ class AttachmentEmbed extends Entity return $this->link_id; } + public function setAttachmentId(int $attachment_id): self + { + $this->attachment_id = $attachment_id; + return $this; + } + public function getAttachmentId(): int { return $this->attachment_id; } - public function setAttachmentId(int $attachment_id): void - { - $this->attachment_id = $attachment_id; - } - public function setProviderName(?string $provider_name): self { $this->provider_name = $provider_name; @@ -104,17 +105,6 @@ class AttachmentEmbed extends Entity return $this->provider_url; } - public function setDescription(?string $description): self - { - $this->description = $description; - return $this; - } - - public function getDescription(): ?string - { - return $this->description; - } - public function setTitle(?string $title): self { $this->title = $title; @@ -126,6 +116,17 @@ class AttachmentEmbed extends Entity return $this->title; } + public function setDescription(?string $description): self + { + $this->description = $description; + return $this; + } + + public function getDescription(): ?string + { + return $this->description; + } + public function setAuthorName(?string $author_name): self { $this->author_name = $author_name; diff --git a/plugins/Favourite/Entity/Favourite.php b/plugins/Favourite/Entity/Favourite.php index 86a6c1d5c5..7b2c247aa7 100644 --- a/plugins/Favourite/Entity/Favourite.php +++ b/plugins/Favourite/Entity/Favourite.php @@ -23,7 +23,6 @@ namespace Plugin\Favourite\Entity; use App\Core\Entity; use App\Entity\Note; -use App\Util\Formatting; use DateTimeInterface; class Favourite extends Entity diff --git a/plugins/Oomox/Entity/Oomox.php b/plugins/Oomox/Entity/Oomox.php index 86ca7fb8d7..014742fd99 100644 --- a/plugins/Oomox/Entity/Oomox.php +++ b/plugins/Oomox/Entity/Oomox.php @@ -197,6 +197,9 @@ class Oomox extends Entity return $this->modified; } + // @codeCoverageIgnoreEnd + // }}} Autocode + public function resetTheme(bool $is_light) { if ($is_light) { @@ -214,8 +217,6 @@ class Oomox extends Entity } } - // @codeCoverageIgnoreEnd - // }}} Autocode public static function schemaDef(): array { return [ diff --git a/plugins/Poll/Entity/Poll.php b/plugins/Poll/Entity/Poll.php index b1f0ef01a9..4c420ae6ef 100644 --- a/plugins/Poll/Entity/Poll.php +++ b/plugins/Poll/Entity/Poll.php @@ -63,7 +63,7 @@ class Poll extends Entity public function setUri(?string $uri): self { - $this->uri = $uri; + $this->uri = mb_substr($uri, 0, 191); return $this; } diff --git a/plugins/Poll/Entity/PollResponse.php b/plugins/Poll/Entity/PollResponse.php index 29c1735ab9..3d5395081a 100644 --- a/plugins/Poll/Entity/PollResponse.php +++ b/plugins/Poll/Entity/PollResponse.php @@ -62,7 +62,7 @@ class PollResponse extends Entity public function setUri(?string $uri): self { - $this->uri = $uri; + $this->uri = mb_substr($uri, 0, 191); return $this; } @@ -143,7 +143,7 @@ class PollResponse extends Entity 'id' => ['type' => 'serial', 'not null' => true], //'uri' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'UUID to the response notice'), 'uri' => ['type' => 'varchar', 'length' => 191, 'description' => 'UUID to the response notice'], - 'poll_id' => ['type' => 'int', 'length' => 36, 'not null' => true, 'description' => 'UUID of poll being responded to'], + 'poll_id' => ['type' => 'int', 'not null' => true, 'description' => 'UUID of poll being responded to'], 'actor_id' => ['type' => 'int'], 'selection' => ['type' => 'int'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], diff --git a/plugins/ProfileColor/Entity/ProfileColor.php b/plugins/ProfileColor/Entity/ProfileColor.php index dd6edeefa8..8d4bae66f3 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 $color; private ?string $background; + private ?string $color; private DateTimeInterface $created; private DateTimeInterface $modified; @@ -57,18 +57,7 @@ class ProfileColor extends Entity return $this->actor_id; } - public function setColor(string $color): self - { - $this->color = $color; - return $this; - } - - public function getColor(): ?string - { - return $this->color; - } - - public function setBackground(string $background): self + public function setBackground(?string $background): self { $this->background = $background; return $this; @@ -79,6 +68,17 @@ class ProfileColor extends Entity return $this->background; } + public function setColor(?string $color): self + { + $this->color = $color; + return $this; + } + + public function getColor(): ?string + { + return $this->color; + } + public function setCreated(DateTimeInterface $created): self { $this->created = $created; diff --git a/src/Entity/Activity.php b/src/Entity/Activity.php index 7cb6da654a..8b6db97630 100644 --- a/src/Entity/Activity.php +++ b/src/Entity/Activity.php @@ -50,7 +50,7 @@ class Activity extends Entity private string $object_type; private int $object_id; private ?string $source; - private DateTimeInterface $created; + private \DateTimeInterface $created; public function setId(int $id): self { @@ -76,7 +76,7 @@ class Activity extends Entity public function setVerb(string $verb): self { - $this->verb = $verb; + $this->verb = \mb_substr($verb, 0, 32); return $this; } @@ -87,7 +87,7 @@ class Activity extends Entity public function setObjectType(string $object_type): self { - $this->object_type = $object_type; + $this->object_type = \mb_substr($object_type, 0, 32); return $this; } @@ -109,7 +109,7 @@ class Activity extends Entity public function setSource(?string $source): self { - $this->source = $source; + $this->source = \mb_substr($source, 0, 32); return $this; } @@ -118,13 +118,13 @@ class Activity extends Entity return $this->source; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } diff --git a/src/Entity/Actor.php b/src/Entity/Actor.php index cfbf91257b..5c1f689400 100644 --- a/src/Entity/Actor.php +++ b/src/Entity/Actor.php @@ -60,19 +60,19 @@ class Actor extends Entity // @codeCoverageIgnoreStart private int $id; private string $nickname; - private ?string $fullname = null; - private int $roles = 4; + private ?string $fullname; + private int $roles; private int $type; - private ?string $homepage = null; - private ?string $bio = null; - private ?string $location = null; + private ?string $homepage; + private ?string $bio; + private ?string $location; private ?float $lat; private ?float $lon; private ?int $location_id; private ?int $location_service; private bool $is_local; - private DateTimeInterface $created; - private DateTimeInterface $modified; + private \DateTimeInterface $created; + private \DateTimeInterface $modified; public function setId(int $id): self { @@ -87,7 +87,7 @@ class Actor extends Entity public function setNickname(string $nickname): self { - $this->nickname = $nickname; + $this->nickname = \mb_substr($nickname, 0, 64); return $this; } @@ -104,9 +104,6 @@ class Actor extends Entity public function getFullname(): ?string { - if (\is_null($this->fullname)) { - return null; - } return $this->fullname; } @@ -220,24 +217,24 @@ class Actor extends Entity return $this->is_local; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/ActorBlock.php b/src/Entity/ActorBlock.php index 49e77647e9..47df7dea1e 100644 --- a/src/Entity/ActorBlock.php +++ b/src/Entity/ActorBlock.php @@ -66,13 +66,13 @@ class ActorBlock extends Entity return $this->blocked; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/ActorCircle.php b/src/Entity/ActorCircle.php index 10fd8d46d4..7ceecfd24c 100644 --- a/src/Entity/ActorCircle.php +++ b/src/Entity/ActorCircle.php @@ -52,8 +52,8 @@ class ActorCircle extends Entity private string $tag; private ?string $description; private ?bool $private; - private DateTimeInterface $created; - private DateTimeInterface $modified; + private \DateTimeInterface $created; + private \DateTimeInterface $modified; public function setId(int $id): self { @@ -79,7 +79,7 @@ class ActorCircle extends Entity public function setTag(string $tag): self { - $this->tag = $tag; + $this->tag = \mb_substr($tag, 0, 64); return $this; } @@ -110,24 +110,24 @@ class ActorCircle extends Entity return $this->private; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/ActorCircleSubscription.php b/src/Entity/ActorCircleSubscription.php index c8ec83cbfb..539e9cc419 100644 --- a/src/Entity/ActorCircleSubscription.php +++ b/src/Entity/ActorCircleSubscription.php @@ -45,8 +45,8 @@ class ActorCircleSubscription extends Entity // @codeCoverageIgnoreStart private int $actor_id; private int $circle_id; - private DateTimeInterface $created; - private DateTimeInterface $modified; + private \DateTimeInterface $created; + private \DateTimeInterface $modified; public function setActorId(int $actor_id): self { @@ -59,35 +59,35 @@ class ActorCircleSubscription extends Entity return $this->actor_id; } - public function setCircleid(int $circle_id): self + public function setCircleId(int $circle_id): self { $this->circle_id = $circle_id; return $this; } - public function getCircleid(): int + public function getCircleId(): int { return $this->circle_id; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/ActorTag.php b/src/Entity/ActorTag.php index 054511095f..66e84da6c4 100644 --- a/src/Entity/ActorTag.php +++ b/src/Entity/ActorTag.php @@ -56,7 +56,7 @@ class ActorTag extends Entity private string $tag; private string $canonical; private bool $use_canonical; - private DateTimeInterface $modified; + private \DateTimeInterface $modified; public function setTagger(int $tagger): self { @@ -82,7 +82,7 @@ class ActorTag extends Entity public function setTag(string $tag): self { - $this->tag = $tag; + $this->tag = \mb_substr($tag, 0, 64); return $this; } @@ -93,7 +93,7 @@ class ActorTag extends Entity public function setCanonical(string $canonical): self { - $this->canonical = $canonical; + $this->canonical = \mb_substr($canonical, 0, 64); return $this; } @@ -113,13 +113,13 @@ class ActorTag extends Entity return $this->use_canonical; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/ActorTagBlock.php b/src/Entity/ActorTagBlock.php index 55507cbdc3..70ddd5f53b 100644 --- a/src/Entity/ActorTagBlock.php +++ b/src/Entity/ActorTagBlock.php @@ -46,7 +46,7 @@ class ActorTagBlock extends Entity private string $tag; private string $canonical; private bool $use_canonical; - private DateTimeInterface $modified; + private \DateTimeInterface $modified; public function setBlocker(int $blocker): self { @@ -61,7 +61,7 @@ class ActorTagBlock extends Entity public function setTag(string $tag): self { - $this->tag = $tag; + $this->tag = \mb_substr($tag, 0, 64); return $this; } @@ -72,7 +72,7 @@ class ActorTagBlock extends Entity public function setCanonical(string $canonical): self { - $this->canonical = $canonical; + $this->canonical = \mb_substr($canonical, 0, 64); return $this; } @@ -92,13 +92,13 @@ class ActorTagBlock extends Entity return $this->use_canonical; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/ConfirmAddress.php b/src/Entity/ConfirmAddress.php index 854554eb1e..3e3c37f808 100644 --- a/src/Entity/ConfirmAddress.php +++ b/src/Entity/ConfirmAddress.php @@ -51,7 +51,7 @@ class ConfirmAddress extends Entity public function setCode(string $code): self { - $this->code = $code; + $this->code = \mb_substr($code, 0, 32); return $this; } @@ -73,7 +73,7 @@ class ConfirmAddress extends Entity public function setAddress(string $address): self { - $this->address = $address; + $this->address = \mb_substr($address, 0, 191); return $this; } @@ -84,7 +84,7 @@ class ConfirmAddress extends Entity public function setAddressExtra(?string $address_extra): self { - $this->address_extra = $address_extra; + $this->address_extra = \mb_substr($address_extra, 0, 191); return $this; } @@ -95,7 +95,7 @@ class ConfirmAddress extends Entity public function setAddressType(string $address_type): self { - $this->address_type = $address_type; + $this->address_type = \mb_substr($address_type, 0, 8); return $this; } @@ -104,35 +104,35 @@ class ConfirmAddress extends Entity return $this->address_type; } - public function setClaimed(?DateTimeInterface $claimed): self + public function setClaimed(?\DateTimeInterface $claimed): self { $this->claimed = $claimed; return $this; } - public function getClaimed(): ?DateTimeInterface + public function getClaimed(): ?\DateTimeInterface { return $this->claimed; } - public function setSent(DateTimeInterface $sent): self + public function setSent(\DateTimeInterface $sent): self { $this->sent = $sent; return $this; } - public function getSent(): DateTimeInterface + public function getSent(): \DateTimeInterface { return $this->sent; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/Feed.php b/src/Entity/Feed.php index 344f109fad..87491b6539 100644 --- a/src/Entity/Feed.php +++ b/src/Entity/Feed.php @@ -48,8 +48,8 @@ class Feed extends Entity private string $title; private string $route; private int $ordering; - private DateTimeInterface $created; - private DateTimeInterface $modified; + private \DateTimeInterface $created; + private \DateTimeInterface $modified; public function setActorId(int $actor_id): self { @@ -106,24 +106,24 @@ class Feed extends Entity return $this->ordering; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/GroupAlias.php b/src/Entity/GroupAlias.php index 349de80538..39b0dedaba 100644 --- a/src/Entity/GroupAlias.php +++ b/src/Entity/GroupAlias.php @@ -46,7 +46,7 @@ class GroupAlias extends Entity public function setAlias(string $alias): self { - $this->alias = $alias; + $this->alias = \mb_substr($alias, 0, 64); return $this; } @@ -66,13 +66,13 @@ class GroupAlias extends Entity return $this->group_id; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/GroupBlock.php b/src/Entity/GroupBlock.php index a054420360..ab8d53ec3c 100644 --- a/src/Entity/GroupBlock.php +++ b/src/Entity/GroupBlock.php @@ -78,13 +78,13 @@ class GroupBlock extends Entity return $this->blocker_user; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/GroupInbox.php b/src/Entity/GroupInbox.php index ef87eeb2d7..69f32d82f0 100644 --- a/src/Entity/GroupInbox.php +++ b/src/Entity/GroupInbox.php @@ -66,13 +66,13 @@ class GroupInbox extends Entity return $this->activity_id; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } diff --git a/src/Entity/GroupMember.php b/src/Entity/GroupMember.php index f96bb8090f..00a00b3afc 100644 --- a/src/Entity/GroupMember.php +++ b/src/Entity/GroupMember.php @@ -46,8 +46,8 @@ class GroupMember extends Entity private int $actor_id; private ?bool $is_admin; private ?string $uri; - private DateTimeInterface $created; - private DateTimeInterface $modified; + private \DateTimeInterface $created; + private \DateTimeInterface $modified; public function setGroupId(int $group_id): self { @@ -84,7 +84,7 @@ class GroupMember extends Entity public function setUri(?string $uri): self { - $this->uri = $uri; + $this->uri = \mb_substr($uri, 0, 191); return $this; } @@ -93,24 +93,24 @@ class GroupMember extends Entity return $this->uri; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/Invitation.php b/src/Entity/Invitation.php index c0437bfed2..08e7b36f7f 100644 --- a/src/Entity/Invitation.php +++ b/src/Entity/Invitation.php @@ -49,7 +49,7 @@ class Invitation extends Entity public function setCode(string $code): self { - $this->code = $code; + $this->code = \mb_substr($code, 0, 32); return $this; } @@ -71,7 +71,7 @@ class Invitation extends Entity public function setAddress(string $address): self { - $this->address = $address; + $this->address = \mb_substr($address, 0, 191); return $this; } @@ -82,7 +82,7 @@ class Invitation extends Entity public function setAddressType(string $address_type): self { - $this->address_type = $address_type; + $this->address_type = \mb_substr($address_type, 0, 8); return $this; } @@ -102,13 +102,13 @@ class Invitation extends Entity return $this->registered_user_id; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } diff --git a/src/Entity/LocalGroup.php b/src/Entity/LocalGroup.php index 4ff8d4a545..ae58f9297a 100644 --- a/src/Entity/LocalGroup.php +++ b/src/Entity/LocalGroup.php @@ -60,7 +60,7 @@ class LocalGroup extends Entity public function setNickname(?string $nickname): self { - $this->nickname = $nickname; + $this->nickname = \mb_substr($nickname, 0, 64); return $this; } @@ -69,24 +69,24 @@ class LocalGroup extends Entity return $this->nickname; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/LocalUser.php b/src/Entity/LocalUser.php index 7a56e18ba0..5970035be6 100644 --- a/src/Entity/LocalUser.php +++ b/src/Entity/LocalUser.php @@ -71,8 +71,8 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs private ?bool $auto_subscribe_back; private ?int $subscription_policy; private ?bool $is_stream_private; - private DateTimeInterface $created; - private DateTimeInterface $modified; + private \DateTimeInterface $created; + private \DateTimeInterface $modified; public function setId(int $id): self { @@ -87,7 +87,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs public function setNickname(string $nickname): self { - $this->nickname = $nickname; + $this->nickname = \mb_substr($nickname, 0, 64); return $this; } @@ -98,7 +98,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs public function setPassword(?string $password): self { - $this->password = $password; + $this->password = \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 = $outgoing_email; + $this->outgoing_email = \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 = $incoming_email; + $this->incoming_email = \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 = $timezone; + $this->timezone = \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 = $sms_email; + $this->sms_email = \mb_substr($sms_email, 0, 191); return $this; } @@ -217,24 +217,24 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs return $this->is_stream_private; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/LocationService.php b/src/Entity/LocationService.php index 680daa534e..d67d9f2ab0 100644 --- a/src/Entity/LocationService.php +++ b/src/Entity/LocationService.php @@ -58,7 +58,7 @@ class LocationService extends Entity public function setDescription(?string $description): self { - $this->description = $description; + $this->description = \mb_substr($description, 0, 191); return $this; } @@ -67,24 +67,24 @@ class LocationService extends Entity return $this->description; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/Note.php b/src/Entity/Note.php index 3dc2bdfe68..e3befb41f4 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -51,18 +51,18 @@ class Note extends Entity // @codeCoverageIgnoreStart private int $id; private int $actor_id; - private ?string $content = null; + private ?string $content; private string $content_type = 'text/plain'; private ?string $rendered; private int $conversation_id; - private ?int $reply_to = null; + private ?int $reply_to; private bool $is_local; private ?string $source; - private int $scope = VisibilityScope::PUBLIC; + private int $scope = 1; private ?string $url; - private ?int $language_id = null; - private DateTimeInterface $created; - private DateTimeInterface $modified; + private ?int $language_id; + private \DateTimeInterface $created; + private \DateTimeInterface $modified; public function setId(int $id): self { @@ -99,7 +99,7 @@ class Note extends Entity public function setContentType(string $content_type): self { - $this->content_type = $content_type; + $this->content_type = \mb_substr($content_type, 0, 129); return $this; } @@ -154,7 +154,7 @@ class Note extends Entity public function setSource(?string $source): self { - $this->source = $source; + $this->source = \mb_substr($source, 0, 32); return $this; } @@ -196,24 +196,24 @@ class Note extends Entity return $this->language_id; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/NoteLocation.php b/src/Entity/NoteLocation.php index c3575a8610..08b2b8551d 100644 --- a/src/Entity/NoteLocation.php +++ b/src/Entity/NoteLocation.php @@ -102,13 +102,13 @@ class NoteLocation extends Entity return $this->location_service; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/NoteSource.php b/src/Entity/NoteSource.php index d35dd44e6f..eb6fc8b870 100644 --- a/src/Entity/NoteSource.php +++ b/src/Entity/NoteSource.php @@ -47,7 +47,7 @@ class NoteSource extends Entity public function setCode(string $code): self { - $this->code = $code; + $this->code = \mb_substr($code, 0, 32); return $this; } @@ -58,7 +58,7 @@ class NoteSource extends Entity public function setName(string $name): self { - $this->name = $name; + $this->name = \mb_substr($name, 0, 191); return $this; } @@ -69,7 +69,7 @@ class NoteSource extends Entity public function setUrl(string $url): self { - $this->url = $url; + $this->url = \mb_substr($url, 0, 191); return $this; } @@ -78,13 +78,13 @@ class NoteSource extends Entity return $this->url; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/NoteTag.php b/src/Entity/NoteTag.php index 7593cdd821..30387c67c0 100644 --- a/src/Entity/NoteTag.php +++ b/src/Entity/NoteTag.php @@ -50,12 +50,12 @@ class NoteTag extends Entity private string $canonical; private int $note_id; private bool $use_canonical; - private int $language_id; - private DateTimeInterface $created; + private ?int $language_id; + private \DateTimeInterface $created; public function setTag(string $tag): self { - $this->tag = $tag; + $this->tag = \mb_substr($tag, 0, 64); return $this; } @@ -66,7 +66,7 @@ class NoteTag extends Entity public function setCanonical(string $canonical): self { - $this->canonical = $canonical; + $this->canonical = \mb_substr($canonical, 0, 64); return $this; } @@ -97,24 +97,24 @@ class NoteTag extends Entity return $this->use_canonical; } - public function setLanguageId(int $language_id): NoteTag + public function setLanguageId(?int $language_id): self { $this->language_id = $language_id; return $this; } - public function getLanguageId(): int + public function getLanguageId(): ?int { return $this->language_id; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } diff --git a/src/Entity/NoteTagBlock.php b/src/Entity/NoteTagBlock.php index d2d9bc64bc..dc0c195af6 100644 --- a/src/Entity/NoteTagBlock.php +++ b/src/Entity/NoteTagBlock.php @@ -46,7 +46,7 @@ class NoteTagBlock extends Entity private string $tag; private string $canonical; private bool $use_canonical; - private DateTimeInterface $modified; + private \DateTimeInterface $modified; public function setBlocker(int $blocker): self { @@ -61,7 +61,7 @@ class NoteTagBlock extends Entity public function setTag(string $tag): self { - $this->tag = $tag; + $this->tag = \mb_substr($tag, 0, 64); return $this; } @@ -72,7 +72,7 @@ class NoteTagBlock extends Entity public function setCanonical(string $canonical): self { - $this->canonical = $canonical; + $this->canonical = \mb_substr($canonical, 0, 64); return $this; } @@ -92,13 +92,13 @@ class NoteTagBlock extends Entity return $this->use_canonical; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/RelatedGroup.php b/src/Entity/RelatedGroup.php index 8bd32d968a..56ffdfb482 100644 --- a/src/Entity/RelatedGroup.php +++ b/src/Entity/RelatedGroup.php @@ -66,13 +66,13 @@ class RelatedGroup extends Entity return $this->related_group_id; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } diff --git a/src/Entity/RememberMeToken.php b/src/Entity/RememberMeToken.php index 8a64e17c32..bfa296dbc3 100644 --- a/src/Entity/RememberMeToken.php +++ b/src/Entity/RememberMeToken.php @@ -46,7 +46,7 @@ class RememberMeToken extends Entity public function setSeries(string $series): self { - $this->series = $series; + $this->series = \mb_substr($series, 0, 88); return $this; } @@ -57,7 +57,7 @@ class RememberMeToken extends Entity public function setValue(string $value): self { - $this->value = $value; + $this->value = \mb_substr($value, 0, 88); return $this; } @@ -66,20 +66,20 @@ class RememberMeToken extends Entity return $this->value; } - public function setLastused(DateTimeInterface $lastused): self + public function setLastused(\DateTimeInterface $lastused): self { $this->lastused = $lastused; return $this; } - public function getLastused(): DateTimeInterface + public function getLastused(): \DateTimeInterface { return $this->lastused; } public function setClass(string $class): self { - $this->class = $class; + $this->class = \mb_substr($class, 0, 100); return $this; } @@ -90,7 +90,7 @@ class RememberMeToken extends Entity public function setUsername(string $username): self { - $this->username = $username; + $this->username = \mb_substr($username, 0, 64); return $this; } diff --git a/src/Entity/ReservedNickname.php b/src/Entity/ReservedNickname.php index ef619d74b2..c61c05d13b 100644 --- a/src/Entity/ReservedNickname.php +++ b/src/Entity/ReservedNickname.php @@ -45,7 +45,7 @@ class ReservedNickname extends Entity public function setNickname(string $nickname): self { - $this->nickname = $nickname; + $this->nickname = \mb_substr($nickname, 0, 64); return $this; } @@ -54,13 +54,13 @@ class ReservedNickname extends Entity return $this->nickname; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } diff --git a/src/Entity/ResetPasswordRequest.php b/src/Entity/ResetPasswordRequest.php index 5b631e5e8d..4833757bb1 100644 --- a/src/Entity/ResetPasswordRequest.php +++ b/src/Entity/ResetPasswordRequest.php @@ -16,8 +16,8 @@ class ResetPasswordRequest extends Entity implements ResetPasswordRequestInterfa private int $user_id; private ?string $selector; private ?string $token; - private DateTimeInterface $expires; - private DateTimeInterface $created; + private \DateTimeInterface $expires; + private \DateTimeInterface $created; public function setId(int $id): self { @@ -43,7 +43,7 @@ class ResetPasswordRequest extends Entity implements ResetPasswordRequestInterfa public function setSelector(?string $selector): self { - $this->selector = $selector; + $this->selector = \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 = $token; + $this->token = \mb_substr($token, 0, 100); return $this; } @@ -63,24 +63,24 @@ class ResetPasswordRequest extends Entity implements ResetPasswordRequestInterfa return $this->token; } - public function setExpires(DateTimeInterface $expires): self + public function setExpires(\DateTimeInterface $expires): self { $this->expires = $expires; return $this; } - public function getExpires(): DateTimeInterface + public function getExpires(): \DateTimeInterface { return $this->expires; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } diff --git a/src/Entity/SmsCarrier.php b/src/Entity/SmsCarrier.php index 39f3903f21..ddf131f769 100644 --- a/src/Entity/SmsCarrier.php +++ b/src/Entity/SmsCarrier.php @@ -59,7 +59,7 @@ class SmsCarrier extends Entity public function setName(?string $name): self { - $this->name = $name; + $this->name = \mb_substr($name, 0, 64); return $this; } @@ -70,7 +70,7 @@ class SmsCarrier extends Entity public function setEmailPattern(string $email_pattern): self { - $this->email_pattern = $email_pattern; + $this->email_pattern = \mb_substr($email_pattern, 0, 191); return $this; } @@ -79,24 +79,24 @@ class SmsCarrier extends Entity return $this->email_pattern; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/Subscription.php b/src/Entity/Subscription.php index 3771fadb1a..e206a0cd99 100644 --- a/src/Entity/Subscription.php +++ b/src/Entity/Subscription.php @@ -67,24 +67,24 @@ class Subscription extends Entity return $this->subscribed; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/SubscriptionQueue.php b/src/Entity/SubscriptionQueue.php index acc7264a23..2376eb18e1 100644 --- a/src/Entity/SubscriptionQueue.php +++ b/src/Entity/SubscriptionQueue.php @@ -66,13 +66,13 @@ class SubscriptionQueue extends Entity return $this->subscribed; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } diff --git a/src/Entity/UserLocationPrefs.php b/src/Entity/UserLocationPrefs.php index 3a28b2b972..a26b00ba8a 100644 --- a/src/Entity/UserLocationPrefs.php +++ b/src/Entity/UserLocationPrefs.php @@ -65,24 +65,24 @@ class UserLocationPrefs extends Entity return $this->share_location; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; } diff --git a/src/Entity/UserUrlShortenerPrefs.php b/src/Entity/UserUrlShortenerPrefs.php index 3a6516d5f7..cee4227eb3 100644 --- a/src/Entity/UserUrlShortenerPrefs.php +++ b/src/Entity/UserUrlShortenerPrefs.php @@ -60,7 +60,7 @@ class UserUrlShortenerPrefs extends Entity public function setUrlShorteningService(?string $url_shortening_service): self { - $this->url_shortening_service = $url_shortening_service; + $this->url_shortening_service = \mb_substr($url_shortening_service, 0, 50); return $this; } @@ -91,24 +91,24 @@ class UserUrlShortenerPrefs extends Entity return $this->max_notice_length; } - public function setCreated(DateTimeInterface $created): self + public function setCreated(\DateTimeInterface $created): self { $this->created = $created; return $this; } - public function getCreated(): DateTimeInterface + public function getCreated(): \DateTimeInterface { return $this->created; } - public function setModified(DateTimeInterface $modified): self + public function setModified(\DateTimeInterface $modified): self { $this->modified = $modified; return $this; } - public function getModified(): DateTimeInterface + public function getModified(): \DateTimeInterface { return $this->modified; }