[AUTOGENERATED] Update auto generated code

This commit is contained in:
Hugo Sales 2021-12-26 15:12:06 +00:00 committed by Diogo Peralta Cordeiro
parent 68076d73dd
commit c79b1e4c94
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
61 changed files with 426 additions and 434 deletions

View File

@ -59,7 +59,7 @@ class Attachment extends Entity
// {{{ Autocode // {{{ Autocode
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $id; private int $id;
private int $lives = 1; private int $lives;
private ?string $filehash; private ?string $filehash;
private ?string $mimetype; private ?string $mimetype;
private ?string $filename; private ?string $filename;
@ -79,19 +79,20 @@ class Attachment extends Entity
return $this->id; return $this->id;
} }
public function setLives(int $lives): self
{
$this->lives = $lives;
return $this;
}
public function getLives(): int public function getLives(): int
{ {
return $this->lives; return $this->lives;
} }
public function setLives(int $lives): void
{
$this->lives = $lives;
}
public function setFilehash(?string $filehash): self public function setFilehash(?string $filehash): self
{ {
$this->filehash = $filehash; $this->filehash = mb_substr($filehash, 0, 64);
return $this; return $this;
} }
@ -102,7 +103,7 @@ class Attachment extends Entity
public function setMimetype(?string $mimetype): self public function setMimetype(?string $mimetype): self
{ {
$this->mimetype = $mimetype; $this->mimetype = mb_substr($mimetype, 0, 255);
return $this; return $this;
} }
@ -113,7 +114,7 @@ class Attachment extends Entity
public function setFilename(?string $filename): self public function setFilename(?string $filename): self
{ {
$this->filename = $filename; $this->filename = mb_substr($filename, 0, 191);
return $this; return $this;
} }
@ -317,7 +318,6 @@ class Attachment extends Entity
Event::handle('AttachmentGetBestTitle', [$this, $note, &$title]); Event::handle('AttachmentGetBestTitle', [$this, $note, &$title]);
return $title; return $title;
} }
}); });
if ($title != null) { if ($title != null) {
return $title; return $title;

View File

@ -66,12 +66,11 @@ class AttachmentThumbnail extends Entity
'medium' => self::SIZE_MEDIUM, 'medium' => self::SIZE_MEDIUM,
'big' => self::SIZE_BIG, 'big' => self::SIZE_BIG,
]; ];
// {{{ Autocode // {{{ Autocode
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $attachment_id; private int $attachment_id;
private ?string $mimetype; private ?string $mimetype;
private int $size = self::SIZE_SMALL; private int $size = 0;
private string $filename; private string $filename;
private int $width; private int $width;
private int $height; private int $height;
@ -90,7 +89,7 @@ class AttachmentThumbnail extends Entity
public function setMimetype(?string $mimetype): self public function setMimetype(?string $mimetype): self
{ {
$this->mimetype = $mimetype; $this->mimetype = mb_substr($mimetype, 0, 129);
return $this; return $this;
} }
@ -99,20 +98,20 @@ class AttachmentThumbnail extends Entity
return $this->mimetype; return $this->mimetype;
} }
public function getSize(): int
{
return $this->size;
}
public function setSize(int $size): self public function setSize(int $size): self
{ {
$this->size = $size; $this->size = $size;
return $this; return $this;
} }
public function getSize(): int
{
return $this->size;
}
public function setFilename(string $filename): self public function setFilename(string $filename): self
{ {
$this->filename = $filename; $this->filename = mb_substr($filename, 0, 191);
return $this; return $this;
} }
@ -121,6 +120,28 @@ class AttachmentThumbnail extends Entity
return $this->filename; 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 public function setModified(DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
@ -132,28 +153,6 @@ class AttachmentThumbnail extends Entity
return $this->modified; 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 // @codeCoverageIgnoreEnd
// }}} Autocode // }}} Autocode

View File

@ -39,21 +39,10 @@ class AttachmentToLink extends Entity
{ {
// {{{ Autocode // {{{ Autocode
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $attachment_id;
private int $link_id; private int $link_id;
private int $attachment_id;
private DateTimeInterface $modified; 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 public function setLinkId(int $link_id): self
{ {
$this->link_id = $link_id; $this->link_id = $link_id;
@ -65,6 +54,17 @@ class AttachmentToLink extends Entity
return $this->link_id; 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 public function setModified(DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;

View File

@ -77,16 +77,17 @@ class Avatar extends Entity
return $this->attachment_id; return $this->attachment_id;
} }
public function setTitle(?string $title): self
{
$this->title = mb_substr($title, 0, 191);
return $this;
}
public function getTitle(): ?string public function getTitle(): ?string
{ {
return $this->title; return $this->title;
} }
public function setTitle(?string $title): void
{
$this->title = $title;
}
public function setCreated(DateTimeInterface $created): self public function setCreated(DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;

View File

@ -88,7 +88,7 @@ class ForeignLink
public function setCredentials(?string $credentials): self public function setCredentials(?string $credentials): self
{ {
$this->credentials = $credentials; $this->credentials = mb_substr($credentials, 0, 191);
return $this; return $this;
} }

View File

@ -60,7 +60,7 @@ class ForeignService
public function setName(string $name): self public function setName(string $name): self
{ {
$this->name = $name; $this->name = mb_substr($name, 0, 32);
return $this; return $this;
} }
@ -71,7 +71,7 @@ class ForeignService
public function setDescription(?string $description): self public function setDescription(?string $description): self
{ {
$this->description = $description; $this->description = mb_substr($description, 0, 191);
return $this; return $this;
} }

View File

@ -72,7 +72,7 @@ class ForeignUser
public function setUri(string $uri): self public function setUri(string $uri): self
{ {
$this->uri = $uri; $this->uri = mb_substr($uri, 0, 191);
return $this; return $this;
} }
@ -83,7 +83,7 @@ class ForeignUser
public function setNickname(?string $nickname): self public function setNickname(?string $nickname): self
{ {
$this->nickname = $nickname; $this->nickname = mb_substr($nickname, 0, 191);
return $this; return $this;
} }

View File

@ -46,7 +46,6 @@ class Conversation extends Entity
// {{{ Autocode // {{{ Autocode
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $id; private int $id;
private string $uri;
private int $initial_note_id; private int $initial_note_id;
public function setId(int $id): self public function setId(int $id): self

View File

@ -38,7 +38,6 @@ use App\Core\Log;
use App\Core\VisibilityScope; use App\Core\VisibilityScope;
use App\Entity\Actor; use App\Entity\Actor;
use App\Util\Common; use App\Util\Common;
use function array_key_exists;
abstract class FeedController extends Controller abstract class FeedController extends Controller
{ {
@ -51,7 +50,7 @@ abstract class FeedController extends Controller
{ {
$actor = Common::actor(); $actor = Common::actor();
if (array_key_exists('notes', $result)) { if (\array_key_exists('notes', $result)) {
$notes = $result['notes']; $notes = $result['notes'];
self::enforceScope($notes, $actor); self::enforceScope($notes, $actor);
Event::handle('FilterNoteList', [$actor, &$notes, $result['request']]); 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 private static function enforceScope(array &$notes, ?Actor $actor): void
{ {
$filtered_notes = []; $filtered_notes = [];
foreach($notes as $note) { foreach ($notes as $note) {
switch($note->getScope()) { switch ($note->getScope()) {
case VisibilityScope::LOCAL: // The controller handles it if private case VisibilityScope::LOCAL: // The controller handles it if private
case VisibilityScope::PUBLIC: case VisibilityScope::PUBLIC:
$filtered_notes[] = $note; $filtered_notes[] = $note;
break; break;
case VisibilityScope::ADDRESSEE: case VisibilityScope::ADDRESSEE:
// If the actor is logged in and // If the actor is logged in and
if (!is_null($actor) && if (!\is_null($actor)
( && (
// Is either the author Or // Is either the author Or
$note->getActorId() == $actor->getId() || $note->getActorId() == $actor->getId()
// one of the targets // one of the targets
in_array($actor->getId(), $note->getNotificationTargetIds()) || \in_array($actor->getId(), $note->getNotificationTargetIds())
)) { )) {
$filtered_notes[] = $note; $filtered_notes[] = $note;
} }
@ -85,7 +84,7 @@ abstract class FeedController extends Controller
case VisibilityScope::GROUP: case VisibilityScope::GROUP:
// Only for the group to see // Only for the group to see
break; break;
case VisibilityScope::COLLECTION: // no break case VisibilityScope::COLLECTION:
case VisibilityScope::MESSAGE: case VisibilityScope::MESSAGE:
// Only for the collection to see (they will only find it in their notifications) // Only for the collection to see (they will only find it in their notifications)
break; break;

View File

@ -47,27 +47,27 @@ use DateTimeInterface;
class FreeNetworkActorProtocol extends Entity class FreeNetworkActorProtocol extends Entity
{ {
// {{{ Autocode // {{{ Autocode
// @codeCoverageIgnoreStart; // @codeCoverageIgnoreStart
private int $actor_id; private int $actor_id;
private ?string $protocol; private ?string $protocol;
private ?string $addr; private string $addr;
private DateTimeInterface $created; private DateTimeInterface $created;
private DateTimeInterface $modified; private DateTimeInterface $modified;
public function getActorId(): int
{
return $this->actor_id;
}
public function setActorId(int $actor_id): self public function setActorId(int $actor_id): self
{ {
$this->actor_id = $actor_id; $this->actor_id = $actor_id;
return $this; return $this;
} }
public function getActorId(): int
{
return $this->actor_id;
}
public function setProtocol(?string $protocol): self public function setProtocol(?string $protocol): self
{ {
$this->protocol = $protocol; $this->protocol = mb_substr($protocol, 0, 32);
return $this; return $this;
} }
@ -87,14 +87,20 @@ class FreeNetworkActorProtocol extends Entity
return $this->addr; return $this->addr;
} }
public function setCreated(DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function getCreated(): DateTimeInterface public function getCreated(): DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setCreated(DateTimeInterface $created): self public function setModified(DateTimeInterface $modified): self
{ {
$this->created = $created; $this->modified = $modified;
return $this; return $this;
} }
@ -103,11 +109,6 @@ class FreeNetworkActorProtocol extends Entity
return $this->modified; return $this->modified;
} }
public function setModified(DateTimeInterface $modified): self
{
$this->modified = $modified;
return $this;
}
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
// }}} Autocode // }}} Autocode

View File

@ -71,16 +71,17 @@ class ActorLanguage extends Entity
return $this->language_id; return $this->language_id;
} }
public function getOrdering(): int
{
return $this->ordering;
}
public function setOrdering(int $ordering): self public function setOrdering(int $ordering): self
{ {
$this->ordering = $ordering; $this->ordering = $ordering;
return $this; return $this;
} }
public function getOrdering(): int
{
return $this->ordering;
}
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
// }}} Autocode // }}} Autocode

View File

@ -48,9 +48,9 @@ class Language extends Entity
// {{{ Autocode // {{{ Autocode
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $id; private int $id;
private string $locale; private ?string $locale;
private string $long_display; private ?string $long_display;
private string $short_display; private ?string $short_display;
private DateTimeInterface $created; private DateTimeInterface $created;
public function setId(int $id): self public function setId(int $id): self
@ -64,35 +64,35 @@ class Language extends Entity
return $this->id; 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; return $this;
} }
public function getLocale(): string public function getLocale(): ?string
{ {
return $this->locale; 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; return $this;
} }
public function getLongDisplay(): string public function getLongDisplay(): ?string
{ {
return $this->long_display; 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; return $this;
} }
public function getShortDisplay(): string public function getShortDisplay(): ?string
{ {
return $this->short_display; return $this->short_display;
} }
@ -107,6 +107,7 @@ class Language extends Entity
{ {
return $this->created; return $this->created;
} }
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
// }}} Autocode // }}} Autocode

View File

@ -51,7 +51,7 @@ class Language extends Component
} }
$notes = F\select( $notes = F\select(
$notes, $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; return Event::next;

View File

@ -65,20 +65,20 @@ class Link extends Entity
return $this->id; return $this->id;
} }
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(?string $url): self public function setUrl(?string $url): self
{ {
$this->url = $url; $this->url = $url;
return $this; return $this;
} }
public function getUrl(): ?string
{
return $this->url;
}
public function setUrlHash(?string $url_hash): self public function setUrlHash(?string $url_hash): self
{ {
$this->url_hash = $url_hash; $this->url_hash = mb_substr($url_hash, 0, 64);
return $this; return $this;
} }
@ -89,7 +89,7 @@ class Link extends Entity
public function setMimetype(?string $mimetype): self public function setMimetype(?string $mimetype): self
{ {
$this->mimetype = $mimetype; $this->mimetype = mb_substr($mimetype, 0, 50);
return $this; return $this;
} }
@ -98,18 +98,6 @@ class Link extends Entity
return $this->mimetype; 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 public function setModified(DateTimeInterface $modified): self
{ {
$this->modified = $modified; $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 public static function schemaDef(): array
{ {
return [ return [

View File

@ -76,6 +76,7 @@ class NoteToLink extends Entity
{ {
return $this->modified; return $this->modified;
} }
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
// }}} Autocode // }}} Autocode

View File

@ -75,7 +75,7 @@ class Notification extends Entity
public function setReason(?string $reason): self public function setReason(?string $reason): self
{ {
$this->reason = $reason; $this->reason = mb_substr($reason, 0, 191);
return $this; return $this;
} }

View File

@ -66,7 +66,7 @@ class UserNotificationPrefs extends Entity
public function setTransport(string $transport): self public function setTransport(string $transport): self
{ {
$this->transport = $transport; $this->transport = mb_substr($transport, 0, 191);
return $this; return $this;
} }

View File

@ -24,21 +24,20 @@ declare(strict_types = 1);
namespace Component\Posting; namespace Component\Posting;
use App\Core\DB\DB; use App\Core\DB\DB;
use App\Core\Entity;
use App\Core\Event; use App\Core\Event;
use App\Core\Form; use App\Core\Form;
use App\Core\GSFile; use App\Core\GSFile;
use App\Core\VisibilityScope;
use App\Util\Exception\BugFoundException;
use function App\Core\I18n\_m; use function App\Core\I18n\_m;
use App\Core\Modules\Component; use App\Core\Modules\Component;
use App\Core\Router\Router; use App\Core\Router\Router;
use App\Core\Security; use App\Core\Security;
use App\Core\VisibilityScope;
use App\Entity\Activity; use App\Entity\Activity;
use App\Entity\Actor; use App\Entity\Actor;
use App\Entity\GroupInbox; use App\Entity\GroupInbox;
use App\Entity\Note; use App\Entity\Note;
use App\Util\Common; use App\Util\Common;
use App\Util\Exception\BugFoundException;
use App\Util\Exception\ClientException; use App\Util\Exception\ClientException;
use App\Util\Exception\DuplicateFoundException; use App\Util\Exception\DuplicateFoundException;
use App\Util\Exception\RedirectException; 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\File\UploadedFile;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\Length;
use function count;
use function is_null;
class Posting extends Component class Posting extends Component
{ {
@ -73,7 +70,7 @@ class Posting extends Component
*/ */
public function onAppendRightPostingBlock(Request $request, array &$res): bool public function onAppendRightPostingBlock(Request $request, array &$res): bool
{ {
if (is_null($user = Common::user())) { if (\is_null($user = Common::user())) {
return Event::next; return Event::next;
} }
@ -105,15 +102,15 @@ class Posting extends Component
// TODO: if in group page, add GROUP visibility to the choices. // 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' => [ $form_params[] = ['visibility', ChoiceType::class, ['label' => _m('Visibility:'), 'multiple' => false, 'expanded' => false, 'data' => 'public', 'choices' => [
_m('Public') => VisibilityScope::PUBLIC, _m('Public') => VisibilityScope::PUBLIC,
_m('Local') => VisibilityScope::LOCAL, _m('Local') => VisibilityScope::LOCAL,
_m('Addressee') => VisibilityScope::ADDRESSEE _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[] = ['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[] = ['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')); $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, $form_params[] = ['content_type', ChoiceType::class,
[ [
'label' => _m('Text format:'), 'multiple' => false, 'expanded' => false, '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 * $actor_id, possibly as a reply to note $reply_to and with flag
* $is_local. Sanitizes $content and $attachments * $is_local. Sanitizes $content and $attachments
* *
* @param Actor $actor * @param array $attachments Array of UploadedFile to be stored as GSFiles associated to this note
* @param string|null $content * @param array $processed_attachments Array of [Attachment, Attachment's name] to be associated to this $actor and Note
* @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 $process_note_content_extra_args Extra arguments for the event ProcessNoteContent * @param array $process_note_content_extra_args Extra arguments for the event ProcessNoteContent
* *
* @return Note * @throws BugFoundException
* @throws ClientException * @throws ClientException
* @throws DuplicateFoundException * @throws DuplicateFoundException
* @throws ServerException * @throws ServerException
* @throws BugFoundException
*/ */
public static function storeLocalNote( public static function storeLocalNote(
Actor $actor, Actor $actor,
?string $content, ?string $content,
string $content_type, string $content_type,
?string $language = null, ?string $language = null,
?int $scope = null, ?int $scope = null,
?string $target = null, ?string $target = null,
array $attachments = [], array $attachments = [],
array $processed_attachments = [], array $processed_attachments = [],
array $process_note_content_extra_args = [], array $process_note_content_extra_args = [],
): Note { ): Note {
$scope ??= VisibilityScope::PUBLIC; // TODO: If site is private, default to LOCAL $scope ??= VisibilityScope::PUBLIC; // TODO: If site is private, default to LOCAL
$rendered = null; $rendered = null;
@ -213,9 +203,9 @@ class Posting extends Component
'content' => $content, 'content' => $content,
'content_type' => $content_type, 'content_type' => $content_type,
'rendered' => $rendered, '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, 'is_local' => true,
'scope' => $scope, 'scope' => $scope,
]); ]);
/** @var UploadedFile[] $attachments */ /** @var UploadedFile[] $attachments */
@ -261,7 +251,7 @@ class Posting extends Component
]); ]);
DB::persist($activity); DB::persist($activity);
if (!is_null($target)) { if (!\is_null($target)) {
switch ($target[0]) { switch ($target[0]) {
case '!': case '!':
$mentions[] = [ $mentions[] = [
@ -277,7 +267,7 @@ class Posting extends Component
$mentioned = []; $mentioned = [];
foreach (F\unique(F\flat_map($mentions, fn (array $m) => $m['mentioned'] ?? []), fn (Actor $a) => $a->getId()) as $m) { 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(); $mentioned[] = $m->getId();
if ($m->isGroup()) { if ($m->isGroup()) {

View File

@ -63,17 +63,17 @@ class ActivitypubActivity extends Entity
return $this->activity_id; return $this->activity_id;
} }
public function getActivityUri(): string
{
return $this->activity_uri;
}
public function setActivityUri(string $activity_uri): self public function setActivityUri(string $activity_uri): self
{ {
$this->activity_uri = $activity_uri; $this->activity_uri = $activity_uri;
return $this; return $this;
} }
public function getActivityUri(): string
{
return $this->activity_uri;
}
public function setCreated(DateTimeInterface $created): self public function setCreated(DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;

View File

@ -57,36 +57,20 @@ class ActivitypubActor extends Entity
private string $uri; private string $uri;
private int $actor_id; private int $actor_id;
private string $inbox_uri; private string $inbox_uri;
private ?string $inbox_shared_uri = null; private ?string $inbox_shared_uri;
private string $url; private ?string $url;
private DateTimeInterface $created; private DateTimeInterface $created;
private DateTimeInterface $modified; private DateTimeInterface $modified;
public function getUri(): string
{
return $this->uri;
}
public function setUri(string $uri): self public function setUri(string $uri): self
{ {
$this->uri = $uri; $this->uri = $uri;
return $this; return $this;
} }
public function getUrl(): string public function getUri(): string
{ {
return $this->url; return $this->uri;
}
public function setUrl(string $url): self
{
$this->url = $url;
return $this;
}
public function getActorId(): int
{
return $this->actor_id;
} }
public function setActorId(int $actor_id): self public function setActorId(int $actor_id): self
@ -95,9 +79,9 @@ class ActivitypubActor extends Entity
return $this; 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 public function setInboxUri(string $inbox_uri): self
@ -106,20 +90,31 @@ class ActivitypubActor extends Entity
return $this; 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; $this->inbox_shared_uri = $inbox_shared_uri;
return $this; 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 public function setCreated(DateTimeInterface $created): self
@ -128,9 +123,9 @@ class ActivitypubActor extends Entity
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getCreated(): DateTimeInterface
{ {
return $this->modified; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(DateTimeInterface $modified): self
@ -138,6 +133,12 @@ class ActivitypubActor extends Entity
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface
{
return $this->modified;
}
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
// }}} Autocode // }}} Autocode

View File

@ -47,30 +47,25 @@ class ActivitypubObject extends Entity
// {{{ Autocode // {{{ Autocode
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private string $object_uri; private string $object_uri;
private int $object_id;
private string $object_type; private string $object_type;
private int $object_id;
private DateTimeInterface $created; private DateTimeInterface $created;
private DateTimeInterface $modified; private DateTimeInterface $modified;
public function getObjectUri(): string
{
return $this->object_uri;
}
public function setObjectUri(string $object_uri): self public function setObjectUri(string $object_uri): self
{ {
$this->object_uri = $object_uri; $this->object_uri = $object_uri;
return $this; 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; return $this;
} }
@ -79,12 +74,17 @@ class ActivitypubObject extends Entity
return $this->object_type; 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; return $this;
} }
public function getObjectId(): int
{
return $this->object_id;
}
public function setCreated(DateTimeInterface $created): self public function setCreated(DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;

View File

@ -50,36 +50,31 @@ class ActivitypubRsa extends Entity
// {{{ Autocode // {{{ Autocode
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $actor_id; private int $actor_id;
private ?string $private_key = null; private ?string $private_key;
private string $public_key; private string $public_key;
private DateTimeInterface $created; private DateTimeInterface $created;
private DateTimeInterface $modified; private DateTimeInterface $modified;
public function getActorId(): int
{
return $this->actor_id;
}
public function setActorId(int $actor_id): self public function setActorId(int $actor_id): self
{ {
$this->actor_id = $actor_id; $this->actor_id = $actor_id;
return $this; 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; $this->private_key = $private_key;
return $this; 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 public function setPublicKey(string $public_key): self
@ -88,9 +83,9 @@ class ActivitypubRsa extends Entity
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getPublicKey(): string
{ {
return $this->created; return $this->public_key;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(DateTimeInterface $created): self
@ -99,9 +94,9 @@ class ActivitypubRsa extends Entity
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getCreated(): DateTimeInterface
{ {
return $this->modified; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(DateTimeInterface $modified): self
@ -109,6 +104,12 @@ class ActivitypubRsa extends Entity
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface
{
return $this->modified;
}
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
// }}} Autocode // }}} Autocode

View File

@ -167,7 +167,7 @@ class Activity extends Model
]; ];
$attr['object'] = ($attr['type'] === 'Create') ? self::jsonToType(Model::toJson($object->getObject())) : ActivityPub::getUriByObject($object->getObject()); $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['to'] = array_unique(array_merge($attr['to'], $attr['object']->get('to')));
$attr['cc'] = array_unique(array_merge($attr['cc'], $attr['object']->get('cc'))); $attr['cc'] = array_unique(array_merge($attr['cc'], $attr['object']->get('cc')));
} }

View File

@ -28,7 +28,7 @@ class Collection extends Entity
public function setName(?string $name): self public function setName(?string $name): self
{ {
$this->name = $name; $this->name = mb_substr($name, 0, 255);
return $this; return $this;
} }

View File

@ -52,10 +52,10 @@ class AttachmentEmbed extends Entity
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $link_id; private int $link_id;
private int $attachment_id; private int $attachment_id;
private ?string $title;
private ?string $description;
private ?string $provider_name; private ?string $provider_name;
private ?string $provider_url; private ?string $provider_url;
private ?string $title;
private ?string $description;
private ?string $author_name; private ?string $author_name;
private ?string $author_url; private ?string $author_url;
private ?string $thumbnail_url; private ?string $thumbnail_url;
@ -72,16 +72,17 @@ class AttachmentEmbed extends Entity
return $this->link_id; return $this->link_id;
} }
public function setAttachmentId(int $attachment_id): self
{
$this->attachment_id = $attachment_id;
return $this;
}
public function getAttachmentId(): int public function getAttachmentId(): int
{ {
return $this->attachment_id; return $this->attachment_id;
} }
public function setAttachmentId(int $attachment_id): void
{
$this->attachment_id = $attachment_id;
}
public function setProviderName(?string $provider_name): self public function setProviderName(?string $provider_name): self
{ {
$this->provider_name = $provider_name; $this->provider_name = $provider_name;
@ -104,17 +105,6 @@ class AttachmentEmbed extends Entity
return $this->provider_url; 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 public function setTitle(?string $title): self
{ {
$this->title = $title; $this->title = $title;
@ -126,6 +116,17 @@ class AttachmentEmbed extends Entity
return $this->title; 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 public function setAuthorName(?string $author_name): self
{ {
$this->author_name = $author_name; $this->author_name = $author_name;

View File

@ -23,7 +23,6 @@ namespace Plugin\Favourite\Entity;
use App\Core\Entity; use App\Core\Entity;
use App\Entity\Note; use App\Entity\Note;
use App\Util\Formatting;
use DateTimeInterface; use DateTimeInterface;
class Favourite extends Entity class Favourite extends Entity

View File

@ -197,6 +197,9 @@ class Oomox extends Entity
return $this->modified; return $this->modified;
} }
// @codeCoverageIgnoreEnd
// }}} Autocode
public function resetTheme(bool $is_light) public function resetTheme(bool $is_light)
{ {
if ($is_light) { if ($is_light) {
@ -214,8 +217,6 @@ class Oomox extends Entity
} }
} }
// @codeCoverageIgnoreEnd
// }}} Autocode
public static function schemaDef(): array public static function schemaDef(): array
{ {
return [ return [

View File

@ -63,7 +63,7 @@ class Poll extends Entity
public function setUri(?string $uri): self public function setUri(?string $uri): self
{ {
$this->uri = $uri; $this->uri = mb_substr($uri, 0, 191);
return $this; return $this;
} }

View File

@ -62,7 +62,7 @@ class PollResponse extends Entity
public function setUri(?string $uri): self public function setUri(?string $uri): self
{ {
$this->uri = $uri; $this->uri = mb_substr($uri, 0, 191);
return $this; return $this;
} }
@ -143,7 +143,7 @@ class PollResponse extends Entity
'id' => ['type' => 'serial', 'not null' => true], 'id' => ['type' => 'serial', 'not null' => true],
//'uri' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'UUID to the response notice'), //'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'], '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'], 'actor_id' => ['type' => 'int'],
'selection' => ['type' => 'int'], 'selection' => ['type' => 'int'],
'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'],

View File

@ -41,8 +41,8 @@ class ProfileColor extends Entity
// {{{ Autocode // {{{ Autocode
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $actor_id; private int $actor_id;
private ?string $color;
private ?string $background; private ?string $background;
private ?string $color;
private DateTimeInterface $created; private DateTimeInterface $created;
private DateTimeInterface $modified; private DateTimeInterface $modified;
@ -57,18 +57,7 @@ class ProfileColor extends Entity
return $this->actor_id; return $this->actor_id;
} }
public function setColor(string $color): self public function setBackground(?string $background): self
{
$this->color = $color;
return $this;
}
public function getColor(): ?string
{
return $this->color;
}
public function setBackground(string $background): self
{ {
$this->background = $background; $this->background = $background;
return $this; return $this;
@ -79,6 +68,17 @@ class ProfileColor extends Entity
return $this->background; 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 public function setCreated(DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;

View File

@ -50,7 +50,7 @@ class Activity extends Entity
private string $object_type; private string $object_type;
private int $object_id; private int $object_id;
private ?string $source; private ?string $source;
private DateTimeInterface $created; private \DateTimeInterface $created;
public function setId(int $id): self public function setId(int $id): self
{ {
@ -76,7 +76,7 @@ class Activity extends Entity
public function setVerb(string $verb): self public function setVerb(string $verb): self
{ {
$this->verb = $verb; $this->verb = \mb_substr($verb, 0, 32);
return $this; return $this;
} }
@ -87,7 +87,7 @@ class Activity extends Entity
public function setObjectType(string $object_type): self public function setObjectType(string $object_type): self
{ {
$this->object_type = $object_type; $this->object_type = \mb_substr($object_type, 0, 32);
return $this; return $this;
} }
@ -109,7 +109,7 @@ class Activity extends Entity
public function setSource(?string $source): self public function setSource(?string $source): self
{ {
$this->source = $source; $this->source = \mb_substr($source, 0, 32);
return $this; return $this;
} }
@ -118,13 +118,13 @@ class Activity extends Entity
return $this->source; return $this->source;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }

View File

@ -60,19 +60,19 @@ class Actor extends Entity
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $id; private int $id;
private string $nickname; private string $nickname;
private ?string $fullname = null; private ?string $fullname;
private int $roles = 4; private int $roles;
private int $type; private int $type;
private ?string $homepage = null; private ?string $homepage;
private ?string $bio = null; private ?string $bio;
private ?string $location = null; private ?string $location;
private ?float $lat; private ?float $lat;
private ?float $lon; private ?float $lon;
private ?int $location_id; private ?int $location_id;
private ?int $location_service; private ?int $location_service;
private bool $is_local; private bool $is_local;
private DateTimeInterface $created; private \DateTimeInterface $created;
private DateTimeInterface $modified; private \DateTimeInterface $modified;
public function setId(int $id): self public function setId(int $id): self
{ {
@ -87,7 +87,7 @@ class Actor extends Entity
public function setNickname(string $nickname): self public function setNickname(string $nickname): self
{ {
$this->nickname = $nickname; $this->nickname = \mb_substr($nickname, 0, 64);
return $this; return $this;
} }
@ -104,9 +104,6 @@ class Actor extends Entity
public function getFullname(): ?string public function getFullname(): ?string
{ {
if (\is_null($this->fullname)) {
return null;
}
return $this->fullname; return $this->fullname;
} }
@ -220,24 +217,24 @@ class Actor extends Entity
return $this->is_local; return $this->is_local;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -66,13 +66,13 @@ class ActorBlock extends Entity
return $this->blocked; return $this->blocked;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -52,8 +52,8 @@ class ActorCircle extends Entity
private string $tag; private string $tag;
private ?string $description; private ?string $description;
private ?bool $private; private ?bool $private;
private DateTimeInterface $created; private \DateTimeInterface $created;
private DateTimeInterface $modified; private \DateTimeInterface $modified;
public function setId(int $id): self public function setId(int $id): self
{ {
@ -79,7 +79,7 @@ class ActorCircle extends Entity
public function setTag(string $tag): self public function setTag(string $tag): self
{ {
$this->tag = $tag; $this->tag = \mb_substr($tag, 0, 64);
return $this; return $this;
} }
@ -110,24 +110,24 @@ class ActorCircle extends Entity
return $this->private; return $this->private;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -45,8 +45,8 @@ class ActorCircleSubscription extends Entity
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $actor_id; private int $actor_id;
private int $circle_id; private int $circle_id;
private DateTimeInterface $created; private \DateTimeInterface $created;
private DateTimeInterface $modified; private \DateTimeInterface $modified;
public function setActorId(int $actor_id): self public function setActorId(int $actor_id): self
{ {
@ -59,35 +59,35 @@ class ActorCircleSubscription extends Entity
return $this->actor_id; return $this->actor_id;
} }
public function setCircleid(int $circle_id): self public function setCircleId(int $circle_id): self
{ {
$this->circle_id = $circle_id; $this->circle_id = $circle_id;
return $this; return $this;
} }
public function getCircleid(): int public function getCircleId(): int
{ {
return $this->circle_id; return $this->circle_id;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -56,7 +56,7 @@ class ActorTag extends Entity
private string $tag; private string $tag;
private string $canonical; private string $canonical;
private bool $use_canonical; private bool $use_canonical;
private DateTimeInterface $modified; private \DateTimeInterface $modified;
public function setTagger(int $tagger): self public function setTagger(int $tagger): self
{ {
@ -82,7 +82,7 @@ class ActorTag extends Entity
public function setTag(string $tag): self public function setTag(string $tag): self
{ {
$this->tag = $tag; $this->tag = \mb_substr($tag, 0, 64);
return $this; return $this;
} }
@ -93,7 +93,7 @@ class ActorTag extends Entity
public function setCanonical(string $canonical): self public function setCanonical(string $canonical): self
{ {
$this->canonical = $canonical; $this->canonical = \mb_substr($canonical, 0, 64);
return $this; return $this;
} }
@ -113,13 +113,13 @@ class ActorTag extends Entity
return $this->use_canonical; return $this->use_canonical;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -46,7 +46,7 @@ class ActorTagBlock extends Entity
private string $tag; private string $tag;
private string $canonical; private string $canonical;
private bool $use_canonical; private bool $use_canonical;
private DateTimeInterface $modified; private \DateTimeInterface $modified;
public function setBlocker(int $blocker): self public function setBlocker(int $blocker): self
{ {
@ -61,7 +61,7 @@ class ActorTagBlock extends Entity
public function setTag(string $tag): self public function setTag(string $tag): self
{ {
$this->tag = $tag; $this->tag = \mb_substr($tag, 0, 64);
return $this; return $this;
} }
@ -72,7 +72,7 @@ class ActorTagBlock extends Entity
public function setCanonical(string $canonical): self public function setCanonical(string $canonical): self
{ {
$this->canonical = $canonical; $this->canonical = \mb_substr($canonical, 0, 64);
return $this; return $this;
} }
@ -92,13 +92,13 @@ class ActorTagBlock extends Entity
return $this->use_canonical; return $this->use_canonical;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -51,7 +51,7 @@ class ConfirmAddress extends Entity
public function setCode(string $code): self public function setCode(string $code): self
{ {
$this->code = $code; $this->code = \mb_substr($code, 0, 32);
return $this; return $this;
} }
@ -73,7 +73,7 @@ class ConfirmAddress extends Entity
public function setAddress(string $address): self public function setAddress(string $address): self
{ {
$this->address = $address; $this->address = \mb_substr($address, 0, 191);
return $this; return $this;
} }
@ -84,7 +84,7 @@ class ConfirmAddress extends Entity
public function setAddressExtra(?string $address_extra): self public function setAddressExtra(?string $address_extra): self
{ {
$this->address_extra = $address_extra; $this->address_extra = \mb_substr($address_extra, 0, 191);
return $this; return $this;
} }
@ -95,7 +95,7 @@ class ConfirmAddress extends Entity
public function setAddressType(string $address_type): self public function setAddressType(string $address_type): self
{ {
$this->address_type = $address_type; $this->address_type = \mb_substr($address_type, 0, 8);
return $this; return $this;
} }
@ -104,35 +104,35 @@ class ConfirmAddress extends Entity
return $this->address_type; return $this->address_type;
} }
public function setClaimed(?DateTimeInterface $claimed): self public function setClaimed(?\DateTimeInterface $claimed): self
{ {
$this->claimed = $claimed; $this->claimed = $claimed;
return $this; return $this;
} }
public function getClaimed(): ?DateTimeInterface public function getClaimed(): ?\DateTimeInterface
{ {
return $this->claimed; return $this->claimed;
} }
public function setSent(DateTimeInterface $sent): self public function setSent(\DateTimeInterface $sent): self
{ {
$this->sent = $sent; $this->sent = $sent;
return $this; return $this;
} }
public function getSent(): DateTimeInterface public function getSent(): \DateTimeInterface
{ {
return $this->sent; return $this->sent;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -48,8 +48,8 @@ class Feed extends Entity
private string $title; private string $title;
private string $route; private string $route;
private int $ordering; private int $ordering;
private DateTimeInterface $created; private \DateTimeInterface $created;
private DateTimeInterface $modified; private \DateTimeInterface $modified;
public function setActorId(int $actor_id): self public function setActorId(int $actor_id): self
{ {
@ -106,24 +106,24 @@ class Feed extends Entity
return $this->ordering; return $this->ordering;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -46,7 +46,7 @@ class GroupAlias extends Entity
public function setAlias(string $alias): self public function setAlias(string $alias): self
{ {
$this->alias = $alias; $this->alias = \mb_substr($alias, 0, 64);
return $this; return $this;
} }
@ -66,13 +66,13 @@ class GroupAlias extends Entity
return $this->group_id; return $this->group_id;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -78,13 +78,13 @@ class GroupBlock extends Entity
return $this->blocker_user; return $this->blocker_user;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -66,13 +66,13 @@ class GroupInbox extends Entity
return $this->activity_id; return $this->activity_id;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }

View File

@ -46,8 +46,8 @@ class GroupMember extends Entity
private int $actor_id; private int $actor_id;
private ?bool $is_admin; private ?bool $is_admin;
private ?string $uri; private ?string $uri;
private DateTimeInterface $created; private \DateTimeInterface $created;
private DateTimeInterface $modified; private \DateTimeInterface $modified;
public function setGroupId(int $group_id): self public function setGroupId(int $group_id): self
{ {
@ -84,7 +84,7 @@ class GroupMember extends Entity
public function setUri(?string $uri): self public function setUri(?string $uri): self
{ {
$this->uri = $uri; $this->uri = \mb_substr($uri, 0, 191);
return $this; return $this;
} }
@ -93,24 +93,24 @@ class GroupMember extends Entity
return $this->uri; return $this->uri;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -49,7 +49,7 @@ class Invitation extends Entity
public function setCode(string $code): self public function setCode(string $code): self
{ {
$this->code = $code; $this->code = \mb_substr($code, 0, 32);
return $this; return $this;
} }
@ -71,7 +71,7 @@ class Invitation extends Entity
public function setAddress(string $address): self public function setAddress(string $address): self
{ {
$this->address = $address; $this->address = \mb_substr($address, 0, 191);
return $this; return $this;
} }
@ -82,7 +82,7 @@ class Invitation extends Entity
public function setAddressType(string $address_type): self public function setAddressType(string $address_type): self
{ {
$this->address_type = $address_type; $this->address_type = \mb_substr($address_type, 0, 8);
return $this; return $this;
} }
@ -102,13 +102,13 @@ class Invitation extends Entity
return $this->registered_user_id; return $this->registered_user_id;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }

View File

@ -60,7 +60,7 @@ class LocalGroup extends Entity
public function setNickname(?string $nickname): self public function setNickname(?string $nickname): self
{ {
$this->nickname = $nickname; $this->nickname = \mb_substr($nickname, 0, 64);
return $this; return $this;
} }
@ -69,24 +69,24 @@ class LocalGroup extends Entity
return $this->nickname; return $this->nickname;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -71,8 +71,8 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs
private ?bool $auto_subscribe_back; private ?bool $auto_subscribe_back;
private ?int $subscription_policy; private ?int $subscription_policy;
private ?bool $is_stream_private; private ?bool $is_stream_private;
private DateTimeInterface $created; private \DateTimeInterface $created;
private DateTimeInterface $modified; private \DateTimeInterface $modified;
public function setId(int $id): self public function setId(int $id): self
{ {
@ -87,7 +87,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs
public function setNickname(string $nickname): self public function setNickname(string $nickname): self
{ {
$this->nickname = $nickname; $this->nickname = \mb_substr($nickname, 0, 64);
return $this; return $this;
} }
@ -98,7 +98,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs
public function setPassword(?string $password): self public function setPassword(?string $password): self
{ {
$this->password = $password; $this->password = \mb_substr($password, 0, 191);
return $this; return $this;
} }
@ -109,7 +109,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs
public function setOutgoingEmail(?string $outgoing_email): self public function setOutgoingEmail(?string $outgoing_email): self
{ {
$this->outgoing_email = $outgoing_email; $this->outgoing_email = \mb_substr($outgoing_email, 0, 191);
return $this; return $this;
} }
@ -120,7 +120,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs
public function setIncomingEmail(?string $incoming_email): self public function setIncomingEmail(?string $incoming_email): self
{ {
$this->incoming_email = $incoming_email; $this->incoming_email = \mb_substr($incoming_email, 0, 191);
return $this; return $this;
} }
@ -142,7 +142,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs
public function setTimezone(?string $timezone): self public function setTimezone(?string $timezone): self
{ {
$this->timezone = $timezone; $this->timezone = \mb_substr($timezone, 0, 50);
return $this; return $this;
} }
@ -175,7 +175,7 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs
public function setSmsEmail(?string $sms_email): self public function setSmsEmail(?string $sms_email): self
{ {
$this->sms_email = $sms_email; $this->sms_email = \mb_substr($sms_email, 0, 191);
return $this; return $this;
} }
@ -217,24 +217,24 @@ class LocalUser extends Entity implements UserInterface, PasswordAuthenticatedUs
return $this->is_stream_private; return $this->is_stream_private;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -58,7 +58,7 @@ class LocationService extends Entity
public function setDescription(?string $description): self public function setDescription(?string $description): self
{ {
$this->description = $description; $this->description = \mb_substr($description, 0, 191);
return $this; return $this;
} }
@ -67,24 +67,24 @@ class LocationService extends Entity
return $this->description; return $this->description;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -51,18 +51,18 @@ class Note extends Entity
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
private int $id; private int $id;
private int $actor_id; private int $actor_id;
private ?string $content = null; private ?string $content;
private string $content_type = 'text/plain'; private string $content_type = 'text/plain';
private ?string $rendered; private ?string $rendered;
private int $conversation_id; private int $conversation_id;
private ?int $reply_to = null; private ?int $reply_to;
private bool $is_local; private bool $is_local;
private ?string $source; private ?string $source;
private int $scope = VisibilityScope::PUBLIC; private int $scope = 1;
private ?string $url; private ?string $url;
private ?int $language_id = null; private ?int $language_id;
private DateTimeInterface $created; private \DateTimeInterface $created;
private DateTimeInterface $modified; private \DateTimeInterface $modified;
public function setId(int $id): self public function setId(int $id): self
{ {
@ -99,7 +99,7 @@ class Note extends Entity
public function setContentType(string $content_type): self public function setContentType(string $content_type): self
{ {
$this->content_type = $content_type; $this->content_type = \mb_substr($content_type, 0, 129);
return $this; return $this;
} }
@ -154,7 +154,7 @@ class Note extends Entity
public function setSource(?string $source): self public function setSource(?string $source): self
{ {
$this->source = $source; $this->source = \mb_substr($source, 0, 32);
return $this; return $this;
} }
@ -196,24 +196,24 @@ class Note extends Entity
return $this->language_id; return $this->language_id;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -102,13 +102,13 @@ class NoteLocation extends Entity
return $this->location_service; return $this->location_service;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -47,7 +47,7 @@ class NoteSource extends Entity
public function setCode(string $code): self public function setCode(string $code): self
{ {
$this->code = $code; $this->code = \mb_substr($code, 0, 32);
return $this; return $this;
} }
@ -58,7 +58,7 @@ class NoteSource extends Entity
public function setName(string $name): self public function setName(string $name): self
{ {
$this->name = $name; $this->name = \mb_substr($name, 0, 191);
return $this; return $this;
} }
@ -69,7 +69,7 @@ class NoteSource extends Entity
public function setUrl(string $url): self public function setUrl(string $url): self
{ {
$this->url = $url; $this->url = \mb_substr($url, 0, 191);
return $this; return $this;
} }
@ -78,13 +78,13 @@ class NoteSource extends Entity
return $this->url; return $this->url;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -50,12 +50,12 @@ class NoteTag extends Entity
private string $canonical; private string $canonical;
private int $note_id; private int $note_id;
private bool $use_canonical; private bool $use_canonical;
private int $language_id; private ?int $language_id;
private DateTimeInterface $created; private \DateTimeInterface $created;
public function setTag(string $tag): self public function setTag(string $tag): self
{ {
$this->tag = $tag; $this->tag = \mb_substr($tag, 0, 64);
return $this; return $this;
} }
@ -66,7 +66,7 @@ class NoteTag extends Entity
public function setCanonical(string $canonical): self public function setCanonical(string $canonical): self
{ {
$this->canonical = $canonical; $this->canonical = \mb_substr($canonical, 0, 64);
return $this; return $this;
} }
@ -97,24 +97,24 @@ class NoteTag extends Entity
return $this->use_canonical; return $this->use_canonical;
} }
public function setLanguageId(int $language_id): NoteTag public function setLanguageId(?int $language_id): self
{ {
$this->language_id = $language_id; $this->language_id = $language_id;
return $this; return $this;
} }
public function getLanguageId(): int public function getLanguageId(): ?int
{ {
return $this->language_id; return $this->language_id;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }

View File

@ -46,7 +46,7 @@ class NoteTagBlock extends Entity
private string $tag; private string $tag;
private string $canonical; private string $canonical;
private bool $use_canonical; private bool $use_canonical;
private DateTimeInterface $modified; private \DateTimeInterface $modified;
public function setBlocker(int $blocker): self public function setBlocker(int $blocker): self
{ {
@ -61,7 +61,7 @@ class NoteTagBlock extends Entity
public function setTag(string $tag): self public function setTag(string $tag): self
{ {
$this->tag = $tag; $this->tag = \mb_substr($tag, 0, 64);
return $this; return $this;
} }
@ -72,7 +72,7 @@ class NoteTagBlock extends Entity
public function setCanonical(string $canonical): self public function setCanonical(string $canonical): self
{ {
$this->canonical = $canonical; $this->canonical = \mb_substr($canonical, 0, 64);
return $this; return $this;
} }
@ -92,13 +92,13 @@ class NoteTagBlock extends Entity
return $this->use_canonical; return $this->use_canonical;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -66,13 +66,13 @@ class RelatedGroup extends Entity
return $this->related_group_id; return $this->related_group_id;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }

View File

@ -46,7 +46,7 @@ class RememberMeToken extends Entity
public function setSeries(string $series): self public function setSeries(string $series): self
{ {
$this->series = $series; $this->series = \mb_substr($series, 0, 88);
return $this; return $this;
} }
@ -57,7 +57,7 @@ class RememberMeToken extends Entity
public function setValue(string $value): self public function setValue(string $value): self
{ {
$this->value = $value; $this->value = \mb_substr($value, 0, 88);
return $this; return $this;
} }
@ -66,20 +66,20 @@ class RememberMeToken extends Entity
return $this->value; return $this->value;
} }
public function setLastused(DateTimeInterface $lastused): self public function setLastused(\DateTimeInterface $lastused): self
{ {
$this->lastused = $lastused; $this->lastused = $lastused;
return $this; return $this;
} }
public function getLastused(): DateTimeInterface public function getLastused(): \DateTimeInterface
{ {
return $this->lastused; return $this->lastused;
} }
public function setClass(string $class): self public function setClass(string $class): self
{ {
$this->class = $class; $this->class = \mb_substr($class, 0, 100);
return $this; return $this;
} }
@ -90,7 +90,7 @@ class RememberMeToken extends Entity
public function setUsername(string $username): self public function setUsername(string $username): self
{ {
$this->username = $username; $this->username = \mb_substr($username, 0, 64);
return $this; return $this;
} }

View File

@ -45,7 +45,7 @@ class ReservedNickname extends Entity
public function setNickname(string $nickname): self public function setNickname(string $nickname): self
{ {
$this->nickname = $nickname; $this->nickname = \mb_substr($nickname, 0, 64);
return $this; return $this;
} }
@ -54,13 +54,13 @@ class ReservedNickname extends Entity
return $this->nickname; return $this->nickname;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }

View File

@ -16,8 +16,8 @@ class ResetPasswordRequest extends Entity implements ResetPasswordRequestInterfa
private int $user_id; private int $user_id;
private ?string $selector; private ?string $selector;
private ?string $token; private ?string $token;
private DateTimeInterface $expires; private \DateTimeInterface $expires;
private DateTimeInterface $created; private \DateTimeInterface $created;
public function setId(int $id): self public function setId(int $id): self
{ {
@ -43,7 +43,7 @@ class ResetPasswordRequest extends Entity implements ResetPasswordRequestInterfa
public function setSelector(?string $selector): self public function setSelector(?string $selector): self
{ {
$this->selector = $selector; $this->selector = \mb_substr($selector, 0, 20);
return $this; return $this;
} }
@ -54,7 +54,7 @@ class ResetPasswordRequest extends Entity implements ResetPasswordRequestInterfa
public function setToken(?string $token): self public function setToken(?string $token): self
{ {
$this->token = $token; $this->token = \mb_substr($token, 0, 100);
return $this; return $this;
} }
@ -63,24 +63,24 @@ class ResetPasswordRequest extends Entity implements ResetPasswordRequestInterfa
return $this->token; return $this->token;
} }
public function setExpires(DateTimeInterface $expires): self public function setExpires(\DateTimeInterface $expires): self
{ {
$this->expires = $expires; $this->expires = $expires;
return $this; return $this;
} }
public function getExpires(): DateTimeInterface public function getExpires(): \DateTimeInterface
{ {
return $this->expires; return $this->expires;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }

View File

@ -59,7 +59,7 @@ class SmsCarrier extends Entity
public function setName(?string $name): self public function setName(?string $name): self
{ {
$this->name = $name; $this->name = \mb_substr($name, 0, 64);
return $this; return $this;
} }
@ -70,7 +70,7 @@ class SmsCarrier extends Entity
public function setEmailPattern(string $email_pattern): self public function setEmailPattern(string $email_pattern): self
{ {
$this->email_pattern = $email_pattern; $this->email_pattern = \mb_substr($email_pattern, 0, 191);
return $this; return $this;
} }
@ -79,24 +79,24 @@ class SmsCarrier extends Entity
return $this->email_pattern; return $this->email_pattern;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -67,24 +67,24 @@ class Subscription extends Entity
return $this->subscribed; return $this->subscribed;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -66,13 +66,13 @@ class SubscriptionQueue extends Entity
return $this->subscribed; return $this->subscribed;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }

View File

@ -65,24 +65,24 @@ class UserLocationPrefs extends Entity
return $this->share_location; return $this->share_location;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }

View File

@ -60,7 +60,7 @@ class UserUrlShortenerPrefs extends Entity
public function setUrlShorteningService(?string $url_shortening_service): self 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; return $this;
} }
@ -91,24 +91,24 @@ class UserUrlShortenerPrefs extends Entity
return $this->max_notice_length; return $this->max_notice_length;
} }
public function setCreated(DateTimeInterface $created): self public function setCreated(\DateTimeInterface $created): self
{ {
$this->created = $created; $this->created = $created;
return $this; return $this;
} }
public function getCreated(): DateTimeInterface public function getCreated(): \DateTimeInterface
{ {
return $this->created; return $this->created;
} }
public function setModified(DateTimeInterface $modified): self public function setModified(\DateTimeInterface $modified): self
{ {
$this->modified = $modified; $this->modified = $modified;
return $this; return $this;
} }
public function getModified(): DateTimeInterface public function getModified(): \DateTimeInterface
{ {
return $this->modified; return $this->modified;
} }