jikan-rest/app/Enums/MediaReviewsSortEnum.php
pushrbx 6eff2af172 various fixes and refactorings
- genre filtering
- added unapproved filtering
- fixed sfw filtering
- fixed kids filtering
- fixed deprecation warnings as of php 8.1
  - DateTime ctor can't take `null` anymore as first param
  - preg_replace doesn't accept `null` values as `$subject`
- fixed failed items indexer (the --failed option of indexers) -- it didn't load the correct file making it impossible to retry the indexing
- changed the document schema for search indexed anime/manga
  - added `approved` field to them
  - staging will require a reimport into TypeSense
- the central filtering system will now process `sfw` and `unapproved` filters, so they will be applied implicitly through the `filter` model scope method.
2023-05-21 11:18:35 +01:00

25 lines
546 B
PHP

<?php
namespace App\Enums;
use Jikan\Helper\Constants;
use Spatie\Enum\Laravel\Enum;
/**
* @method static self mostVoted()
* @method static self newest()
* @method static self oldest()
*/
final class MediaReviewsSortEnum extends Enum
{
protected static function labels(): array
{
return [
"mostVoted" => Constants::REVIEWS_SORT_MOST_VOTED,
"newest" => Constants::REVIEWS_SORT_NEWEST,
"oldest" => Constants::REVIEWS_SORT_OLDEST,
"suggested" => "suggested",
];
}
}