diff --git a/app/Console/Commands/AppCommand.php b/app/Console/Commands/AppCommand.php index dc770822..383ee000 100644 --- a/app/Console/Commands/AppCommand.php +++ b/app/Console/Commands/AppCommand.php @@ -8,8 +8,6 @@ abstract class AppCommand extends Command { private const MAX_LINE_LENGTH = 128; - private float $start_microtime = 0.0; - /** * The name and signature of the console command. * @@ -24,6 +22,8 @@ abstract class AppCommand extends Command */ protected $description = 'Non-functional abstract base command class with generic helper methods, for other commands to extend from'; + private float $start_microtime = 0.0; + /** Execute the console command. */ public function handle(): int { diff --git a/app/Console/Commands/Seeds/SeedUsers.php b/app/Console/Commands/Seeds/SeedUsers.php index 8daa946a..0e65af87 100644 --- a/app/Console/Commands/Seeds/SeedUsers.php +++ b/app/Console/Commands/Seeds/SeedUsers.php @@ -6,13 +6,10 @@ use App\Models\User; use Throwable; -class SeedUsers extends AppCommand +final class SeedUsers extends AppCommand { private const TABLE_HEADINGS = ['count', 'id', 'email']; - /** @var array> */ - private array $table_data = []; - /** * The name and signature of the console command. * @@ -27,6 +24,9 @@ class SeedUsers extends AppCommand */ protected $description = 'Seed the users table with the specified number of records'; + /** @var array> */ + private array $table_data = []; + /** Execute the console command. */ public function handle(): int { diff --git a/app/Http/Controllers/Auth/AuthenticatedSessionController.php b/app/Http/Controllers/Auth/AuthenticatedSessionController.php index 54010090..baaad0bf 100644 --- a/app/Http/Controllers/Auth/AuthenticatedSessionController.php +++ b/app/Http/Controllers/Auth/AuthenticatedSessionController.php @@ -11,7 +11,7 @@ use Illuminate\Http\RedirectResponse; use Inertia\Response; -class AuthenticatedSessionController extends Controller +final class AuthenticatedSessionController extends Controller { const TEMPLATE_LOGIN = 'Auth/AuthLogin'; diff --git a/app/Http/Controllers/Auth/EmailVerificationController.php b/app/Http/Controllers/Auth/EmailVerificationController.php index cf88bc21..0d7543c8 100644 --- a/app/Http/Controllers/Auth/EmailVerificationController.php +++ b/app/Http/Controllers/Auth/EmailVerificationController.php @@ -12,7 +12,7 @@ use Illuminate\Http\RedirectResponse; use Inertia\Response; -class EmailVerificationController extends Controller +final class EmailVerificationController extends Controller { const TEMPLATE_EMAIL_VERIFY = 'Auth/AuthEmailVerify'; diff --git a/app/Http/Controllers/Auth/PasswordConfirmationController.php b/app/Http/Controllers/Auth/PasswordConfirmationController.php index 56f932c2..3399a972 100644 --- a/app/Http/Controllers/Auth/PasswordConfirmationController.php +++ b/app/Http/Controllers/Auth/PasswordConfirmationController.php @@ -12,7 +12,7 @@ use Illuminate\Validation\ValidationException; use Inertia\Response; -class PasswordConfirmationController extends Controller +final class PasswordConfirmationController extends Controller { const TEMPLATE_PASSWORD_CONFIRM = 'Auth/AuthPasswordConfirm'; diff --git a/app/Http/Controllers/Auth/PasswordForgottenController.php b/app/Http/Controllers/Auth/PasswordForgottenController.php index 0d58c82d..2f4d4e20 100644 --- a/app/Http/Controllers/Auth/PasswordForgottenController.php +++ b/app/Http/Controllers/Auth/PasswordForgottenController.php @@ -15,7 +15,7 @@ use Illuminate\Validation\ValidationException; use Inertia\Response; -class PasswordForgottenController extends Controller +final class PasswordForgottenController extends Controller { const TEMPLATE_PASSWORD_FORGOT = 'Auth/AuthPasswordForgot'; diff --git a/app/Http/Controllers/Auth/ProfileController.php b/app/Http/Controllers/Auth/ProfileController.php index 1856055e..c7424132 100644 --- a/app/Http/Controllers/Auth/ProfileController.php +++ b/app/Http/Controllers/Auth/ProfileController.php @@ -17,7 +17,7 @@ use Illuminate\Http\RedirectResponse; use Inertia\Response; -class ProfileController extends Controller +final class ProfileController extends Controller { const TEMPLATE_DASHBOARD = 'Profile/ProfileDashboard'; diff --git a/app/Http/Controllers/Auth/ProfilePasswordController.php b/app/Http/Controllers/Auth/ProfilePasswordController.php index ed501935..9da3b506 100644 --- a/app/Http/Controllers/Auth/ProfilePasswordController.php +++ b/app/Http/Controllers/Auth/ProfilePasswordController.php @@ -6,7 +6,7 @@ use App\Http\Requests\Auth\PasswordUpdateRequest; use Illuminate\Http\RedirectResponse; -class ProfilePasswordController extends Controller +final class ProfilePasswordController extends Controller { /** Update the authenticated user's password. */ public function update(PasswordUpdateRequest $request): RedirectResponse diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 77ec359a..bd3e17ed 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -6,7 +6,7 @@ use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; -class Controller extends BaseController +abstract class Controller extends BaseController { use AuthorizesRequests, ValidatesRequests; } diff --git a/app/Http/Controllers/Public/HomepageController.php b/app/Http/Controllers/Public/HomepageController.php index 7be50d7c..e8dac86f 100644 --- a/app/Http/Controllers/Public/HomepageController.php +++ b/app/Http/Controllers/Public/HomepageController.php @@ -7,7 +7,7 @@ use App\Repositories\Views\PublicViewRepository; use Inertia\Response; -class HomepageController extends Controller +final class HomepageController extends Controller { const TEMPLATE_PUBLIC_INDEX = 'Public/PublicHomepage'; diff --git a/app/Http/Controllers/Public/PageController.php b/app/Http/Controllers/Public/PageController.php index be9a74a3..a3bc78a0 100644 --- a/app/Http/Controllers/Public/PageController.php +++ b/app/Http/Controllers/Public/PageController.php @@ -11,7 +11,7 @@ use Illuminate\Http\Request; use Inertia\Response; -class PageController extends Controller +final class PageController extends Controller { /** Display the given page. */ public function show(Page $page): Response diff --git a/app/Http/Controllers/Public/SitemapController.php b/app/Http/Controllers/Public/SitemapController.php index a7525a5b..f411aa5a 100644 --- a/app/Http/Controllers/Public/SitemapController.php +++ b/app/Http/Controllers/Public/SitemapController.php @@ -3,12 +3,13 @@ namespace App\Http\Controllers\Public; use App\Http\Controllers\Controller; -use App\Http\Resources\Views\Sitemaps\SitemapPagesContentResource; -use App\Http\Resources\Views\Sitemaps\SitemapsContentResource; +use App\Http\Resources\Views\Sitemaps\PagesSitemapResource; +use App\Http\Resources\Views\Sitemaps\SitemapResource; +use App\Repositories\Views\SitemapViewRepository; use Illuminate\Contracts\View\View; use Symfony\Component\HttpKernel\Exception\HttpException; -class SitemapController extends Controller +final class SitemapController extends Controller { const TEMPLATE_SITEMAP_INDEX = 'sitemaps/default'; @@ -17,9 +18,10 @@ class SitemapController extends Controller /** Get the view for the app's sitemap. */ public function index(): View { - $sitemaps = (new SitemapsContentResource)->getItems(); - - return view(self::TEMPLATE_SITEMAP_INDEX, compact('sitemaps')); + return (new SitemapViewRepository)->getView( + self::TEMPLATE_SITEMAP_INDEX, + (new SitemapResource)->getItems() + ); } /** @@ -29,12 +31,11 @@ public function index(): View */ public function show(string $sitemap): View { - $matches = []; - if ($sitemap === 'pages') { - $items = (new SitemapPagesContentResource)->getItems(); - - return view(self::TEMPLATE_SITEMAP_ITEMS, compact('items')); + return (new SitemapViewRepository)->getView( + self::TEMPLATE_SITEMAP_ITEMS, + (new PagesSitemapResource)->getItems() + ); } abort(404); diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index d4ef6447..b97cdbc7 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -5,7 +5,7 @@ use Illuminate\Auth\Middleware\Authenticate as Middleware; use Illuminate\Http\Request; -class Authenticate extends Middleware +final class Authenticate extends Middleware { /** * Get the path the user should be redirected to when they are not authenticated. diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 867695bd..de133506 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -4,7 +4,7 @@ use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; -class EncryptCookies extends Middleware +final class EncryptCookies extends Middleware { /** * The names of the cookies that should not be encrypted. diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.php index 027d6bb2..6825a40a 100644 --- a/app/Http/Middleware/HandleInertiaRequests.php +++ b/app/Http/Middleware/HandleInertiaRequests.php @@ -6,7 +6,7 @@ use Inertia\Middleware; use Tightenco\Ziggy\Ziggy; -class HandleInertiaRequests extends Middleware +final class HandleInertiaRequests extends Middleware { /** * The root template that is loaded on the first page visit. diff --git a/app/Http/Middleware/PreventRequestsDuringMaintenance.php b/app/Http/Middleware/PreventRequestsDuringMaintenance.php index 74cbd9a9..7010c87f 100644 --- a/app/Http/Middleware/PreventRequestsDuringMaintenance.php +++ b/app/Http/Middleware/PreventRequestsDuringMaintenance.php @@ -4,7 +4,7 @@ use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware; -class PreventRequestsDuringMaintenance extends Middleware +final class PreventRequestsDuringMaintenance extends Middleware { /** * The URIs that should be reachable while maintenance mode is enabled. diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index afc78c4e..9786f9b0 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -8,12 +8,12 @@ use Illuminate\Support\Facades\Auth; use Symfony\Component\HttpFoundation\Response; -class RedirectIfAuthenticated +final class RedirectIfAuthenticated { /** * Handle an incoming request. * - * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next + * @param Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next */ public function handle(Request $request, Closure $next, string ...$guards): Response { diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php index 88cadcaa..b73503e9 100644 --- a/app/Http/Middleware/TrimStrings.php +++ b/app/Http/Middleware/TrimStrings.php @@ -4,7 +4,7 @@ use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; -class TrimStrings extends Middleware +final class TrimStrings extends Middleware { /** * The names of the attributes that should not be trimmed. diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php index c9c58bdd..f6b19710 100644 --- a/app/Http/Middleware/TrustHosts.php +++ b/app/Http/Middleware/TrustHosts.php @@ -4,7 +4,7 @@ use Illuminate\Http\Middleware\TrustHosts as Middleware; -class TrustHosts extends Middleware +final class TrustHosts extends Middleware { /** * Get the host patterns that should be trusted. diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 3391630e..83f49b5b 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -5,7 +5,7 @@ use Illuminate\Http\Middleware\TrustProxies as Middleware; use Illuminate\Http\Request; -class TrustProxies extends Middleware +final class TrustProxies extends Middleware { /** * The trusted proxies for this application. diff --git a/app/Http/Middleware/ValidateSignature.php b/app/Http/Middleware/ValidateSignature.php index 093bf64a..b3f0d8e2 100644 --- a/app/Http/Middleware/ValidateSignature.php +++ b/app/Http/Middleware/ValidateSignature.php @@ -4,7 +4,7 @@ use Illuminate\Routing\Middleware\ValidateSignature as Middleware; -class ValidateSignature extends Middleware +final class ValidateSignature extends Middleware { /** * The names of the query string parameters that should be ignored. diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 9e865217..d55320be 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -4,7 +4,7 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; -class VerifyCsrfToken extends Middleware +final class VerifyCsrfToken extends Middleware { /** * The URIs that should be excluded from CSRF verification. diff --git a/app/Http/Requests/Auth/LoginRequest.php b/app/Http/Requests/Auth/LoginRequest.php index e42ae32c..2f25a388 100644 --- a/app/Http/Requests/Auth/LoginRequest.php +++ b/app/Http/Requests/Auth/LoginRequest.php @@ -10,7 +10,7 @@ use Illuminate\Support\Str; use Illuminate\Validation\ValidationException; -class LoginRequest extends FormRequest implements RequestInterface +final class LoginRequest extends FormRequest implements RequestInterface { /** * Determine if the user is authorized to make this request. diff --git a/app/Http/Requests/Auth/PasswordResetLinkRequest.php b/app/Http/Requests/Auth/PasswordResetLinkRequest.php index 88d6dd63..8d9b332b 100644 --- a/app/Http/Requests/Auth/PasswordResetLinkRequest.php +++ b/app/Http/Requests/Auth/PasswordResetLinkRequest.php @@ -5,7 +5,7 @@ use App\Interfaces\Requests\RequestInterface; use Illuminate\Foundation\Http\FormRequest; -class PasswordResetLinkRequest extends FormRequest implements RequestInterface +final class PasswordResetLinkRequest extends FormRequest implements RequestInterface { /** * Get the validation rules that apply to the request. diff --git a/app/Http/Requests/Auth/PasswordUpdateForgottenRequest.php b/app/Http/Requests/Auth/PasswordUpdateForgottenRequest.php index e7cfc028..6e6506e0 100644 --- a/app/Http/Requests/Auth/PasswordUpdateForgottenRequest.php +++ b/app/Http/Requests/Auth/PasswordUpdateForgottenRequest.php @@ -5,7 +5,7 @@ use App\Interfaces\Requests\RequestInterface; use Illuminate\Foundation\Http\FormRequest; -class PasswordUpdateForgottenRequest extends FormRequest implements RequestInterface +final class PasswordUpdateForgottenRequest extends FormRequest implements RequestInterface { /** * Get the validation rules that apply to the request. diff --git a/app/Http/Requests/Auth/PasswordUpdateRequest.php b/app/Http/Requests/Auth/PasswordUpdateRequest.php index 6f345592..5447c6ae 100644 --- a/app/Http/Requests/Auth/PasswordUpdateRequest.php +++ b/app/Http/Requests/Auth/PasswordUpdateRequest.php @@ -5,7 +5,7 @@ use App\Interfaces\Requests\RequestInterface; use Illuminate\Foundation\Http\FormRequest; -class PasswordUpdateRequest extends FormRequest implements RequestInterface +final class PasswordUpdateRequest extends FormRequest implements RequestInterface { /** * Get the validation rules that apply to the request. diff --git a/app/Http/Requests/Auth/ProfileDeleteRequest.php b/app/Http/Requests/Auth/ProfileDeleteRequest.php index a6048808..a31487e2 100644 --- a/app/Http/Requests/Auth/ProfileDeleteRequest.php +++ b/app/Http/Requests/Auth/ProfileDeleteRequest.php @@ -5,7 +5,7 @@ use App\Interfaces\Requests\RequestInterface; use Illuminate\Foundation\Http\FormRequest; -class ProfileDeleteRequest extends FormRequest implements RequestInterface +final class ProfileDeleteRequest extends FormRequest implements RequestInterface { /** * Get the validation rules that apply to the request. diff --git a/app/Http/Requests/Auth/ProfileStoreRequest.php b/app/Http/Requests/Auth/ProfileStoreRequest.php index d9f4923a..345ae238 100644 --- a/app/Http/Requests/Auth/ProfileStoreRequest.php +++ b/app/Http/Requests/Auth/ProfileStoreRequest.php @@ -6,7 +6,7 @@ use App\Models\User; use Illuminate\Foundation\Http\FormRequest; -class ProfileStoreRequest extends FormRequest implements RequestInterface +final class ProfileStoreRequest extends FormRequest implements RequestInterface { /** * Get the validation rules that apply to the request. diff --git a/app/Http/Requests/Auth/ProfileUpdateRequest.php b/app/Http/Requests/Auth/ProfileUpdateRequest.php index f8e39468..22217b8a 100644 --- a/app/Http/Requests/Auth/ProfileUpdateRequest.php +++ b/app/Http/Requests/Auth/ProfileUpdateRequest.php @@ -7,7 +7,7 @@ use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; -class ProfileUpdateRequest extends FormRequest implements RequestInterface +final class ProfileUpdateRequest extends FormRequest implements RequestInterface { /** * Get the validation rules that apply to the request. diff --git a/app/Http/Resources/Files/LocalDiskFileResource.php b/app/Http/Resources/Files/LocalDiskFileResource.php index e2dbe1b6..4366f372 100644 --- a/app/Http/Resources/Files/LocalDiskFileResource.php +++ b/app/Http/Resources/Files/LocalDiskFileResource.php @@ -6,7 +6,7 @@ use Exception; use Illuminate\Support\Facades\Storage; -class LocalDiskFileResource implements StringsToStringStorableInterface +final class LocalDiskFileResource implements StringsToStringStorableInterface { /** * Get the content string of the given filepath if it exists or return the given diff --git a/app/Http/Resources/Models/NavbarModelResource.php b/app/Http/Resources/Models/NavbarModelResource.php index aa09f1ab..d9aae8ea 100644 --- a/app/Http/Resources/Models/NavbarModelResource.php +++ b/app/Http/Resources/Models/NavbarModelResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Readonlys\NavbarReadonlyInterface; use App\Models\Navbar; -class NavbarModelResource implements NavbarReadonlyInterface +final class NavbarModelResource implements NavbarReadonlyInterface { /** Instantiate the resource. */ public function __construct( diff --git a/app/Http/Resources/Models/UserModelResource.php b/app/Http/Resources/Models/UserModelResource.php index a0d117e6..949b0a92 100644 --- a/app/Http/Resources/Models/UserModelResource.php +++ b/app/Http/Resources/Models/UserModelResource.php @@ -6,7 +6,7 @@ use App\Interfaces\Resources\Storables\UserStorableInterface; use App\Models\User; -class UserModelResource implements UserStorableInterface +final class UserModelResource implements UserStorableInterface { /** Instantiate the resource. */ public function __construct( diff --git a/app/Http/Resources/Views/Auth/Metadata/DashboardMetadataResource.php b/app/Http/Resources/Views/Auth/Metadata/DashboardMetadataResource.php index 1f33096b..4bdb1cdd 100644 --- a/app/Http/Resources/Views/Auth/Metadata/DashboardMetadataResource.php +++ b/app/Http/Resources/Views/Auth/Metadata/DashboardMetadataResource.php @@ -4,7 +4,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; -class DashboardMetadataResource implements ConstantItemInterface +final class DashboardMetadataResource implements ConstantItemInterface { /** * Get the metadata array for the dashboard page. diff --git a/app/Http/Resources/Views/Auth/Metadata/EmailVerifyMetadataResource.php b/app/Http/Resources/Views/Auth/Metadata/EmailVerifyMetadataResource.php index c0df857d..832176b9 100644 --- a/app/Http/Resources/Views/Auth/Metadata/EmailVerifyMetadataResource.php +++ b/app/Http/Resources/Views/Auth/Metadata/EmailVerifyMetadataResource.php @@ -4,7 +4,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; -class EmailVerifyMetadataResource implements ConstantItemInterface +final class EmailVerifyMetadataResource implements ConstantItemInterface { /** * Get the metadata array for the email verification page. diff --git a/app/Http/Resources/Views/Auth/Metadata/LoginMetadataResource.php b/app/Http/Resources/Views/Auth/Metadata/LoginMetadataResource.php index 6cfe8045..1271e41a 100644 --- a/app/Http/Resources/Views/Auth/Metadata/LoginMetadataResource.php +++ b/app/Http/Resources/Views/Auth/Metadata/LoginMetadataResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; use Illuminate\Support\Facades\Route; -class LoginMetadataResource implements ConstantItemInterface +final class LoginMetadataResource implements ConstantItemInterface { /** * Get the metadata array for the login page. diff --git a/app/Http/Resources/Views/Auth/Metadata/PasswordConfirmMetadataResource.php b/app/Http/Resources/Views/Auth/Metadata/PasswordConfirmMetadataResource.php index d2d49c6c..3f4c2381 100644 --- a/app/Http/Resources/Views/Auth/Metadata/PasswordConfirmMetadataResource.php +++ b/app/Http/Resources/Views/Auth/Metadata/PasswordConfirmMetadataResource.php @@ -4,7 +4,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; -class PasswordConfirmMetadataResource implements ConstantItemInterface +final class PasswordConfirmMetadataResource implements ConstantItemInterface { /** * Get the metadata array for the password confirmation page. diff --git a/app/Http/Resources/Views/Auth/Metadata/PasswordForgotMetadataResource.php b/app/Http/Resources/Views/Auth/Metadata/PasswordForgotMetadataResource.php index 8dffb98d..efaa8289 100644 --- a/app/Http/Resources/Views/Auth/Metadata/PasswordForgotMetadataResource.php +++ b/app/Http/Resources/Views/Auth/Metadata/PasswordForgotMetadataResource.php @@ -4,7 +4,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; -class PasswordForgotMetadataResource implements ConstantItemInterface +final class PasswordForgotMetadataResource implements ConstantItemInterface { /** * Get the metadata array for the password reset token request page. diff --git a/app/Http/Resources/Views/Auth/Metadata/PasswordResetMetadataResource.php b/app/Http/Resources/Views/Auth/Metadata/PasswordResetMetadataResource.php index 8f0e143e..790083a3 100644 --- a/app/Http/Resources/Views/Auth/Metadata/PasswordResetMetadataResource.php +++ b/app/Http/Resources/Views/Auth/Metadata/PasswordResetMetadataResource.php @@ -4,7 +4,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; -class PasswordResetMetadataResource implements ConstantItemInterface +final class PasswordResetMetadataResource implements ConstantItemInterface { /** * Get the metadata array for the password reset page. diff --git a/app/Http/Resources/Views/Auth/Metadata/ProfileCreateMetadataResource.php b/app/Http/Resources/Views/Auth/Metadata/ProfileCreateMetadataResource.php index f889ad40..3ed6af75 100644 --- a/app/Http/Resources/Views/Auth/Metadata/ProfileCreateMetadataResource.php +++ b/app/Http/Resources/Views/Auth/Metadata/ProfileCreateMetadataResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; use Illuminate\Support\Facades\Route; -class ProfileCreateMetadataResource implements ConstantItemInterface +final class ProfileCreateMetadataResource implements ConstantItemInterface { /** * Get the metadata array for the user registration page. diff --git a/app/Http/Resources/Views/Auth/Metadata/ProfileEditMetadataResource.php b/app/Http/Resources/Views/Auth/Metadata/ProfileEditMetadataResource.php index 0dab8541..c00614b3 100644 --- a/app/Http/Resources/Views/Auth/Metadata/ProfileEditMetadataResource.php +++ b/app/Http/Resources/Views/Auth/Metadata/ProfileEditMetadataResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; use Illuminate\Contracts\Auth\MustVerifyEmail; -class ProfileEditMetadataResource implements ConstantItemInterface +final class ProfileEditMetadataResource implements ConstantItemInterface { /** * Get the metadata array for the edit profile page. diff --git a/app/Http/Resources/Views/Auth/Metadata/SessionMetadataResource.php b/app/Http/Resources/Views/Auth/Metadata/SessionMetadataResource.php index acaf3b82..a328b7f9 100644 --- a/app/Http/Resources/Views/Auth/Metadata/SessionMetadataResource.php +++ b/app/Http/Resources/Views/Auth/Metadata/SessionMetadataResource.php @@ -4,7 +4,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; -class SessionMetadataResource implements ConstantItemInterface +final class SessionMetadataResource implements ConstantItemInterface { /** * Get the metadata array for the session's status. diff --git a/app/Http/Resources/Views/Blocks/BlocksResource.php b/app/Http/Resources/Views/Blocks/BlocksResource.php index 3426de0f..d7f531d6 100644 --- a/app/Http/Resources/Views/Blocks/BlocksResource.php +++ b/app/Http/Resources/Views/Blocks/BlocksResource.php @@ -6,7 +6,7 @@ use App\Models\Block; use Illuminate\Support\Collection; -class BlocksResource implements CollectionIndexInterface +final class BlocksResource implements CollectionIndexInterface { /** * Get the content blocks array for the given block collections. diff --git a/app/Http/Resources/Views/Blocks/StackBlockResource.php b/app/Http/Resources/Views/Blocks/StackBlockResource.php index 1d078b7f..3dd0f32e 100644 --- a/app/Http/Resources/Views/Blocks/StackBlockResource.php +++ b/app/Http/Resources/Views/Blocks/StackBlockResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; use Illuminate\Foundation\Application; -class StackBlockResource implements ConstantItemInterface +final class StackBlockResource implements ConstantItemInterface { /** * Get the content array for the app's stack content block. diff --git a/app/Http/Resources/Views/DetailsViewResource.php b/app/Http/Resources/Views/DetailsViewResource.php index 096cfa91..24431469 100644 --- a/app/Http/Resources/Views/DetailsViewResource.php +++ b/app/Http/Resources/Views/DetailsViewResource.php @@ -4,7 +4,7 @@ use App\Interfaces\Resources\Items\ArraysToItemInterface; -class DetailsViewResource implements ArraysToItemInterface +final class DetailsViewResource implements ArraysToItemInterface { /** * Get the resource as an array. diff --git a/app/Http/Resources/Views/IndexViewResource.php b/app/Http/Resources/Views/IndexViewResource.php deleted file mode 100644 index d12fd8c5..00000000 --- a/app/Http/Resources/Views/IndexViewResource.php +++ /dev/null @@ -1,23 +0,0 @@ ->|string> $content - * @param array $metadata - * @return array> - */ - public function getItem(array $content, array $metadata): array - { - return [ - 'content' => $content, - 'metadata' => (new MetadataViewResource)->getItem($metadata), - ]; - } -} diff --git a/app/Http/Resources/Views/MetadataViewResource.php b/app/Http/Resources/Views/MetadataViewResource.php index 5d0fd3b1..fd4d9095 100644 --- a/app/Http/Resources/Views/MetadataViewResource.php +++ b/app/Http/Resources/Views/MetadataViewResource.php @@ -2,13 +2,13 @@ namespace App\Http\Resources\Views; -use App\Http\Resources\Views\Navbars\NavbarItemsMobileResource; -use App\Http\Resources\Views\Navbars\NavbarItemsResource; -use App\Http\Resources\Views\Public\Formatters\CopyrightMessageResource; +use App\Http\Resources\Views\Navbars\DesktopNavbarResource; +use App\Http\Resources\Views\Navbars\MobileNavbarResource; +use App\Http\Resources\Views\Public\Formatters\CopyrightFormatterResource; use App\Interfaces\Resources\Items\ArrayToItemInterface; use Illuminate\Support\Facades\Route; -class MetadataViewResource implements ArrayToItemInterface +final class MetadataViewResource implements ArrayToItemInterface { /** * Get a view metadata array for a view by combining the given metadata with the @@ -25,13 +25,13 @@ public function getItem(array $metadata): array 'canLogin' => Route::has('login'), 'canonical' => route('home'), 'canRegister' => Route::has('register'), - 'copyright' => (new CopyrightMessageResource)->getValue(), + 'copyright' => (new CopyrightFormatterResource)->getValue(), 'description' => config('metadata.description'), 'links' => [ 'github' => config('metadata.social_links.github'), ], - 'navbarItems' => (new NavbarItemsResource)->getItems(), - 'navbarItemsMobile' => (new NavbarItemsMobileResource)->getItems(), + 'navbarDesktop' => (new DesktopNavbarResource)->getItems(), + 'navbarMobile' => (new MobileNavbarResource)->getItems(), 'title' => config('app.name'), ]; diff --git a/app/Http/Resources/Views/Navbars/NavbarItemsResource.php b/app/Http/Resources/Views/Navbars/DesktopNavbarResource.php similarity index 78% rename from app/Http/Resources/Views/Navbars/NavbarItemsResource.php rename to app/Http/Resources/Views/Navbars/DesktopNavbarResource.php index b9c41c7f..efcd04b8 100644 --- a/app/Http/Resources/Views/Navbars/NavbarItemsResource.php +++ b/app/Http/Resources/Views/Navbars/DesktopNavbarResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Indexes\ConstantIndexInterface; use App\Models\Navbar; -class NavbarItemsResource implements ConstantIndexInterface +final class DesktopNavbarResource implements ConstantIndexInterface { /** * Get the items for the main public navbar. @@ -17,7 +17,7 @@ public function getItems(): array $navbar_items = Navbar::first()?->items ?? collect(); return $navbar_items - ->map(fn ($page) => (new NavbarItemLinksResource)->getItem($page)) + ->map(fn ($page) => (new ItemLinksNavbarResource)->getItem($page)) ->toArray(); } } diff --git a/app/Http/Resources/Views/Navbars/NavbarItemLinksResource.php b/app/Http/Resources/Views/Navbars/ItemLinksNavbarResource.php similarity index 93% rename from app/Http/Resources/Views/Navbars/NavbarItemLinksResource.php rename to app/Http/Resources/Views/Navbars/ItemLinksNavbarResource.php index 2d708b85..b97aee57 100644 --- a/app/Http/Resources/Views/Navbars/NavbarItemLinksResource.php +++ b/app/Http/Resources/Views/Navbars/ItemLinksNavbarResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Items\NavbarItemInterface; use App\Models\NavbarItem; -class NavbarItemLinksResource implements NavbarItemInterface +final class ItemLinksNavbarResource implements NavbarItemInterface { /** * Get the content array for the given page's public link. diff --git a/app/Http/Resources/Views/Navbars/NavbarItemsMobileResource.php b/app/Http/Resources/Views/Navbars/MobileNavbarResource.php similarity index 89% rename from app/Http/Resources/Views/Navbars/NavbarItemsMobileResource.php rename to app/Http/Resources/Views/Navbars/MobileNavbarResource.php index 5bf7b788..7b18ac45 100644 --- a/app/Http/Resources/Views/Navbars/NavbarItemsMobileResource.php +++ b/app/Http/Resources/Views/Navbars/MobileNavbarResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Indexes\ConstantIndexInterface; use App\Models\Navbar; -class NavbarItemsMobileResource implements ConstantIndexInterface +final class MobileNavbarResource implements ConstantIndexInterface { /** * Get the items for the main public navbar. @@ -16,7 +16,7 @@ public function getItems(): array { $navbar_items = Navbar::first()?->items ?? collect(); $navbar_items = $navbar_items - ->map(fn ($page) => (new NavbarItemLinksResource)->getItem($page)) + ->map(fn ($page) => (new ItemLinksNavbarResource)->getItem($page)) ->toArray(); $navbar_items_filtered = []; diff --git a/app/Http/Resources/Views/Public/Content/HomepageContentResource.php b/app/Http/Resources/Views/Public/Content/HomepageContentResource.php index f8705bb2..afc28ff0 100644 --- a/app/Http/Resources/Views/Public/Content/HomepageContentResource.php +++ b/app/Http/Resources/Views/Public/Content/HomepageContentResource.php @@ -6,7 +6,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; use App\Models\Page; -class HomepageContentResource implements ConstantItemInterface +final class HomepageContentResource implements ConstantItemInterface { /** * Get the content array for the site's homepage. diff --git a/app/Http/Resources/Views/Public/Content/PageContentResource.php b/app/Http/Resources/Views/Public/Content/PageContentResource.php index f8b503d8..b336e7d8 100644 --- a/app/Http/Resources/Views/Public/Content/PageContentResource.php +++ b/app/Http/Resources/Views/Public/Content/PageContentResource.php @@ -6,7 +6,7 @@ use App\Interfaces\Resources\Items\PageItemInterface; use App\Models\Page; -class PageContentResource implements PageItemInterface +final class PageContentResource implements PageItemInterface { /** * Get the content array for the given page's full public resource. diff --git a/app/Http/Resources/Views/Public/Formatters/CopyrightMessageResource.php b/app/Http/Resources/Views/Public/Formatters/CopyrightFormatterResource.php similarity index 78% rename from app/Http/Resources/Views/Public/Formatters/CopyrightMessageResource.php rename to app/Http/Resources/Views/Public/Formatters/CopyrightFormatterResource.php index f0b2d0a5..86cf6b93 100644 --- a/app/Http/Resources/Views/Public/Formatters/CopyrightMessageResource.php +++ b/app/Http/Resources/Views/Public/Formatters/CopyrightFormatterResource.php @@ -4,7 +4,7 @@ use App\Interfaces\Resources\Formatters\ConstantStringFormatterInterface; -class CopyrightMessageResource implements ConstantStringFormatterInterface +final class CopyrightFormatterResource implements ConstantStringFormatterInterface { /** Get the copyright message string for the site. */ public function getValue(): string diff --git a/app/Http/Resources/Views/Public/Metadata/PageMetadataResource.php b/app/Http/Resources/Views/Public/Metadata/PageMetadataResource.php index 244b51ad..ba9f5128 100644 --- a/app/Http/Resources/Views/Public/Metadata/PageMetadataResource.php +++ b/app/Http/Resources/Views/Public/Metadata/PageMetadataResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Items\PageItemInterface; use App\Models\Page; -class PageMetadataResource implements PageItemInterface +final class PageMetadataResource implements PageItemInterface { /** * Get the public view metadata array for the given page. diff --git a/app/Http/Resources/Views/Public/Summaries/PageSummaryResource.php b/app/Http/Resources/Views/Public/Summaries/PageSummaryResource.php index 29892a8e..aebc56aa 100644 --- a/app/Http/Resources/Views/Public/Summaries/PageSummaryResource.php +++ b/app/Http/Resources/Views/Public/Summaries/PageSummaryResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Items\PageItemInterface; use App\Models\Page; -class PageSummaryResource implements PageItemInterface +final class PageSummaryResource implements PageItemInterface { /** * Get the resource as an array. diff --git a/app/Http/Resources/Views/Sitemaps/SitemapHomepageContentResource.php b/app/Http/Resources/Views/Sitemaps/HomepageSitemapResource.php similarity index 88% rename from app/Http/Resources/Views/Sitemaps/SitemapHomepageContentResource.php rename to app/Http/Resources/Views/Sitemaps/HomepageSitemapResource.php index 2c904aeb..8bd12f4d 100644 --- a/app/Http/Resources/Views/Sitemaps/SitemapHomepageContentResource.php +++ b/app/Http/Resources/Views/Sitemaps/HomepageSitemapResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Items\ConstantItemInterface; use App\Models\Page; -class SitemapHomepageContentResource implements ConstantItemInterface +final class HomepageSitemapResource implements ConstantItemInterface { /** * Get the content array for the site homepage sitemap item. diff --git a/app/Http/Resources/Views/Sitemaps/SitemapPageContentResource.php b/app/Http/Resources/Views/Sitemaps/PageSitemapResource.php similarity index 91% rename from app/Http/Resources/Views/Sitemaps/SitemapPageContentResource.php rename to app/Http/Resources/Views/Sitemaps/PageSitemapResource.php index 967a50bb..de2355c1 100644 --- a/app/Http/Resources/Views/Sitemaps/SitemapPageContentResource.php +++ b/app/Http/Resources/Views/Sitemaps/PageSitemapResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Items\PageItemInterface; use App\Models\Page; -class SitemapPageContentResource implements PageItemInterface +final class PageSitemapResource implements PageItemInterface { /** * Get the content array for the given page's sitemap item. diff --git a/app/Http/Resources/Views/Sitemaps/SitemapPagesContentResource.php b/app/Http/Resources/Views/Sitemaps/PagesSitemapResource.php similarity index 69% rename from app/Http/Resources/Views/Sitemaps/SitemapPagesContentResource.php rename to app/Http/Resources/Views/Sitemaps/PagesSitemapResource.php index 98ad913b..c584f662 100644 --- a/app/Http/Resources/Views/Sitemaps/SitemapPagesContentResource.php +++ b/app/Http/Resources/Views/Sitemaps/PagesSitemapResource.php @@ -5,7 +5,7 @@ use App\Interfaces\Resources\Indexes\ConstantIndexInterface; use App\Models\Page; -class SitemapPagesContentResource implements ConstantIndexInterface +final class PagesSitemapResource implements ConstantIndexInterface { /** * Get the content array for the pages sitemap index resource. @@ -16,12 +16,12 @@ public function getItems(): array { return array_merge( [ - (new SitemapHomepageContentResource)->getItem(), + (new HomepageSitemapResource)->getItem(), ], Page::query() ->inSitemap() ->get() - ->map(fn ($page) => (new SitemapPageContentResource)->getItem($page)) + ->map(fn ($page) => (new PageSitemapResource)->getItem($page)) ->toArray(), ); } diff --git a/app/Http/Resources/Views/Sitemaps/SitemapsContentResource.php b/app/Http/Resources/Views/Sitemaps/SitemapResource.php similarity index 85% rename from app/Http/Resources/Views/Sitemaps/SitemapsContentResource.php rename to app/Http/Resources/Views/Sitemaps/SitemapResource.php index dd6e3e7f..0ef306b2 100644 --- a/app/Http/Resources/Views/Sitemaps/SitemapsContentResource.php +++ b/app/Http/Resources/Views/Sitemaps/SitemapResource.php @@ -4,7 +4,7 @@ use App\Interfaces\Resources\Indexes\ConstantIndexInterface; -class SitemapsContentResource implements ConstantIndexInterface +final class SitemapResource implements ConstantIndexInterface { /** * Get the content array for the sitemaps index resource. diff --git a/app/Models/Block.php b/app/Models/Block.php index ac8a8b5b..94fe5da8 100644 --- a/app/Models/Block.php +++ b/app/Models/Block.php @@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; -class Block extends Model +final class Block extends Model { use HasFactory, SoftDeletes; diff --git a/app/Models/Navbar.php b/app/Models/Navbar.php index f3885a68..3a949da0 100644 --- a/app/Models/Navbar.php +++ b/app/Models/Navbar.php @@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; -class Navbar extends Model +final class Navbar extends Model { use HasFactory, SoftDeletes; diff --git a/app/Models/NavbarItem.php b/app/Models/NavbarItem.php index a7953130..54e35f37 100644 --- a/app/Models/NavbarItem.php +++ b/app/Models/NavbarItem.php @@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; -class NavbarItem extends Model +final class NavbarItem extends Model { use HasFactory, SoftDeletes; diff --git a/app/Models/Page.php b/app/Models/Page.php index 7aed62c0..0ab5e434 100644 --- a/app/Models/Page.php +++ b/app/Models/Page.php @@ -14,7 +14,7 @@ * @method Builder|static inSitemap() * @method static Builder|static query() */ -class Page extends Model +final class Page extends Model { use HasFactory, HasPageView, diff --git a/app/Models/User.php b/app/Models/User.php index 6c834849..f1293f10 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -10,7 +10,7 @@ use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; -class User extends Authenticatable implements MustVerifyEmail +final class User extends Authenticatable implements MustVerifyEmail { use HasApiTokens, HasFactory, diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 9d9140ae..8a08d882 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -4,7 +4,7 @@ use Illuminate\Support\ServiceProvider; -class AppServiceProvider extends ServiceProvider +final class AppServiceProvider extends ServiceProvider { /** * Register any application services. diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 54756cd1..794d8c7c 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -5,7 +5,7 @@ // use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; -class AuthServiceProvider extends ServiceProvider +final class AuthServiceProvider extends ServiceProvider { /** * The model to policy mappings for the application. diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 2be04f5d..acce4faf 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -5,7 +5,7 @@ use Illuminate\Support\Facades\Broadcast; use Illuminate\Support\ServiceProvider; -class BroadcastServiceProvider extends ServiceProvider +final class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. diff --git a/app/Providers/DuskServiceProvider.php b/app/Providers/DuskServiceProvider.php index 887285c8..ff649e57 100644 --- a/app/Providers/DuskServiceProvider.php +++ b/app/Providers/DuskServiceProvider.php @@ -6,7 +6,7 @@ use Illuminate\Support\ServiceProvider; use Laravel\Dusk\Browser; -class DuskServiceProvider extends ServiceProvider implements DeferrableProvider +final class DuskServiceProvider extends ServiceProvider implements DeferrableProvider { /** Register Dusk's browser macros. */ public function boot(): void diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 2d65aac0..2f084a5a 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -7,7 +7,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Event; -class EventServiceProvider extends ServiceProvider +final class EventServiceProvider extends ServiceProvider { /** * The event to listener mappings for the application. diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 025e8743..796d4be2 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -8,7 +8,7 @@ use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider +final class RouteServiceProvider extends ServiceProvider { /** * The path to your application's "home" route. diff --git a/app/Repositories/Views/AuthViewRepository.php b/app/Repositories/Views/AuthViewRepository.php index 37c1efa7..6b92839f 100644 --- a/app/Repositories/Views/AuthViewRepository.php +++ b/app/Repositories/Views/AuthViewRepository.php @@ -6,7 +6,7 @@ use Inertia\Inertia; use Inertia\Response; -class AuthViewRepository +final class AuthViewRepository { /** * Render the given template after injecting the given data arrays. diff --git a/app/Repositories/Views/PublicViewRepository.php b/app/Repositories/Views/PublicViewRepository.php index f315f1ee..d063bacb 100644 --- a/app/Repositories/Views/PublicViewRepository.php +++ b/app/Repositories/Views/PublicViewRepository.php @@ -6,7 +6,7 @@ use Inertia\Inertia; use Inertia\Response; -class PublicViewRepository +final class PublicViewRepository { /** * Render the given template after injecting the given data arrays. diff --git a/app/Repositories/Views/SitemapViewRepository.php b/app/Repositories/Views/SitemapViewRepository.php new file mode 100644 index 00000000..154900b9 --- /dev/null +++ b/app/Repositories/Views/SitemapViewRepository.php @@ -0,0 +1,18 @@ +|string> $items = [] + */ + public function getView(string $template, array $items = []): View + { + return view($template, compact('items')); + } +} diff --git a/app/Services/LogoutService.php b/app/Services/LogoutService.php index 7e3e84e7..566ae693 100644 --- a/app/Services/LogoutService.php +++ b/app/Services/LogoutService.php @@ -4,7 +4,7 @@ use Illuminate\Http\RedirectResponse; -class LogoutService +final class LogoutService { /** Destroy an authenticated session. */ public static function logout(): RedirectResponse diff --git a/database/factories/BlockFactory.php b/database/factories/BlockFactory.php index e4eb465e..cc678008 100644 --- a/database/factories/BlockFactory.php +++ b/database/factories/BlockFactory.php @@ -8,7 +8,7 @@ /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Block> */ -class BlockFactory extends Factory +final class BlockFactory extends Factory { /** * Define the model's default state. diff --git a/database/factories/NavbarFactory.php b/database/factories/NavbarFactory.php index c08dada9..a956677b 100644 --- a/database/factories/NavbarFactory.php +++ b/database/factories/NavbarFactory.php @@ -7,7 +7,7 @@ /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Navbar> */ -class NavbarFactory extends Factory +final class NavbarFactory extends Factory { /** * Define the model's default state. diff --git a/database/factories/NavbarItemFactory.php b/database/factories/NavbarItemFactory.php index d2fd9ff6..bc8cb033 100644 --- a/database/factories/NavbarItemFactory.php +++ b/database/factories/NavbarItemFactory.php @@ -9,7 +9,7 @@ /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\NavbarItem> */ -class NavbarItemFactory extends Factory +final class NavbarItemFactory extends Factory { /** * Define the model's default state. diff --git a/database/factories/PageFactory.php b/database/factories/PageFactory.php index e2dc6d3a..1c2c9c69 100644 --- a/database/factories/PageFactory.php +++ b/database/factories/PageFactory.php @@ -7,7 +7,7 @@ /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Page> */ -class PageFactory extends Factory +final class PageFactory extends Factory { /** * Define the model's default state. diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index d9f924bc..43e9ecac 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -8,7 +8,7 @@ /** * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User> */ -class UserFactory extends Factory +final class UserFactory extends Factory { protected static ?string $password; @@ -23,7 +23,7 @@ public function definition(): array 'name' => fake()->name(), 'email' => fake()->unique()->safeEmail(), 'email_verified_at' => now(), - 'password' => static::$password ??= bcrypt(config('tests.default_password')), + 'password' => self::$password ??= bcrypt(config('tests.default_password')), 'remember_token' => Str::random(10), ]; } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 8b327517..d3263983 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -4,7 +4,7 @@ use Illuminate\Database\Seeder; -class DatabaseSeeder extends Seeder +final class DatabaseSeeder extends Seeder { /** Seed the application's database. */ public function run(): void diff --git a/database/seeders/NavbarSeeder.php b/database/seeders/NavbarSeeder.php index 0d0e5d96..d398f5b1 100644 --- a/database/seeders/NavbarSeeder.php +++ b/database/seeders/NavbarSeeder.php @@ -8,7 +8,7 @@ use Illuminate\Database\Seeder; use Illuminate\Support\Facades\Log; -class NavbarSeeder extends Seeder +final class NavbarSeeder extends Seeder { /** Run the database seeds. */ public function run(): void diff --git a/database/seeders/PageSeeder.php b/database/seeders/PageSeeder.php index 8128d035..360af21f 100644 --- a/database/seeders/PageSeeder.php +++ b/database/seeders/PageSeeder.php @@ -8,7 +8,7 @@ use Illuminate\Database\Seeder; use Illuminate\Support\Facades\Log; -class PageSeeder extends Seeder +final class PageSeeder extends Seeder { /** Run the database seeds. */ public function run(): void diff --git a/database/seeders/UserSeeder.php b/database/seeders/UserSeeder.php index b4abe664..8b532486 100644 --- a/database/seeders/UserSeeder.php +++ b/database/seeders/UserSeeder.php @@ -5,7 +5,7 @@ use App\Models\User; use Illuminate\Database\Seeder; -class UserSeeder extends Seeder +final class UserSeeder extends Seeder { /** Run the database seeds. */ public function run(): void diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 4469a451..a2bfcae4 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -8,7 +8,6 @@ parameters: - config/ - database/ - routes/ - # - storage/app/stubs/ - tests/ # Level 9 is the highest level @@ -17,7 +16,10 @@ parameters: ignoreErrors: excludePaths: - - tests/ # 40 errors 2023-12-04 + - tests/Browser # 16 errors 2024-03-16, all `Call to an undefined method Laravel\Dusk\Browser::` + - tests/Feature # 252 errors 2024-03-16 + - tests/Pest # 32 errors 2024-03-16 + - tests/Unit # 150 errors 2024-03-16 - app/Providers/DuskServiceProvider.php # 8 errors 2024-02-01, all `Call to an undefined method App\Providers\DuskServiceProvider::` checkGenericClassInNonGenericObjectType: false diff --git a/pint.json b/pint.json index 276d8757..e808fc4c 100644 --- a/pint.json +++ b/pint.json @@ -1,13 +1,51 @@ { "preset": "laravel", "rules": { + "array_push": true, + "backtick_to_shell_exec": true, "concat_space": { "spacing": "one" }, - "not_operator_with_successor_space": false + "final_class": true, + "fully_qualified_strict_types": true, + "global_namespace_import": { + "import_classes": true, + "import_constants": true, + "import_functions": true + }, + "not_operator_with_successor_space": false, + "ordered_class_elements": { + "order": [ + "use_trait", + "case", + "constant", + "constant_public", + "constant_protected", + "constant_private", + "property_public", + "property_protected", + "property_private", + "construct", + "destruct", + "magic", + "phpunit", + "method_abstract", + "method_public_static", + "method_public", + "method_protected_static", + "method_protected", + "method_private_static", + "method_private" + ], + "sort_algorithm": "none" + }, + "ordered_interfaces": true, + "ordered_traits": true, + "protected_to_private": true }, "notPath": [ "app/Console/Kernel.php", + "app/Exceptions/Handler.php", "app/Http/Kernel.php", "config/app.php", "config/broadcasting.php", diff --git a/resources/js/Components/Controls/Navbars/NavbarDesktopItems.vue b/resources/js/Components/Controls/Navbars/NavbarDesktopItems.vue index 8f48d5ee..c3dc4cf3 100644 --- a/resources/js/Components/Controls/Navbars/NavbarDesktopItems.vue +++ b/resources/js/Components/Controls/Navbars/NavbarDesktopItems.vue @@ -4,7 +4,7 @@ import NavbarDesktopItem from '@/Components/Controls/Navbars/NavbarDesktopItem.v