Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jlbelanger committed Dec 24, 2023
1 parent 1bc7cb0 commit 885cd30
Show file tree
Hide file tree
Showing 69 changed files with 4,224 additions and 3,385 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 1
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ THROTTLE_MAX_ATTEMPTS=6
ADMIN_URL=http://localhost:3000/admin

LOG_CHANNEL=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_DEPRECATIONS_CHANNEL=single
LOG_LEVEL=debug
LOG_DATABASE_QUERIES=false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.2'
- uses: actions/checkout@v3
- run: composer install
- run: ./vendor/bin/phpcs
Expand Down
11 changes: 6 additions & 5 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
{
"extends": "stylelint-config-standard-scss",
"plugins": [
"stylelint-order"
"stylelint-order",
"stylelint-stylistic"
],
"rules": {
"declaration-no-important": true,
"indentation": "tab",
"max-line-length": 150,
"no-descending-specificity": null,
"number-leading-zero": "never",
"order/properties-alphabetical-order": true,
"scss/dollar-variable-empty-line-before": null,
"scss/dollar-variable-pattern": null,
"scss/no-global-function-names": null,
"selector-class-pattern": "[a-z0-9_-]+",
"selector-id-pattern": "[a-z0-9_-]+",
"string-quotes": "single"
"stylistic/indentation": "tab",
"stylistic/max-line-length": 150,
"stylistic/number-leading-zero": "never",
"stylistic/string-quotes": "single"
}
}
4 changes: 2 additions & 2 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Kernel extends ConsoleKernel
* @param Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
protected function schedule(Schedule $schedule) : void
{
}

Expand All @@ -31,7 +31,7 @@ protected function schedule(Schedule $schedule)
*
* @return void
*/
protected function commands()
protected function commands() : void
{
$this->load(__DIR__ . '/Commands');

Expand Down
11 changes: 6 additions & 5 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Handler extends ExceptionHandler
protected $dontReport = [JsonApiException::class];

/**
* A list of the inputs that are never flashed for validation exceptions.
* The list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
Expand All @@ -38,9 +38,10 @@ class Handler extends ExceptionHandler
*
* @return void
*/
public function register() // phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh
// phpcs:ignore Generic.Metrics.CyclomaticComplexity.TooHigh
public function register() : void
{
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
$this->renderable(function (InvalidSignatureException $e) {
if (request()->expectsJson()) {
if (!url()->signatureHasNotExpired(request())) {
Expand All @@ -50,7 +51,7 @@ public function register() // phpcs:ignore Generic.Metrics.CyclomaticComplexity.
}
});

// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
$this->renderable(function (MethodNotAllowedHttpException $e) {
if (request()->expectsJson()) {
return response()->json(['errors' => [['title' => 'URL does not exist.', 'status' => '404', 'detail' => 'Method not allowed.']]], 404);
Expand All @@ -65,7 +66,7 @@ public function register() // phpcs:ignore Generic.Metrics.CyclomaticComplexity.
return response()->view('errors.404', [], 404);
});

$this->renderable(function (ThrottleRequestsException $e) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
$this->renderable(function (ThrottleRequestsException $e) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
if (request()->expectsJson()) {
return response()->json(['errors' => [['title' => 'Please wait before retrying.', 'status' => '429']]], 429);
}
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests, ValidatesRequests;
}
12 changes: 7 additions & 5 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Kernel extends HttpKernel
*/
protected $middleware = [
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
Expand Down Expand Up @@ -44,20 +44,22 @@ class Kernel extends HttpKernel
];

/**
* The application's route middleware.
* The application's middleware aliases.
*
* These middleware may be assigned to groups or used individually.
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
*
* @var array<string, class-string|string>
*/
protected $routeMiddleware = [
protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
'signed' => \App\Http\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
Expand Down
20 changes: 7 additions & 13 deletions app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,22 @@

namespace App\Http\Middleware;

use Closure;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Jlbelanger\Tapioca\Exceptions\JsonApiException;

class Authenticate extends Middleware
{
/**
* Handles an incoming request.
* Handles an unauthenticated user.
*
* @param Request $request
* @param Closure $next
* @param string|null $guard
* @return mixed
* @param Request $request
* @param array $guards
* @return void
*/
public function handle(Request $request, Closure $next, $guard = null)
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed, Squiz.Commenting.FunctionComment.TypeHintMissing
protected function unauthenticated($request, array $guards)
{
if (!Auth::guard($guard)->check()) {
throw JsonApiException::generate([['title' => 'You are not logged in.', 'status' => '401']], 401);
}

return $next($request);
throw JsonApiException::generate([['title' => 'You are not logged in.', 'status' => '401']], 401);
}
}
5 changes: 3 additions & 2 deletions app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;

class RedirectIfAuthenticated
{
Expand All @@ -15,9 +16,9 @@ class RedirectIfAuthenticated
* @param Request $request
* @param Closure $next
* @param string|null ...$guards
* @return Response|RedirectResponse
* @return Response
*/
public function handle(Request $request, Closure $next, ...$guards)
public function handle(Request $request, Closure $next, string ...$guards) : Response
{
$guards = empty($guards) ? [null] : $guards;

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 @@ -11,7 +11,7 @@ class TrustHosts extends Middleware
*
* @return array<int, string|null>
*/
public function hosts()
public function hosts() : array
{
return [
$this->allSubdomainsOfApplicationUrl(),
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 @@ -19,5 +19,5 @@ class TrustProxies extends Middleware
*
* @var integer
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
protected $headers = Request::HEADER_X_FORWARDED_FOR;
}
15 changes: 15 additions & 0 deletions app/Http/Middleware/ValidateSignature.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Routing\Middleware\ValidateSignature as Middleware;

class ValidateSignature extends Middleware
{
/**
* The names of the query string parameters that should be ignored.
*
* @var array<int, string>
*/
protected $except = [];
}
10 changes: 10 additions & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,22 @@ class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable, Resource;

/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'username',
'email',
'password',
];

/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
Expand Down
4 changes: 2 additions & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AppServiceProvider extends ServiceProvider
*
* @return void
*/
public function register()
public function register() : void
{
}

Expand All @@ -26,7 +26,7 @@ public function register()
* @param Kernel $kernel
* @return void
*/
public function boot(Kernel $kernel)
public function boot(Kernel $kernel) : void
{
if (config('app.debug')) {
if (config('logging.database')) {
Expand Down
8 changes: 4 additions & 4 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
Expand All @@ -25,11 +25,11 @@ class AuthServiceProvider extends ServiceProvider
*
* @return void
*/
public function boot()
public function boot() : void
{
$this->registerPolicies();

// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
ResetPassword::toMailUsing(function ($notifiable, $token) {
$url = config('app.admin_url') . str_replace('/api/auth/', '/', URL::temporarySignedRoute(
'password.update',
Expand All @@ -45,7 +45,7 @@ public function boot()
->line('If you did not request a password reset, no further action is required.');
});

// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
VerifyEmail::toMailUsing(function ($notifiable, $url) {
return (new MailMessage)
->subject('[' . config('app.name') . '] Verify Email Address')
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/BroadcastServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BroadcastServiceProvider extends ServiceProvider
*
* @return void
*/
public function boot()
public function boot() : void
{
Broadcast::routes();

Expand Down
4 changes: 2 additions & 2 deletions app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
* The event to listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
Expand All @@ -24,7 +24,7 @@ class EventServiceProvider extends ServiceProvider
*
* @return void
*/
public function boot()
public function boot() : void
{
}
}
Loading

0 comments on commit 885cd30

Please sign in to comment.