Skip to content

Commit

Permalink
Mark all legacy classes as final (#2928)
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria authored Jan 18, 2025
1 parent fd0111e commit 0869b18
Show file tree
Hide file tree
Showing 128 changed files with 131 additions and 128 deletions.
2 changes: 1 addition & 1 deletion app/Legacy/Actions/Photo/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
use Illuminate\Database\Eloquent\ModelNotFoundException;
use function Safe\filemtime;

class Create
final class Create
{
/** @var ImportParam the strategy parameters prepared and compiled by this class */
protected ImportParam $strategyParameters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Facades\Log;

class AddDuplicateStrategy extends AbstractAddStrategy
final class AddDuplicateStrategy extends AbstractAddStrategy
{
public function __construct(ImportParam $parameters, Photo $existing)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* requires the photo file to be a native, local file in order to be able to
* extract EXIF data.
*/
class AddPhotoPartnerStrategy extends AddStandaloneStrategy
final class AddPhotoPartnerStrategy extends AddStandaloneStrategy
{
protected Photo $existingVideo;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* This allows to use {@link MediaFile} as the source of the video, because
* no EXIF data needs to be extracted from the video.
*/
class AddVideoPartnerStrategy extends AbstractAddStrategy
final class AddVideoPartnerStrategy extends AbstractAddStrategy
{
protected BaseMediaFile $videoSourceFile;

Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/Actions/Settings/UpdateLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;

class UpdateLogin
final class UpdateLogin
{
/**
* Changes and modifies login parameters of CURRENT user (may be admin).
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/Legacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Stuff we need to delete in the future.
*/
class Legacy
final class Legacy
{
public static function isLegacyModelID(string $id): bool
{
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Actions/Albums/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Illuminate\Support\Facades\Auth;
use Kalnoy\Nestedset\Collection as NsCollection;

class Tree
final class Tree
{
private AlbumQueryPolicy $albumQueryPolicy;
private AlbumSortingCriterion $sorting;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
use Illuminate\Support\Facades\Gate;
use function Safe\json_encode;

class DiagnosticsController extends Controller
final class DiagnosticsController extends Controller
{
public const ERROR_MSG = 'You must have administrator rights to see this.';

Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/Administration/JobController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Illuminate\Routing\Controller;
use Illuminate\View\View;

class JobController extends Controller
final class JobController extends Controller
{
/**
* @param string $order
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Illuminate\Routing\Controller;
use Illuminate\View\View;

class OptimizeController extends Controller
final class OptimizeController extends Controller
{
protected OptimizeDb $optimizeDb;
protected OptimizeTables $optimizeTables;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\Exception\BadRequestException;

class SettingsController extends Controller
final class SettingsController extends Controller
{
/**
* Define the default sorting type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\DB;

class SharingController extends Controller
final class SharingController extends Controller
{
/**
* Returns the list of sharing permissions wrt. the authenticated user.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*
* TODO: Revise and refactor the whole logic around installation/upgrade/migration.
*/
class UpdateController extends Controller
final class UpdateController extends Controller
{
protected ApplyUpdate $applyUpdate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth;

class UserController extends Controller
final class UserController extends Controller
{
/**
* Update the Login information of the current user.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Auth;

class UsersController extends Controller
final class UsersController extends Controller
{
/**
* @return ResourceCollection<UserManagementResource>
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/AlbumController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\StreamedResponse;

class AlbumController extends Controller
final class AlbumController extends Controller
{
/**
* Add a new Album.
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/AlbumsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use App\Models\Configs;
use Illuminate\Routing\Controller;

class AlbumsController extends Controller
final class AlbumsController extends Controller
{
/**
* @return TopAlbumsResource returns the top albums
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/ImportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
*
* TODO: Refactor this, see problem description above.
*/
class ImportController extends Controller
final class ImportController extends Controller
{
/**
* @param ImportFromUrlRequest $request
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use function Safe\file_get_contents;
use function Safe\phpinfo;

class IndexController extends Controller
final class IndexController extends Controller
{
private SymLinkFunctions $symLinkFunctions;

Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/LegacyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* API calls which should not exist. ;-)
*/
class LegacyController extends Controller
final class LegacyController extends Controller
{
/**
* Translates IDs from legacy to modern format.
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/PhotoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
use Illuminate\Support\Facades\App;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;

class PhotoController extends Controller
final class PhotoController extends Controller
{
/**
* @param SymLinkFunctions $symLinkFunctions
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/PhotoEditorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use App\Models\Configs;
use Illuminate\Routing\Controller;

class PhotoEditorController extends Controller
final class PhotoEditorController extends Controller
{
/**
* Given a photoID and a direction (+1: 90° clockwise, -1: 90° counterclockwise) rotate an image.
Expand Down
5 changes: 4 additions & 1 deletion app/Legacy/V1/Controllers/RSSController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
use Illuminate\Support\Collection;
use Spatie\Feed\FeedItem;

class RSSController extends Controller
/**
* @codeCoverageIgnore Legacy stuff
*/
final class RSSController extends Controller
{
/**
* @param Generate $generate
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/RedirectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Illuminate\View\View;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;

class RedirectController extends Controller
final class RedirectController extends Controller
{
protected Unlock $unlock;
protected AlbumFactory $albumFactory;
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use App\Legacy\V1\Resources\SearchResource;
use Illuminate\Routing\Controller;

class SearchController extends Controller
final class SearchController extends Controller
{
/**
* Given a string split it by spaces to get terms and make a like search on the database.
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Controllers/SessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Session;

class SessionController extends Controller
final class SessionController extends Controller
{
/**
* First function being called via AJAX.
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/DTO/DiagnosticInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use App\DTO\ArrayableDTO;
use App\Enum\UpdateStatus;

class DiagnosticInfo extends ArrayableDTO
final class DiagnosticInfo extends ArrayableDTO
{
/**
* @param string[] $errors list of error messages
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Middleware/LoginRequiredV1.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* This middleware is ensures that only logged in users can access Lychee.
*/
class LoginRequiredV1
final class LoginRequiredV1
{
public const ROOT = 'root';
public const ALBUM = 'album';
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/AddAlbumRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use App\Policies\AlbumPolicy;
use Illuminate\Support\Facades\Gate;

class AddAlbumRequest extends BaseApiRequest implements HasTitle, HasParentAlbum
final class AddAlbumRequest extends BaseApiRequest implements HasTitle, HasParentAlbum
{
use HasTitleTrait;
use HasParentAlbumTrait;
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/AddTagAlbumRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use App\Policies\AlbumPolicy;
use Illuminate\Support\Facades\Gate;

class AddTagAlbumRequest extends BaseApiRequest implements HasTitle, HasTags
final class AddTagAlbumRequest extends BaseApiRequest implements HasTitle, HasTags
{
use HasTitleTrait;
use HasTagsTrait;
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/ArchiveAlbumsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* @implements HasAlbums<\App\Contracts\Models\AbstractAlbum>
*/
class ArchiveAlbumsRequest extends BaseApiRequest implements HasAlbums
final class ArchiveAlbumsRequest extends BaseApiRequest implements HasAlbums
{
/** @use HasAlbumsTrait<AbstractAlbum> */
use HasAlbumsTrait;
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/DeleteAlbumsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use App\Policies\AlbumPolicy;
use Illuminate\Support\Facades\Gate;

class DeleteAlbumsRequest extends BaseApiRequest implements HasAlbumIDs
final class DeleteAlbumsRequest extends BaseApiRequest implements HasAlbumIDs
{
use HasAlbumIDsTrait;

Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/DeleteTrackRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use App\Legacy\V1\RuleSets\Album\BasicAlbumIdRuleSet;
use App\Models\Album;

class DeleteTrackRequest extends BaseApiRequest implements HasAlbum
final class DeleteTrackRequest extends BaseApiRequest implements HasAlbum
{
use HasAlbumTrait;
use AuthorizeCanEditAlbumTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use App\Rules\AlbumIDRule;
use Illuminate\Support\Facades\Gate;

class GetAlbumPositionDataRequest extends BaseApiRequest implements HasAbstractAlbum
final class GetAlbumPositionDataRequest extends BaseApiRequest implements HasAbstractAlbum
{
use HasAbstractAlbumTrait;

Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/GetAlbumRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use App\Policies\AlbumPolicy;
use Illuminate\Support\Facades\Gate;

class GetAlbumRequest extends BaseApiRequest implements HasAbstractAlbum
final class GetAlbumRequest extends BaseApiRequest implements HasAbstractAlbum
{
use HasAbstractAlbumTrait;

Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/MergeAlbumsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* @implements HasAlbums<Album>
*/
class MergeAlbumsRequest extends BaseApiRequest implements HasAlbum, HasAlbums
final class MergeAlbumsRequest extends BaseApiRequest implements HasAlbum, HasAlbums
{
use HasAlbumTrait;
/** @phpstan-use HasAlbumsTrait<Album> */
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/MoveAlbumsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* @implements HasAlbums<Album>
*/
class MoveAlbumsRequest extends BaseApiRequest implements HasAlbum, HasAlbums
final class MoveAlbumsRequest extends BaseApiRequest implements HasAlbum, HasAlbums
{
use HasAlbumTrait;
/** @phpstan-use HasAlbumsTrait<Album> */
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/SetAlbumCopyrightRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use App\Rules\CopyrightRule;
use App\Rules\RandomIDRule;

class SetAlbumCopyrightRequest extends BaseApiRequest implements HasBaseAlbum, HasCopyright
final class SetAlbumCopyrightRequest extends BaseApiRequest implements HasBaseAlbum, HasCopyright
{
use HasBaseAlbumTrait;
use HasCopyrightTrait;
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/SetAlbumCoverRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use App\Policies\PhotoPolicy;
use Illuminate\Support\Facades\Gate;

class SetAlbumCoverRequest extends BaseApiRequest implements HasAlbum, HasPhoto
final class SetAlbumCoverRequest extends BaseApiRequest implements HasAlbum, HasPhoto
{
use HasAlbumTrait;
use HasPhotoTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use App\Rules\DescriptionRule;
use App\Rules\RandomIDRule;

class SetAlbumDescriptionRequest extends BaseApiRequest implements HasBaseAlbum, HasDescription
final class SetAlbumDescriptionRequest extends BaseApiRequest implements HasBaseAlbum, HasDescription
{
use HasBaseAlbumTrait;
use HasDescriptionTrait;
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/SetAlbumHeaderRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use App\Policies\PhotoPolicy;
use Illuminate\Support\Facades\Gate;

class SetAlbumHeaderRequest extends BaseApiRequest implements HasAlbum, HasPhoto
final class SetAlbumHeaderRequest extends BaseApiRequest implements HasAlbum, HasPhoto
{
use HasAlbumTrait;
use HasPhotoTrait;
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/SetAlbumLicenseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use App\Rules\RandomIDRule;
use Illuminate\Validation\Rules\Enum;

class SetAlbumLicenseRequest extends BaseApiRequest implements HasAlbum, HasLicense
final class SetAlbumLicenseRequest extends BaseApiRequest implements HasAlbum, HasLicense
{
use HasAlbumTrait;
use HasLicenseTrait;
Expand Down
2 changes: 1 addition & 1 deletion app/Legacy/V1/Requests/Album/SetAlbumNSFWRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* Class SetAlbumNSFWRequest.
*/
class SetAlbumNSFWRequest extends BaseApiRequest implements HasBaseAlbum
final class SetAlbumNSFWRequest extends BaseApiRequest implements HasBaseAlbum
{
use HasBaseAlbumTrait;
use AuthorizeCanEditAlbumTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use App\Rules\PasswordRule;
use App\Rules\RandomIDRule;

class SetAlbumProtectionPolicyRequest extends BaseApiRequest implements HasBaseAlbum, HasPassword
final class SetAlbumProtectionPolicyRequest extends BaseApiRequest implements HasBaseAlbum, HasPassword
{
use HasBaseAlbumTrait;
use HasPasswordTrait;
Expand Down
Loading

0 comments on commit 0869b18

Please sign in to comment.