Add PHPDocs and code formatting

This commit is contained in:
Alex Cabal 2024-11-20 14:23:42 -06:00
parent ac733df938
commit 3f822b85c3
4 changed files with 53 additions and 19 deletions

View file

@ -1951,7 +1951,7 @@ class Ebook{
inner join EbookTags et using (EbookId) inner join EbookTags et using (EbookId)
where et.TagId = ? where et.TagId = ?
and et.EbookId != ? and et.EbookId != ?
order by RAND() order by rand()
limit ? limit ?
', [$relatedTag->TagId, $ebook->EbookId, $count], Ebook::class); ', [$relatedTag->TagId, $ebook->EbookId, $count], Ebook::class);
} }
@ -1960,7 +1960,7 @@ class Ebook{
SELECT * SELECT *
from Ebooks from Ebooks
where EbookId != ? where EbookId != ?
order by RAND() order by rand()
limit ? limit ?
', [$ebook->EbookId, $count], Ebook::class); ', [$ebook->EbookId, $count], Ebook::class);
} }

View file

@ -2,13 +2,30 @@
namespace Enums; namespace Enums;
enum ArtworkFilterType: string{ enum ArtworkFilterType: string{
case Admin = 'admin'; // Show all artwork, regardless of status. /** Show all artwork, regardless of status. */
case All = 'all'; // Show all artwork, but only approved artwork if the logged-in user is not an admin. case Admin = 'admin';
case Approved = 'approved'; // Show all approved artwork.
case ApprovedInUse = 'approved_in_use'; // Show all approved that is in-use. /** Show all artwork, but only approved artwork if the logged-in user is not an admin. */
case ApprovedNotInUse = 'approved_not_in_use'; // Show all approved that is not in-use. case All = 'all';
case ApprovedSubmitter = 'approved_submitter'; // Show all approved artwork, plus unverified artwork which the logged-in user has submitted.
case Declined = 'declined'; // Show only declined artwork. /** Show all approved artwork. */
case Unverified = 'unverified'; // Show only unverified artwork. case Approved = 'approved';
case UnverifiedSubmitter = 'unverified_submitter'; // Show only unverified artwork that the logged-in user has submitted.
/** Show all approved that is in-use. */
case ApprovedInUse = 'approved_in_use';
/** Show all approved that is not in-use. */
case ApprovedNotInUse = 'approved_not_in_use';
/** Show all approved artwork, plus unverified artwork which the logged-in user has submitted. */
case ApprovedSubmitter = 'approved_submitter';
/** Show only declined artwork. */
case Declined = 'declined';
/** Show only unverified artwork. */
case Unverified = 'unverified';
/** Show only unverified artwork that the logged-in user has submitted. */
case UnverifiedSubmitter = 'unverified_submitter';
} }

View file

@ -2,11 +2,24 @@
namespace Enums; namespace Enums;
enum DateTimeFormat: string{ enum DateTimeFormat: string{
case Sql = 'Y-m-d H:i:s'; // `2022-01-05 23:42:12` /** Like `2022-01-05 23:42:12`. */
case Iso = 'Y-m-d\TH:i:s\Z'; // `2022-01-05T23:42:12Z` case Sql = 'Y-m-d H:i:s';
case FullDateTime = 'F j, Y g:i a'; // `January 5, 2022 2:04 pm`
case Ical = 'Ymd\THis\Z'; //20220105T234212Z /** Like `2022-01-05T23:42:12Z`. */
case Html = 'Y-m-d\TH:i:s'; // `2022-01-05T23:42:12` case Iso = 'Y-m-d\TH:i:s\Z';
case Rss = 'r'; // `D, d M Y H:i:s`
/** Like `January 5, 2022 2:04 pm`. */
case FullDateTime = 'F j, Y g:i a';
/** Like `20220105T234212Z`. */
case Ical = 'Ymd\THis\Z';
/** Like `2022-01-05T23:42:12`. */
case Html = 'Y-m-d\TH:i:s';
/** Like `Sat, 5 Jan 2022 23:42:12 +0000`. */
case Rss = 'r';
/** Like `1641426132`. */
case UnixTimestamp = 'U'; case UnixTimestamp = 'U';
} }

View file

@ -7,8 +7,12 @@ enum HttpCode: int{
case Accepted = 202; case Accepted = 202;
case NoContent = 204; case NoContent = 204;
case MovedPermanently = 301; // Permanent redirect /** Permanent redirect. */
case Found = 302; // Temporary redirect case MovedPermanently = 301;
/** Temporary redirect. */
case Found = 302;
case SeeOther = 303; case SeeOther = 303;
case BadRequest = 400; case BadRequest = 400;