Skip to content

Commit

Permalink
Merge pull request #20 from musimana/feature/BASS-47_AppReview
Browse files Browse the repository at this point in the history
feature/BASS-47 | App Review
  • Loading branch information
musimana authored Mar 16, 2024
2 parents 02640a9 + 2ae19c7 commit 3d70c3f
Show file tree
Hide file tree
Showing 151 changed files with 343 additions and 445 deletions.
4 changes: 2 additions & 2 deletions app/Console/Commands/AppCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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
{
Expand Down
8 changes: 4 additions & 4 deletions app/Console/Commands/Seeds/SeedUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, array<int, string>> */
private array $table_data = [];

/**
* The name and signature of the console command.
*
Expand All @@ -27,6 +24,9 @@ class SeedUsers extends AppCommand
*/
protected $description = 'Seed the users table with the specified number of records';

/** @var array<int, array<int, string>> */
private array $table_data = [];

/** Execute the console command. */
public function handle(): int
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/EmailVerificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/PasswordForgottenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/ProfilePasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Public/HomepageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Public/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 12 additions & 11 deletions app/Http/Controllers/Public/SitemapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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()
);
}

/**
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/EncryptCookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/PreventRequestsDuringMaintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/TrimStrings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/TrustHosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/ValidateSignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/VerifyCsrfToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Auth/LoginRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Auth/PasswordResetLinkRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Auth/PasswordUpdateForgottenRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Auth/PasswordUpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Auth/ProfileDeleteRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Auth/ProfileStoreRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Auth/ProfileUpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/Files/LocalDiskFileResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/Models/NavbarModelResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Resources/Models/UserModelResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 3d70c3f

Please sign in to comment.