diff --git a/INSTALL.md b/INSTALL.md index d631697b4d..c9c7933a28 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -45,8 +45,8 @@ Prerequisites ----- In order to host your GNU social instance, you'll need a domain, a -server with a constant IP and `docker` and `docker-compose` installed -on your system. +server with a constant IP and both `docker` and `docker-compose` +installed on your system. Alternatively, for local hosting or development, behind a NAT, use a dynamic DNS solutions. I recommend you go to @@ -59,7 +59,7 @@ With TLS/SSL ---- Next, if you want to setup SSL (which you should in most cases, -exceptions being wanting to use the Thor network), you'll need a +exceptions being wanting to use the Tor network), you'll need a certificate. There are multiple approaches to achieve this, among which are using a proxy server capable of either proxying an HTTP connection to HTTPS or an HTTPS connection to HTTPS, or creating a diff --git a/bin/port_entities b/bin/port_entities index 3486d6b48b..859a604ceb 100755 --- a/bin/port_entities +++ b/bin/port_entities @@ -64,7 +64,7 @@ $license_header = ' foreach ($classes as $cls) { $ref = new ReflectionClass($cls); - $class_name = Common::toCamelCase($cls); + $class_name = Common::snakeCaseToCamelCase($cls); $file = $ref->getFileName(); $class_comment = $ref->getDocComment(); $table_name = $ref->getDefaultProperties()['__table']; diff --git a/docker-compose.yml b/docker-compose.yaml similarity index 75% rename from docker-compose.yml rename to docker-compose.yaml index 1476a966ea..47551d0b54 100644 --- a/docker-compose.yml +++ b/docker-compose.yaml @@ -29,20 +29,20 @@ services: done & nginx -g "daemon off;"' - certbot: - image: certbot/certbot - depends_on: - - nginx - # Check for certificate renewal every 12h as - # recomnended by Let's Encryot - entrypoint: /bin/sh -c 'trap exit TERM; - while :; do - certbot renew > /dev/null; - sleep 12h & wait $${!}; - done' - volumes: - - ./docker/certbot/www:/var/www/certbot - - ./docker/certbot/files:/etc/letsencrypt + #certbot: + # image: certbot/certbot + # depends_on: + # - nginx + # # Check for certificate renewal every 12h as + # # recomnended by Let's Encryot + # entrypoint: /bin/sh -c 'trap exit TERM; + # while :; do + # certbot renew > /dev/null; + # sleep 12h & wait $${!}; + # done' + # volumes: + # - ./docker/certbot/www:/var/www/certbot + # - ./docker/certbot/files:/etc/letsencrypt php: build: docker/php diff --git a/plugins/Test/Controller/TestController.php b/plugins/Test/Controller/TestController.php index a9b6fdee6d..41744c8e69 100644 --- a/plugins/Test/Controller/TestController.php +++ b/plugins/Test/Controller/TestController.php @@ -9,6 +9,6 @@ class TestController extends AbstractController { public function __invoke() { - return new Response('
Test controller
'); + return new Response('
Test controller
'); } } diff --git a/src/Command/ListEventsCommand.php b/src/Command/ListEventsCommand.php index d7df4c8c66..2aa9132c3c 100644 --- a/src/Command/ListEventsCommand.php +++ b/src/Command/ListEventsCommand.php @@ -31,6 +31,7 @@ namespace App\Command; use Functional as F; +use ReflectionFunction; use Symfony\Bundle\FrameworkBundle\Command\EventDispatcherDebugCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -72,7 +73,7 @@ class ListEventsCommand extends EventDispatcherDebugCommand foreach ($listeners as $event => $listener) { echo 'Event \'' . $event . "\\' handled by:\n"; foreach ($listener as $c) { - $r = new \ReflectionFunction($c); + $r = new ReflectionFunction($c); echo ' ' . get_class($r->getStaticVariables()['handler'][0]) . "\n"; } } diff --git a/src/DependencyInjection/Compiler/SchemaDefPass.php b/src/DependencyInjection/Compiler/SchemaDefPass.php index f861a71ccb..1e898e8082 100644 --- a/src/DependencyInjection/Compiler/SchemaDefPass.php +++ b/src/DependencyInjection/Compiler/SchemaDefPass.php @@ -18,7 +18,7 @@ */ /** - * Compiler pass which triggers Symgony to tell Doctrine to + * Compiler pass which triggers Symfony to tell Doctrine to * use out `SchemaDef` metadata driver * * @package GNUsocial diff --git a/src/Entity/Attention.php b/src/Entity/Attention.php index 827eabfd22..bb6aaf83cd 100644 --- a/src/Entity/Attention.php +++ b/src/Entity/Attention.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for attentions * @@ -40,8 +42,8 @@ class Attention private int $notice_id; private int $profile_id; private ?string $reason; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setNoticeId(int $notice_id): self { @@ -73,22 +75,22 @@ class Attention return $this->reason; } - 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/Avatar.php b/src/Entity/Avatar.php index f553e7b872..b52fbaa864 100644 --- a/src/Entity/Avatar.php +++ b/src/Entity/Avatar.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user's avatar * @@ -43,8 +45,8 @@ class Avatar private int $height; private string $mediatype; private ?string $filename; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setProfileId(int $profile_id): self { @@ -106,22 +108,22 @@ class Avatar return $this->filename; } - 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/Config.php b/src/Entity/Config.php index b5fbe8cbe9..99e3f0f8be 100644 --- a/src/Entity/Config.php +++ b/src/Entity/Config.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,7 +13,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} diff --git a/src/Entity/ConfirmAddress.php b/src/Entity/ConfirmAddress.php index 5bc36a97a7..8b9b268188 100644 --- a/src/Entity/ConfirmAddress.php +++ b/src/Entity/ConfirmAddress.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user's email confimation * @@ -42,9 +44,9 @@ class ConfirmAddress private string $address; private ?string $address_extra; private string $address_type; - private ?\DateTimeInterface $claimed; - private ?\DateTimeInterface $sent; - private \DateTimeInterface $modified; + private ?DateTimeInterface $claimed; + private ?DateTimeInterface $sent; + private DateTimeInterface $modified; public function setCode(string $code): self { @@ -96,32 +98,32 @@ class ConfirmAddress 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/Consumer.php b/src/Entity/Consumer.php index d4a7c745e2..5894bd247d 100644 --- a/src/Entity/Consumer.php +++ b/src/Entity/Consumer.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for OAuth consumer * @@ -40,8 +42,8 @@ class Consumer private string $consumer_key; private string $consumer_secret; private string $seed; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setConsumerKey(string $consumer_key): self { @@ -73,22 +75,22 @@ class Consumer return $this->seed; } - 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/Conversation.php b/src/Entity/Conversation.php index 414a06d66f..392182cced 100644 --- a/src/Entity/Conversation.php +++ b/src/Entity/Conversation.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Data class for Conversations * @@ -38,8 +40,8 @@ class Conversation private int $id; private string $uri; private ?string $url; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setId(int $id): self { @@ -71,22 +73,22 @@ class Conversation return $this->url; } - 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; } @@ -100,7 +102,7 @@ class Conversation 'fields' => [ 'id' => ['type' => 'serial', 'not null' => true, 'description' => 'Unique identifier, (again) unrelated to notice id since 2016-01-06'], 'uri' => ['type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'URI of the conversation'], - 'url' => ['type' => 'varchar', 'length' => 191, 'description' => 'Resolvable URL, preferrably remote (local can be generated on the fly)'], + 'url' => ['type' => 'varchar', 'length' => 191, 'description' => 'Resolvable URL, preferably remote (local can be generated on the fly)'], 'created' => ['type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'], 'modified' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], diff --git a/src/Entity/File.php b/src/Entity/File.php index 690a500ee4..af98860ce8 100644 --- a/src/Entity/File.php +++ b/src/Entity/File.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for uploaded files * @@ -49,7 +51,7 @@ class File private ?string $filename; private ?int $width; private ?int $height; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setId(int $id): self { @@ -171,12 +173,12 @@ class File return $this->height; } - 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/FileRedirection.php b/src/Entity/FileRedirection.php index 2cc1fe9e0f..8c94206534 100644 --- a/src/Entity/FileRedirection.php +++ b/src/Entity/FileRedirection.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for File redirects * @@ -42,7 +44,7 @@ class FileRedirection private ?int $file_id; private ?int $redirections; private ?int $httpcode; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setUrlhash(string $urlhash): self { @@ -94,12 +96,12 @@ class FileRedirection return $this->httpcode; } - 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/FileThumbnail.php b/src/Entity/FileThumbnail.php index 0ec363c252..a6d4c77838 100644 --- a/src/Entity/FileThumbnail.php +++ b/src/Entity/FileThumbnail.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for File thumbnails * @@ -43,7 +45,7 @@ class FileThumbnail private ?string $filename; private int $width; private int $height; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setFileId(int $file_id): self { @@ -105,12 +107,12 @@ class FileThumbnail return $this->height; } - 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/FileToPost.php b/src/Entity/FileToPost.php index 2b43109e14..f31dd41637 100644 --- a/src/Entity/FileToPost.php +++ b/src/Entity/FileToPost.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for relating a file to a post * @@ -39,7 +41,7 @@ class FileToPost private int $file_id; private int $post_id; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setFileId(int $file_id): self { @@ -61,12 +63,12 @@ class FileToPost return $this->post_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/ForeignLink.php b/src/Entity/ForeignLink.php index ee1a10aeb6..707c320d01 100644 --- a/src/Entity/ForeignLink.php +++ b/src/Entity/ForeignLink.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user's foreign profile * @@ -44,10 +46,10 @@ class ForeignLink private int $noticesync; private int $friendsync; private int $profilesync; - private ?\DateTimeInterface $last_noticesync; - private ?\DateTimeInterface $last_friendsync; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private ?DateTimeInterface $last_noticesync; + private ?DateTimeInterface $last_friendsync; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setUserId(int $user_id): self { @@ -119,42 +121,42 @@ class ForeignLink return $this->profilesync; } - public function setLastNoticesync(?\DateTimeInterface $last_noticesync): self + public function setLastNoticesync(?DateTimeInterface $last_noticesync): self { $this->last_noticesync = $last_noticesync; return $this; } - public function getLastNoticesync(): ?\DateTimeInterface + public function getLastNoticesync(): ?DateTimeInterface { return $this->last_noticesync; } - public function setLastFriendsync(?\DateTimeInterface $last_friendsync): self + public function setLastFriendsync(?DateTimeInterface $last_friendsync): self { $this->last_friendsync = $last_friendsync; return $this; } - public function getLastFriendsync(): ?\DateTimeInterface + public function getLastFriendsync(): ?DateTimeInterface { return $this->last_friendsync; } - 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/ForeignService.php b/src/Entity/ForeignService.php index be4bedaf15..745c58a0af 100644 --- a/src/Entity/ForeignService.php +++ b/src/Entity/ForeignService.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for foreign services * @@ -40,8 +42,8 @@ class ForeignService private int $id; private string $name; private ?string $description; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setId(int $id): self { @@ -73,22 +75,22 @@ class ForeignService 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/ForeignSubscription.php b/src/Entity/ForeignSubscription.php index 3656d27719..165ec782aa 100644 --- a/src/Entity/ForeignSubscription.php +++ b/src/Entity/ForeignSubscription.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user's foreign subscriptions * @@ -40,7 +42,7 @@ class ForeignSubscription private int $service; private int $subscriber; private int $subscribed; - private \DateTimeInterface $created; + private DateTimeInterface $created; public function setService(int $service): self { @@ -72,12 +74,12 @@ class ForeignSubscription 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/ForeignUser.php b/src/Entity/ForeignUser.php index 603c156578..fb8be3b23d 100644 --- a/src/Entity/ForeignUser.php +++ b/src/Entity/ForeignUser.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Foreign Users * @@ -41,8 +43,8 @@ class ForeignUser private int $service; private string $uri; private ?string $nickname; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setId(int $id): self { @@ -84,22 +86,22 @@ class ForeignUser 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/GroupAlias.php b/src/Entity/GroupAlias.php index e89f899b77..938d9aa374 100644 --- a/src/Entity/GroupAlias.php +++ b/src/Entity/GroupAlias.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Group Alias * @@ -39,7 +41,7 @@ class GroupAlias private string $alias; private int $group_id; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setAlias(string $alias): self { @@ -61,12 +63,12 @@ class GroupAlias 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 d5338e1200..00c0e89b71 100644 --- a/src/Entity/GroupBlock.php +++ b/src/Entity/GroupBlock.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Group Block * @@ -40,7 +42,7 @@ class GroupBlock private int $group_id; private int $blocked; private int $blocker; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setGroupId(int $group_id): self { @@ -72,12 +74,12 @@ class GroupBlock return $this->blocker; } - 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 4656646ff5..97dc2415a8 100644 --- a/src/Entity/GroupInbox.php +++ b/src/Entity/GroupInbox.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Group's inbox * @@ -39,7 +41,7 @@ class GroupInbox private int $group_id; private int $notice_id; - private \DateTimeInterface $created; + private DateTimeInterface $created; public function setGroupId(int $group_id): self { @@ -61,12 +63,12 @@ class GroupInbox return $this->notice_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/GroupJoinQueue.php b/src/Entity/GroupJoinQueue.php index 9642f357bf..e93fc07308 100644 --- a/src/Entity/GroupJoinQueue.php +++ b/src/Entity/GroupJoinQueue.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Queue on joining a group * @@ -39,7 +41,7 @@ class GroupJoinQueue private int $profile_id; private int $group_id; - private \DateTimeInterface $created; + private DateTimeInterface $created; public function setProfileId(int $profile_id): self { @@ -61,12 +63,12 @@ class GroupJoinQueue return $this->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/GroupMember.php b/src/Entity/GroupMember.php index 5ce012730f..98d5a6a436 100644 --- a/src/Entity/GroupMember.php +++ b/src/Entity/GroupMember.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for a Group Member * @@ -41,8 +43,8 @@ class GroupMember private int $profile_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,22 +86,22 @@ class GroupMember 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 c09a4fc681..412ebbbb6e 100644 --- a/src/Entity/Invitation.php +++ b/src/Entity/Invitation.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user invitations * @@ -41,7 +43,7 @@ class Invitation private int $user_id; private string $address; private string $address_type; - private \DateTimeInterface $created; + private DateTimeInterface $created; private ?int $registered_user_id; public function setCode(string $code): self @@ -84,12 +86,12 @@ class Invitation return $this->address_type; } - 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 52266da6fc..db6a17fdd5 100644 --- a/src/Entity/LocalGroup.php +++ b/src/Entity/LocalGroup.php @@ -19,6 +19,8 @@ namespace App\Entity; +use DateTimeInterface; + /** * Entity for local groups * @@ -39,8 +41,8 @@ class LocalGroup private int $group_id; private ?string $nickname; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setGroupId(int $group_id): self { @@ -62,22 +64,22 @@ class LocalGroup 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/LocationNamespace.php b/src/Entity/LocationNamespace.php index edb1b3608b..db97f47543 100644 --- a/src/Entity/LocationNamespace.php +++ b/src/Entity/LocationNamespace.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for location namespace * @@ -39,8 +41,8 @@ class LocationNamespace private int $id; private ?string $description; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setId(int $id): self { @@ -62,22 +64,22 @@ class LocationNamespace 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/LoginToken.php b/src/Entity/LoginToken.php index 038c35dd57..54ff56f010 100644 --- a/src/Entity/LoginToken.php +++ b/src/Entity/LoginToken.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Login tokens * @@ -39,8 +41,8 @@ class LoginToken private int $user_id; private string $token; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setUserId(int $user_id): self { @@ -62,22 +64,22 @@ class LoginToken return $this->token; } - 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/Nonce.php b/src/Entity/Nonce.php index 37568cd88a..1326ead95e 100644 --- a/src/Entity/Nonce.php +++ b/src/Entity/Nonce.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for nonce * @@ -40,9 +42,9 @@ class Nonce private string $consumer_key; private ?string $tok; private string $nonce; - private \DateTimeInterface $ts; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $ts; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setConsumerKey(string $consumer_key): self { @@ -74,32 +76,32 @@ class Nonce return $this->nonce; } - public function setTs(\DateTimeInterface $ts): self + public function setTs(DateTimeInterface $ts): self { $this->ts = $ts; return $this; } - public function getTs(): \DateTimeInterface + public function getTs(): DateTimeInterface { return $this->ts; } - 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/Notice.php b/src/Entity/Notice.php index 977c98f2b5..056837c59b 100644 --- a/src/Entity/Notice.php +++ b/src/Entity/Notice.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for notices * @@ -43,8 +45,8 @@ class Notice private ?string $content; private ?string $rendered; private ?string $url; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; private ?int $reply_to; private ?int $is_local; private ?string $source; @@ -114,22 +116,22 @@ class Notice return $this->url; } - 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; } @@ -258,7 +260,7 @@ class Notice 'notice_object_type_idx' => ['object_type'], 'notice_verb_idx' => ['verb'], 'notice_profile_id_verb_idx' => ['profile_id', 'verb'], - 'notice_url_idx' => ['url'], // Qvitter wants this + 'notice_url_idx' => ['url'], 'notice_replyto_idx' => ['reply_to'], ], ]; diff --git a/src/Entity/NoticeLocation.php b/src/Entity/NoticeLocation.php index b233929625..8915403600 100644 --- a/src/Entity/NoticeLocation.php +++ b/src/Entity/NoticeLocation.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Notice's location * @@ -42,7 +44,7 @@ class NoticeLocation private ?float $lon; private ?int $location_id; private ?int $location_ns; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setNoticeId(int $notice_id): self { @@ -94,12 +96,12 @@ class NoticeLocation return $this->location_ns; } - 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/NoticePrefs.php b/src/Entity/NoticePrefs.php index d166a4de9d..5a31f37850 100644 --- a/src/Entity/NoticePrefs.php +++ b/src/Entity/NoticePrefs.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Notice preferences * @@ -43,8 +45,8 @@ class NoticePrefs private string $namespace; private string $topic; private $data; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setNoticeId(int $notice_id): self { @@ -86,22 +88,22 @@ class NoticePrefs return $this->data; } - 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/NoticeSource.php b/src/Entity/NoticeSource.php index 2efe575bdc..8614747bb2 100644 --- a/src/Entity/NoticeSource.php +++ b/src/Entity/NoticeSource.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Notices sources * @@ -41,8 +43,8 @@ class NoticeSource private string $name; private string $url; private int $notice_id; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setCode(string $code): self { @@ -84,22 +86,22 @@ class NoticeSource return $this->notice_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/NoticeTag.php b/src/Entity/NoticeTag.php index fd7928e52a..43d55e2d3b 100644 --- a/src/Entity/NoticeTag.php +++ b/src/Entity/NoticeTag.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Notice Tag * @@ -39,7 +41,7 @@ class NoticeTag private string $tag; private int $notice_id; - private \DateTimeInterface $created; + private DateTimeInterface $created; public function setTag(string $tag): self { @@ -61,12 +63,12 @@ class NoticeTag return $this->notice_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/OauthApplication.php b/src/Entity/OauthApplication.php index 394dfe9981..727beb7ae0 100644 --- a/src/Entity/OauthApplication.php +++ b/src/Entity/OauthApplication.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for OAuth Application * @@ -49,8 +51,8 @@ class OauthApplication private ?string $callback_url; private ?int $type; private ?int $access_type; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setId(int $id): self { @@ -172,22 +174,22 @@ class OauthApplication return $this->access_type; } - 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/OauthApplicationUser.php b/src/Entity/OauthApplicationUser.php index a0a44e5431..486e70512c 100644 --- a/src/Entity/OauthApplicationUser.php +++ b/src/Entity/OauthApplicationUser.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for OAuth Application User * @@ -41,8 +43,8 @@ class OauthApplicationUser private int $application_id; private ?int $access_type; private ?string $token; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setProfileId(int $profile_id): self { @@ -84,22 +86,22 @@ class OauthApplicationUser return $this->token; } - 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/OauthTokenAssociation.php b/src/Entity/OauthTokenAssociation.php index 0728fd2441..e4f7e7d459 100644 --- a/src/Entity/OauthTokenAssociation.php +++ b/src/Entity/OauthTokenAssociation.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for association between OAuth and internal token * @@ -40,8 +42,8 @@ class OauthTokenAssociation private int $profile_id; private int $application_id; private string $token; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setProfileId(int $profile_id): self { @@ -73,22 +75,22 @@ class OauthTokenAssociation return $this->token; } - 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/OldSchoolPrefs.php b/src/Entity/OldSchoolPrefs.php index 73649bb154..4f9615483b 100644 --- a/src/Entity/OldSchoolPrefs.php +++ b/src/Entity/OldSchoolPrefs.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Separate table for storing UI preferences * @@ -41,8 +43,8 @@ class OldSchoolPrefs private ?bool $stream_mode_only; private ?bool $conversation_tree; private ?bool $stream_nicknames; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setUserId(int $user_id): self { @@ -84,22 +86,22 @@ class OldSchoolPrefs return $this->stream_nicknames; } - 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/Profile.php b/src/Entity/Profile.php index fba9877d46..90f859b71b 100644 --- a/src/Entity/Profile.php +++ b/src/Entity/Profile.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user profiles * @@ -48,8 +50,8 @@ class Profile private ?float $lon; private ?int $location_id; private ?int $location_ns; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setId(int $id): self { @@ -161,22 +163,22 @@ class Profile return $this->location_ns; } - 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/ProfileBlock.php b/src/Entity/ProfileBlock.php index a828a99b02..49f1608dce 100644 --- a/src/Entity/ProfileBlock.php +++ b/src/Entity/ProfileBlock.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for User's Profile Block * @@ -39,7 +41,7 @@ class ProfileBlock private int $blocker; private int $blocked; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setBlocker(int $blocker): self { @@ -61,12 +63,12 @@ class ProfileBlock 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/ProfileList.php b/src/Entity/ProfileList.php index 5dd09f513d..ceac31516c 100644 --- a/src/Entity/ProfileList.php +++ b/src/Entity/ProfileList.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for List of profiles * @@ -42,8 +44,8 @@ class ProfileList private string $tag; private ?string $description; private ?bool $private; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; private ?string $uri; private ?string $mainpage; private ?int $tagged_count; @@ -99,22 +101,22 @@ class ProfileList 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/ProfilePrefs.php b/src/Entity/ProfilePrefs.php index bd6ff28a80..89960b254b 100644 --- a/src/Entity/ProfilePrefs.php +++ b/src/Entity/ProfilePrefs.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Data class for Profile preferences * @@ -41,8 +43,8 @@ class ProfilePrefs private string $namespace; private string $topic; private $data; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setProfileId(int $profile_id): self { @@ -84,22 +86,22 @@ class ProfilePrefs return $this->data; } - 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/ProfileRole.php b/src/Entity/ProfileRole.php index 715960e75f..a0550df2bc 100644 --- a/src/Entity/ProfileRole.php +++ b/src/Entity/ProfileRole.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user profile role * @@ -39,7 +41,7 @@ class ProfileRole private int $profile_id; private string $role; - private \DateTimeInterface $created; + private DateTimeInterface $created; public function setProfileId(int $profile_id): self { @@ -61,12 +63,12 @@ class ProfileRole return $this->role; } - 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/ProfileTag.php b/src/Entity/ProfileTag.php index b63fa38b61..3266392f5c 100644 --- a/src/Entity/ProfileTag.php +++ b/src/Entity/ProfileTag.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Profile Tag * @@ -40,7 +42,7 @@ class ProfileTag private int $tagger; private int $tagged; private string $tag; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setTagger(int $tagger): self { @@ -72,12 +74,12 @@ class ProfileTag return $this->tag; } - 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/ProfileTagSubscription.php b/src/Entity/ProfileTagSubscription.php index 89246d9772..a09d79fb21 100644 --- a/src/Entity/ProfileTagSubscription.php +++ b/src/Entity/ProfileTagSubscription.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Profile Tag Subscription * @@ -39,8 +41,8 @@ class ProfileTagSubscription private int $profile_tag_id; private int $profile_id; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setProfileTagId(int $profile_tag_id): self { @@ -62,22 +64,22 @@ class ProfileTagSubscription return $this->profile_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/QueueItem.php b/src/Entity/QueueItem.php index 31b2f64e91..09e4f820fb 100644 --- a/src/Entity/QueueItem.php +++ b/src/Entity/QueueItem.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for a Queue Item * @@ -40,8 +42,8 @@ class QueueItem private int $id; private $frame; private string $transport; - private \DateTimeInterface $created; - private ?\DateTimeInterface $claimed; + private DateTimeInterface $created; + private ?DateTimeInterface $claimed; public function setId(int $id): self { @@ -73,22 +75,22 @@ class QueueItem return $this->transport; } - 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 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; } diff --git a/src/Entity/RelatedGroup.php b/src/Entity/RelatedGroup.php index 44a1a6c649..389c8f549e 100644 --- a/src/Entity/RelatedGroup.php +++ b/src/Entity/RelatedGroup.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for related groups * @@ -39,7 +41,7 @@ class RelatedGroup private int $group_id; private int $related_group_id; - private \DateTimeInterface $created; + private DateTimeInterface $created; public function setGroupId(int $group_id): self { @@ -61,12 +63,12 @@ class RelatedGroup 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/RememberMe.php b/src/Entity/RememberMe.php index 8d86ea4fae..1cf48b816a 100644 --- a/src/Entity/RememberMe.php +++ b/src/Entity/RememberMe.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user remember me * @@ -39,7 +41,7 @@ class RememberMe private string $code; private int $user_id; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setCode(string $code): self { @@ -61,12 +63,12 @@ class RememberMe return $this->user_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/Reply.php b/src/Entity/Reply.php index 2defa58078..39f382053b 100644 --- a/src/Entity/Reply.php +++ b/src/Entity/Reply.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Notice reply * @@ -39,7 +41,7 @@ class Reply private int $notice_id; private int $profile_id; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; private ?int $replied_id; public function setNoticeId(int $notice_id): self @@ -62,12 +64,12 @@ class Reply return $this->profile_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/SchemaVersion.php b/src/Entity/SchemaVersion.php index 90f8fc9899..e6515991d2 100644 --- a/src/Entity/SchemaVersion.php +++ b/src/Entity/SchemaVersion.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for the Schema Version * @@ -39,7 +41,7 @@ class SchemaVersion private string $table_name; private string $checksum; - private \DateTimeInterface $modified; + private DateTimeInterface $modified; public function setTableName(string $table_name): self { @@ -61,12 +63,12 @@ class SchemaVersion return $this->checksum; } - 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/Session.php b/src/Entity/Session.php index d71d13fd99..35b1614285 100644 --- a/src/Entity/Session.php +++ b/src/Entity/Session.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Superclass representing a saved session as it exists in the database. * @@ -41,8 +43,8 @@ class Session private string $id; private ?string $session_data; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setId(string $id): self { @@ -64,22 +66,22 @@ class Session return $this->session_data; } - 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/SmsCarrier.php b/src/Entity/SmsCarrier.php index 16a4f27902..ea98a77bff 100644 --- a/src/Entity/SmsCarrier.php +++ b/src/Entity/SmsCarrier.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for SMS carriers * @@ -40,8 +42,8 @@ class SmsCarrier private int $id; private ?string $name; private string $email_pattern; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setId(int $id): self { @@ -73,22 +75,22 @@ class SmsCarrier 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 7fe3ec1b43..de4fa99045 100644 --- a/src/Entity/Subscription.php +++ b/src/Entity/Subscription.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for subscription * @@ -45,8 +47,8 @@ class Subscription private ?string $token; private ?string $secret; private ?string $uri; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setSubscriber(int $subscriber): self { @@ -118,22 +120,22 @@ class Subscription 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/SubscriptionQueue.php b/src/Entity/SubscriptionQueue.php index ef985caef7..0d950d1ddc 100644 --- a/src/Entity/SubscriptionQueue.php +++ b/src/Entity/SubscriptionQueue.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for Subscription queue * @@ -39,7 +41,7 @@ class SubscriptionQueue private int $subscriber; private int $subscribed; - private \DateTimeInterface $created; + private DateTimeInterface $created; public function setSubscriber(int $subscriber): self { @@ -61,12 +63,12 @@ class SubscriptionQueue 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/Token.php b/src/Entity/Token.php index 44544c4e38..85be62a1ce 100644 --- a/src/Entity/Token.php +++ b/src/Entity/Token.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for User token * @@ -44,8 +46,8 @@ class Token private ?int $state; private ?string $verifier; private ?string $verified_callback; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setConsumerKey(string $consumer_key): self { @@ -117,22 +119,22 @@ class Token return $this->verified_callback; } - 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/UnavailableStatusNetwork.php b/src/Entity/UnavailableStatusNetwork.php index 635f8b9cbc..3358f824e2 100644 --- a/src/Entity/UnavailableStatusNetwork.php +++ b/src/Entity/UnavailableStatusNetwork.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity that Keeps a list of unavailable status network names * @@ -38,7 +40,7 @@ class UnavailableStatusNetwork // {{{ Autocode private string $nickname; - private \DateTimeInterface $created; + private DateTimeInterface $created; public function setNickname(string $nickname): self { @@ -50,12 +52,12 @@ class UnavailableStatusNetwork 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/User.php b/src/Entity/User.php index ef488c800d..ea475dbf4e 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for users * @@ -60,8 +62,8 @@ class User private ?int $subscribe_policy; private ?string $urlshorteningservice; private ?bool $private_stream; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setId(int $id): self { @@ -293,22 +295,22 @@ class User return $this->private_stream; } - 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/UserGroup.php b/src/Entity/UserGroup.php index cf03ad3d3f..ea57bd566e 100644 --- a/src/Entity/UserGroup.php +++ b/src/Entity/UserGroup.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for groups a user is in * @@ -48,8 +50,8 @@ class UserGroup private ?string $homepage_logo; private ?string $stream_logo; private ?string $mini_logo; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; private ?string $uri; private ?string $mainpage; private ?int $join_policy; @@ -165,22 +167,22 @@ class UserGroup return $this->mini_logo; } - 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/UserImPrefs.php b/src/Entity/UserImPrefs.php index 3e4dc73f5e..884a119da4 100644 --- a/src/Entity/UserImPrefs.php +++ b/src/Entity/UserImPrefs.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user IM preferences * @@ -41,8 +43,8 @@ class UserImPrefs private bool $notify; private bool $replies; private bool $updatefrompresence; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setUserId(int $user_id): self { @@ -104,22 +106,22 @@ class UserImPrefs return $this->updatefrompresence; } - 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/UserLocationPrefs.php b/src/Entity/UserLocationPrefs.php index 413a86c79d..60f0495c3e 100644 --- a/src/Entity/UserLocationPrefs.php +++ b/src/Entity/UserLocationPrefs.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user location preferences * @@ -37,8 +39,8 @@ class UserLocationPrefs private int $user_id; private ?bool $share_location; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setUserId(int $user_id): self { @@ -60,22 +62,22 @@ class UserLocationPrefs 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 53f6448485..bf69b75cf9 100644 --- a/src/Entity/UserUrlshortenerPrefs.php +++ b/src/Entity/UserUrlshortenerPrefs.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for user's url shortener preferences * @@ -41,8 +43,8 @@ class UserUrlshortenerPrefs private ?string $urlshorteningservice; private int $maxurllength; private int $maxnoticelength; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setUserId(int $user_id): self { @@ -84,22 +86,22 @@ class UserUrlshortenerPrefs return $this->maxnoticelength; } - 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/UserUsername.php b/src/Entity/UserUsername.php index e0d48809a5..bf1a3d7bb3 100644 --- a/src/Entity/UserUsername.php +++ b/src/Entity/UserUsername.php @@ -4,7 +4,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -13,12 +13,14 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} namespace App\Entity; +use DateTimeInterface; + /** * Entity for association between user and username * @@ -40,8 +42,8 @@ class UserUsername private string $provider_name; private string $username; private int $user_id; - private \DateTimeInterface $created; - private \DateTimeInterface $modified; + private DateTimeInterface $created; + private DateTimeInterface $modified; public function setProviderName(string $provider_name): self { @@ -73,22 +75,22 @@ class UserUsername return $this->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; } - 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/Kernel.php b/src/Kernel.php index 1f37d5c267..a474b1ce79 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -115,6 +115,6 @@ class Kernel extends BaseKernel { parent::build($container); - $container->addCompilerPass(new SchemaDefPass($container)); + $container->addCompilerPass(new SchemaDefPass()); } } diff --git a/src/Routes/Main.php b/src/Routes/Main.php index 20c75c3fe0..7c1e92bf6f 100644 --- a/src/Routes/Main.php +++ b/src/Routes/Main.php @@ -30,12 +30,13 @@ namespace App\Routes; +use App\Controller\NetworkPublic; use App\Util\RouteLoader; abstract class Main { public static function load(RouteLoader $r): void { - $r->connect('main_all', '/main/all', \App\Controller\NetworkPublic::class); + $r->connect('main_all', '/main/all', NetworkPublic::class); } } diff --git a/src/Util/Common.php b/src/Util/Common.php index 2bbeac620a..8a307282bd 100644 --- a/src/Util/Common.php +++ b/src/Util/Common.php @@ -31,20 +31,33 @@ namespace App\Util; use Functional as F; +use InvalidArgumentException; use Symfony\Component\Config\Definition\Exception\Exception; +use const DIRECTORY_SEPARATOR; abstract class Common { + /** + * Access sysadmin's configuration preferences for GNU social + * + * @param string $section + * @param string $field + * @return mixed + */ public static function config(string $section, string $field) { + // TODO: implement it x) + return []; } /** * Normalize path by converting \ to / + * @param string $path + * @return string */ public static function normalizePath(string $path): string { - if (\DIRECTORY_SEPARATOR !== '/') { + if (DIRECTORY_SEPARATOR !== '/') { $path = strtr($path, DIRECTORY_SEPARATOR, '/'); } return $path; @@ -52,6 +65,8 @@ abstract class Common /** * Get plugin name from it's path, or null if not a plugin + * @param string $path + * @return string|null */ public static function pluginFromPath(string $path): ?string { @@ -75,6 +90,8 @@ abstract class Common * Check whether $haystack starts with $needle * * @param array|string $haystack if array, check that all strings start with $needle + * @param string $needle + * @return bool */ public static function startsWith($haystack, string $needle): bool { @@ -92,6 +109,8 @@ abstract class Common * Check whether $haystack ends with $needle * * @param array|string $haystack if array, check that all strings end with $needle + * @param string $needle + * @return bool */ public static function endsWith($haystack, string $needle) { @@ -111,6 +130,9 @@ abstract class Common /** * Call $func with only abs($count) arguments, taken either from the * left or right depending on the sign + * @param callable $func + * @param int $count + * @return callable */ public static function arity(callable $func, int $count): callable { @@ -122,12 +144,20 @@ abstract class Common }; } - public static function toSnakeCase(string $str): string + /** + * @param string $str + * @return string + */ + public static function camelCaseToSnakeCase(string $str): string { return strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $str)); } - public static function toCamelCase(string $str): string + /** + * @param string $str + * @return string + */ + public static function snakeCaseToCamelCase(string $str): string { return implode('', F\map(preg_split('/[\b_]/', $str), self::arity('ucfirst', 1))); } @@ -136,6 +166,9 @@ abstract class Common * Indent $in, a string or array, $level levels * * @param array|string $in + * @param int $level + * @param int $count + * @return string */ public static function indent($in, int $level = 1, int $count = 2): string { @@ -149,5 +182,6 @@ abstract class Common return F\concat($indent . $val); })); } + throw new InvalidArgumentException('Common:indent first parameter must be either an array or a string. Input was: '.$in); } } diff --git a/src/Util/GNUsocial.php b/src/Util/GNUsocial.php index b5abdc955b..716dbe04f3 100644 --- a/src/Util/GNUsocial.php +++ b/src/Util/GNUsocial.php @@ -57,6 +57,9 @@ class GNUsocial implements EventSubscriberInterface /** * Symfony dependency injection gives us access to these services + * @param ContainerInterface $container + * @param LoggerInterface $logger + * @param TranslatorInterface $translator */ public function __construct(ContainerInterface $container, LoggerInterface $logger, @@ -69,6 +72,7 @@ class GNUsocial implements EventSubscriberInterface /** * Store these services to be accessed statically and load modules + * @param EventDispatcherInterface $event_dispatcher */ public function register(EventDispatcherInterface $event_dispatcher): void { @@ -81,6 +85,10 @@ class GNUsocial implements EventSubscriberInterface /** * Event very early on in the Symfony HTTP lifecycle, but after everyting is registered * where we get access to the event dispatcher + * @param RequestEvent $event + * @param string $event_name + * @param EventDispatcherInterface $event_dispatcher + * @return RequestEvent */ public function onKernelRequest(RequestEvent $event, string $event_name, @@ -92,6 +100,10 @@ class GNUsocial implements EventSubscriberInterface /** * Event after everything is initialized when using the `bin/console` command + * @param ConsoleCommandEvent $event + * @param string $event_name + * @param EventDispatcherInterface $event_dispatcher + * @return ConsoleCommandEvent */ public function onCommand(ConsoleCommandEvent $event, string $event_name, diff --git a/src/Util/GSEvent.php b/src/Util/GSEvent.php index 7e43b4a291..8f6aded86e 100644 --- a/src/Util/GSEvent.php +++ b/src/Util/GSEvent.php @@ -69,10 +69,11 @@ abstract class GSEvent * Handlers can also abort processing by throwing an exception; these will * be caught by the closest code and displayed as errors. * - * @param string $name Name of the event - * @param callable $handler Code to run - * @param int $priority Higher runs first + * @param string $name Name of the event + * @param callable $handler Code to run + * @param int $priority Higher runs first * + * @param string $ns * @return void */ public static function addHandler(string $name, @@ -139,7 +140,7 @@ abstract class GSEvent $listeners = self::$dispatcher->getListeners($name); if (isset($plugin)) { foreach ($listeners as $handler) { - if (\get_class($handler[0]) == $plugin) { + if (get_class($handler[0]) == $plugin) { return true; } } diff --git a/src/Util/HTML.php b/src/Util/HTML.php index c296895ddb..ff90931b2b 100644 --- a/src/Util/HTML.php +++ b/src/Util/HTML.php @@ -3,7 +3,7 @@ // This file is part of GNU social - https://www.gnu.org/software/soci // // GNU social is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as publ +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // @@ -12,7 +12,7 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // -// You should have received a copy of the GNU Affero General Public Li +// You should have received a copy of the GNU Affero General Public License // along with GNU social. If not, see . // }}} @@ -32,7 +32,10 @@ abstract class HTML /** * Creates an HTML tag without attributes * + * @param string $tag * @param array|string $content + * @param bool $empty_tag + * @return array */ private static function tag(string $tag, $content = '', bool $empty_tag = false): array { @@ -42,8 +45,11 @@ abstract class HTML /** * Create tag, possibly with attributes and indentation * - * @param array|string $attrs - element attributes + * @param string $tag + * @param array|string $attrs - element attributes * @param array|string $content - what goes inside the tag + * @param bool $empty_tag + * @return array */ private static function attr_tag(string $tag, $attrs, $content = '', bool $empty_tag = false): array { @@ -59,13 +65,18 @@ abstract class HTML /** * Attribute with given optional value * - * @param array $attr + * @param array $attrs + * @return string */ private static function attr(array $attrs): string { return ' ' . implode(' ', F\map($attrs, function ($val, $key, $_) { return "{$key} = '{$val}'"; })); } + /** + * @param $html + * @return string + */ public static function html($html): string { if (is_string($html)) { diff --git a/src/Util/I18n.php b/src/Util/I18n.php index af4b1c97b6..96a63dc115 100644 --- a/src/Util/I18n.php +++ b/src/Util/I18n.php @@ -46,11 +46,12 @@ $LC_CATEGORIES = [ 'LC_ALL', ]; foreach ($LC_CATEGORIES as $key => $name) { - if (!\defined($name)) { + if (!defined($name)) { define($name, $key); } } +use InvalidArgumentException; use Symfony\Contracts\Translation\TranslatorInterface; abstract class I18n @@ -105,21 +106,21 @@ abstract class I18n * * _m($msg) -- simple message * _m($ctx, $msg) -- message with context - * _m($msg1, $msg2, $n) -- message that cann be singular or plural + * _m($msg1, $msg2, $n) -- message that can be singular or plural * _m($ctx, $msg1, $msg2, $n) -- combination of the previous two * * @param string $msg * @param extra params as described above * - * @throws Exception + * @throws InvalidArgumentException * * @return string */ function _m(string $msg /*, ...*/): string { - $domain = I18n::_mdomain(\debug_backtrace()); + $domain = I18n::_mdomain(debug_backtrace()); $args = func_get_args(); - switch (\count($args)) { + switch (count($args)) { case 1: // Empty parameters return I18n::$translator->trans($msg, [], $domain); @@ -143,7 +144,7 @@ function _m(string $msg /*, ...*/): string return I18n::$translator->trans($context . '\004' . $msg_single . '|' . $msg_plural, ['%d' => $n], $domain); default: - throw new Exception('Bad parameter count to _m()'); + throw new InvalidArgumentException('Bad parameter count to _m()'); } } @@ -191,7 +192,7 @@ function client_preferred_language(string $http_accept_lang_header): string function get_nice_language_list(): array { $nice_lang = []; - $all_languages = common_config('site', 'languages'); + $all_languages = Common::config('site', 'languages'); foreach ($all_languages as $lang) { $nice_lang[$lang['lang']] = $lang['name']; @@ -202,17 +203,18 @@ function get_nice_language_list(): array /** * Check whether a language is right-to-left * - * @param string $lang language code of the language to check + * @param string $lang_value language code of the language to check * * @return bool true if language is rtl */ function is_rtl(string $lang_value): bool { - foreach (common_config('site', 'languages') as $code => $info) { + foreach (Common::config('site', 'languages') as $code => $info) { if ($lang_value == $info['lang']) { return $info['direction'] == 'rtl'; } } + throw new InvalidArgumentException('is_rtl function received an invalid lang to test. Lang was: '.$lang_value); } /** diff --git a/src/Util/Log.php b/src/Util/Log.php index 2e6875a1b5..469027923a 100644 --- a/src/Util/Log.php +++ b/src/Util/Log.php @@ -44,44 +44,66 @@ class Log /** * Simple static wrappers around Monolog's functions + * @param string $msg */ public static function emergency(string $msg): void { self::$logger->emergency($msg); } + /** + * @param string $msg + */ public static function alert(string $msg): void { self::$logger->alert($msg); } + /** + * @param string $msg + */ public static function critical(string $msg): void { self::$logger->critical($msg); } + /** + * @param string $msg + */ public static function error(string $msg): void { self::$logger->error($msg); } + /** + * @param string $msg + */ public static function warning(string $msg): void { self::$logger->warning($msg); } + /** + * @param string $msg + */ public static function notice(string $msg): void { self::$logger->notice($msg); } + /** + * @param string $msg + */ public static function info(string $msg): void { self::$logger->info($msg); } + /** + * @param string $msg + */ public static function debug(string $msg): void { - $logger->debug($msg); + self::$logger->debug($msg); } } diff --git a/src/Util/RouteLoader.php b/src/Util/RouteLoader.php index 310a63445e..f3a64623b5 100644 --- a/src/Util/RouteLoader.php +++ b/src/Util/RouteLoader.php @@ -43,10 +43,12 @@ class RouteLoader extends Loader /** * Route loading entry point, called from `config/routes.php` * - * Must comform to symfony's interface, but the $resource is unused + * Must conform to symfony's interface, but the $resource is unused * and $type must not be null * * @param mixed $resource + * @param string|null $type + * @return RouteCollection */ public function load($resource, string $type = null): RouteCollection { @@ -65,8 +67,11 @@ class RouteLoader extends Loader /** * Connect a route to a controller * - * @param mixed $target Some kind of callable, typically [object, method] - * @param ?array $options Possible keys are ['condition', 'defaults', 'format', + * @param string $id + * @param string $uri_path + * @param mixed $target Some kind of callable, typically [object, method] + * @param array|null $param_reqs + * @param array|null $options Possible keys are ['condition', 'defaults', 'format', * 'fragment', 'http-methods', 'locale', 'methods', 'schemes'] * 'http-methods' and 'methods' are aliases */ @@ -112,6 +117,8 @@ class RouteLoader extends Loader * `config/routes.php` * * @param mixed $resource Unused + * @param string|null $type + * @return bool */ public function supports($resource, string $type = null) { diff --git a/src/Util/SchemaDefDriver.php b/src/Util/SchemaDefDriver.php index 08bc254e49..0be9f2d5f7 100644 --- a/src/Util/SchemaDefDriver.php +++ b/src/Util/SchemaDefDriver.php @@ -146,6 +146,7 @@ class SchemaDefDriver extends StaticPHPDriver * instead of `loadMetadata`. * * @param string $class_name + * @return bool */ public function isTransient($class_name) { @@ -154,6 +155,8 @@ class SchemaDefDriver extends StaticPHPDriver /** * Convert [$key => $val] to ['name' => $key, 'columns' => $val] + * @param array $arr + * @return array */ private static function kv_to_name_col(array $arr): array { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2a0282cfff..5160486cc0 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,8 +4,8 @@ use Symfony\Component\Dotenv\Dotenv; require dirname(__DIR__) . '/vendor/autoload.php'; -if (\file_exists(\dirname(__DIR__) . '/config/bootstrap.php')) { +if (file_exists(dirname(__DIR__) . '/config/bootstrap.php')) { require dirname(__DIR__) . '/config/bootstrap.php'; -} elseif (\method_exists(Dotenv::class, 'bootEnv')) { - (new Dotenv())->bootEnv(\dirname(__DIR__) . '/.env'); +} elseif (method_exists(Dotenv::class, 'bootEnv')) { + (new Dotenv())->bootEnv(dirname(__DIR__) . '/.env'); }