diff --git a/app/Console/Commands/MediaMigrate.php b/app/Console/Commands/MediaMigrate.php index 2df0e40..3e8abe2 100644 --- a/app/Console/Commands/MediaMigrate.php +++ b/app/Console/Commands/MediaMigrate.php @@ -45,7 +45,7 @@ class MediaMigrate extends Command * * @return void */ - public function handle() + public function handle(): void { $replace = $this->option('replace'); diff --git a/app/Console/Commands/MediaRebuild.php b/app/Console/Commands/MediaRebuild.php index a60d64a..fdc0d8a 100644 --- a/app/Console/Commands/MediaRebuild.php +++ b/app/Console/Commands/MediaRebuild.php @@ -51,7 +51,7 @@ class MediaRebuild extends Command * * @return void */ - public function handle() + public function handle(): void { $replace = $this->option('replace'); $all = $this->option('replace'); diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index c040de1..9169768 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel * @param \Illuminate\Console\Scheduling\Schedule $schedule The schedule. * @return void */ - protected function schedule(Schedule $schedule) + protected function schedule(Schedule $schedule): void { // $schedule->command('inspire')->hourly(); } @@ -23,7 +23,7 @@ class Kernel extends ConsoleKernel * * @return void */ - protected function commands() + protected function commands(): void { $this->load(__DIR__ . '/Commands'); diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 487dcc8..72e8d38 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -29,7 +29,7 @@ class Handler extends ExceptionHandler * * @return void */ - public function register() + public function register(): void { // $this->renderable(function (HttpException $e, $request) { // if ($request->is('api/*')) { diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index 3bb5a9e..ce91e84 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -12,7 +12,7 @@ class Authenticate extends Middleware * @param mixed $request Request. * @return string|null */ - protected function redirectTo(mixed $request) + protected function redirectTo(mixed $request): ?string { if ($request->expectsJson() === false) { return route('login'); diff --git a/app/Http/Middleware/ForceJsonResponse.php b/app/Http/Middleware/ForceJsonResponse.php index 3311198..efec056 100644 --- a/app/Http/Middleware/ForceJsonResponse.php +++ b/app/Http/Middleware/ForceJsonResponse.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; use Closure; use Illuminate\Http\Request; @@ -14,7 +15,7 @@ class ForceJsonResponse * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ - public function handle(Request $request, Closure $next) + public function handle(Request $request, Closure $next): Response { $request->headers->set('Accept', 'application/json'); return $next($request); diff --git a/app/Http/Middleware/LogRequest.php b/app/Http/Middleware/LogRequest.php index 1ecc38f..6bce316 100644 --- a/app/Http/Middleware/LogRequest.php +++ b/app/Http/Middleware/LogRequest.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; use Closure; use Illuminate\Http\Request; use App\Models\Analytics; @@ -15,7 +16,7 @@ class LogRequest * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ - public function handle(Request $request, Closure $next) + public function handle(Request $request, Closure $next): Response { // Make it an after middleware $response = $next($request); diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index e51f28c..34029f7 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; use App\Providers\RouteServiceProvider; use Closure; use Illuminate\Http\Request; @@ -17,7 +18,7 @@ class RedirectIfAuthenticated * @param string|null ...$guards Guards. * @return Response|RedirectResponse */ - public function handle(Request $request, Closure $next, ...$guards) + public function handle(Request $request, Closure $next, string ...$guards): Response { $guards = empty($guards) === true ? [null] : $guards; diff --git a/app/Http/Middleware/UseSanctumGuard.php b/app/Http/Middleware/UseSanctumGuard.php index 4e4e62d..3b00b9b 100644 --- a/app/Http/Middleware/UseSanctumGuard.php +++ b/app/Http/Middleware/UseSanctumGuard.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware; +use Symfony\Component\HttpFoundation\Response; use Closure; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -15,7 +16,7 @@ class UseSanctumGuard * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse */ - public function handle(Request $request, Closure $next) + public function handle(Request $request, Closure $next): Response { Auth::shouldUse('sanctum'); return $next($request); diff --git a/app/Http/Requests/AuthLoginRequest.php b/app/Http/Requests/AuthLoginRequest.php index 12baa20..f450276 100644 --- a/app/Http/Requests/AuthLoginRequest.php +++ b/app/Http/Requests/AuthLoginRequest.php @@ -11,7 +11,7 @@ class AuthLoginRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return [ 'email' => 'required|string|min:6|max:255', diff --git a/app/Http/Requests/BaseRequest.php b/app/Http/Requests/BaseRequest.php index 8f0ab5d..3934a1b 100644 --- a/app/Http/Requests/BaseRequest.php +++ b/app/Http/Requests/BaseRequest.php @@ -12,7 +12,7 @@ class BaseRequest extends FormRequest * * @return boolean */ - public function authorize() + public function authorize(): bool { if (request()->isMethod('post') === true && method_exists($this, 'postAuthorize') === true) { return $this->postAuthorize(); @@ -30,7 +30,7 @@ class BaseRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { $rules = []; diff --git a/app/Http/Requests/ContactSendRequest.php b/app/Http/Requests/ContactSendRequest.php index 5e24452..fc9881e 100644 --- a/app/Http/Requests/ContactSendRequest.php +++ b/app/Http/Requests/ContactSendRequest.php @@ -12,7 +12,7 @@ class ContactSendRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return [ 'name' => 'required|max:255', diff --git a/app/Http/Requests/SubscriptionRequest.php b/app/Http/Requests/SubscriptionRequest.php index 8a02433..88a5a3d 100644 --- a/app/Http/Requests/SubscriptionRequest.php +++ b/app/Http/Requests/SubscriptionRequest.php @@ -37,7 +37,7 @@ class SubscriptionRequest extends BaseRequest * * @return array */ - public function messages() + public function messages(): array { return [ 'email.unique' => 'This email address has already subscribed', diff --git a/app/Http/Requests/UserForgotPasswordRequest.php b/app/Http/Requests/UserForgotPasswordRequest.php index eaf6ccf..c45d56f 100644 --- a/app/Http/Requests/UserForgotPasswordRequest.php +++ b/app/Http/Requests/UserForgotPasswordRequest.php @@ -12,7 +12,7 @@ class UserForgotPasswordRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return [ 'email' => 'required|exists:users,email', diff --git a/app/Http/Requests/UserRegisterRequest.php b/app/Http/Requests/UserRegisterRequest.php index 73148fc..5557663 100644 --- a/app/Http/Requests/UserRegisterRequest.php +++ b/app/Http/Requests/UserRegisterRequest.php @@ -12,7 +12,7 @@ class UserRegisterRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return [ 'display_name' => ['required','string','max:255', new Uniqueish('users')], diff --git a/app/Http/Requests/UserResendVerifyEmailRequest.php b/app/Http/Requests/UserResendVerifyEmailRequest.php index 92d34b2..09e6442 100644 --- a/app/Http/Requests/UserResendVerifyEmailRequest.php +++ b/app/Http/Requests/UserResendVerifyEmailRequest.php @@ -12,7 +12,7 @@ class UserResendVerifyEmailRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return [ 'email' => 'required|exists:users,email', diff --git a/app/Http/Requests/UserResetPasswordRequest.php b/app/Http/Requests/UserResetPasswordRequest.php index 99ed434..55141e5 100644 --- a/app/Http/Requests/UserResetPasswordRequest.php +++ b/app/Http/Requests/UserResetPasswordRequest.php @@ -12,7 +12,7 @@ class UserResetPasswordRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return [ 'code' => 'required|digits:6', diff --git a/app/Http/Requests/UserVerifyEmailRequest.php b/app/Http/Requests/UserVerifyEmailRequest.php index e2473e7..29c017e 100644 --- a/app/Http/Requests/UserVerifyEmailRequest.php +++ b/app/Http/Requests/UserVerifyEmailRequest.php @@ -12,7 +12,7 @@ class UserVerifyEmailRequest extends FormRequest * * @return array */ - public function rules() + public function rules(): array { return [ 'code' => 'required|digits:6', diff --git a/app/Jobs/MoveMediaJob.php b/app/Jobs/MoveMediaJob.php index afb4c04..9221cd7 100644 --- a/app/Jobs/MoveMediaJob.php +++ b/app/Jobs/MoveMediaJob.php @@ -51,7 +51,7 @@ class MoveMediaJob implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { // Don't continue if the media is already on the new storage disk if ($this->media->storage === $this->newStorage) { diff --git a/app/Jobs/SendEmailJob.php b/app/Jobs/SendEmailJob.php index 8b045f8..89d7d1f 100644 --- a/app/Jobs/SendEmailJob.php +++ b/app/Jobs/SendEmailJob.php @@ -50,7 +50,7 @@ class SendEmailJob implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { Mail::to($this->to)->send($this->mailable); } diff --git a/app/Jobs/StoreUploadedFileJob.php b/app/Jobs/StoreUploadedFileJob.php index b6ffa26..632bab9 100644 --- a/app/Jobs/StoreUploadedFileJob.php +++ b/app/Jobs/StoreUploadedFileJob.php @@ -65,7 +65,7 @@ class StoreUploadedFileJob implements ShouldQueue * * @return void */ - public function handle() + public function handle(): void { $storageDisk = $this->media->storage; $fileName = $this->media->name; diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 62c01a6..6478350 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -19,7 +19,7 @@ class AppServiceProvider extends ServiceProvider * * @return void */ - public function register() + public function register(): void { // } @@ -29,7 +29,7 @@ class AppServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { Storage::macro('public', function ($diskName) { $public = config("filesystems.disks.{$diskName}.public", false); diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index da2295b..1f84312 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -22,7 +22,7 @@ class AuthServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { // } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 85a5b87..95217e4 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -29,7 +29,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { // } @@ -39,7 +39,7 @@ class EventServiceProvider extends ServiceProvider * * @return boolean */ - public function shouldDiscoverEvents() + public function shouldDiscoverEvents(): bool { return false; } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 85b20a8..8c77119 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -26,7 +26,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - public function boot() + public function boot(): void { // RateLimiter::for('api', function (Request $request) { // return Limit::perMinute(60)->by($request->user()?->id !== null ?: $request->ip()); diff --git a/database/factories/ArticleFactory.php b/database/factories/ArticleFactory.php index d6e656e..3fc95a9 100644 --- a/database/factories/ArticleFactory.php +++ b/database/factories/ArticleFactory.php @@ -15,7 +15,7 @@ class ArticleFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { $publishDate = Carbon::parse($this->faker->dateTimeBetween('-1 month', '+1 month')); diff --git a/database/factories/EventFactory.php b/database/factories/EventFactory.php index 19e4d39..285ca45 100644 --- a/database/factories/EventFactory.php +++ b/database/factories/EventFactory.php @@ -15,7 +15,7 @@ class EventFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { $startDate = Carbon::parse($this->faker->dateTimeBetween('now', '+1 year')); $endDate = Carbon::parse($this->faker->dateTimeBetween($startDate, '+1 year')); diff --git a/database/factories/MediaFactory.php b/database/factories/MediaFactory.php index e1b52d0..e896c4a 100644 --- a/database/factories/MediaFactory.php +++ b/database/factories/MediaFactory.php @@ -15,7 +15,7 @@ class MediaFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { return [ 'title' => $this->faker->sentence(), diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index c4e7f11..4d016d1 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -15,7 +15,7 @@ class UserFactory extends Factory * * @return array */ - public function definition() + public function definition(): array { $faker = \Faker\Factory::create(); $faker->addProvider(new \Faker\Provider\CustomInternetProvider($faker)); diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 03d1d84..2701125 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('users', function (Blueprint $table) { $table->uuid('id')->primary(); @@ -33,7 +33,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('users'); } diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php index fcacb80..b4d45de 100644 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ b/database/migrations/2014_10_12_100000_create_password_resets_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('password_resets', function (Blueprint $table) { $table->string('email')->index(); @@ -25,7 +25,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('password_resets'); } diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php index 1719198..db96e7d 100644 --- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('failed_jobs', function (Blueprint $table) { $table->id(); @@ -29,7 +29,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('failed_jobs'); } diff --git a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php index 9207c18..c134bc5 100644 --- a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php +++ b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('personal_access_tokens', function (Blueprint $table) { $table->id(); @@ -30,7 +30,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('personal_access_tokens'); } diff --git a/database/migrations/2022_12_28_113117_create_posts_table.php b/database/migrations/2022_12_28_113117_create_posts_table.php index 1890220..f4fbc61 100644 --- a/database/migrations/2022_12_28_113117_create_posts_table.php +++ b/database/migrations/2022_12_28_113117_create_posts_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('posts', function (Blueprint $table) { $table->uuid('id')->primary(); @@ -30,7 +30,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('posts'); } diff --git a/database/migrations/2022_12_30_105153_create_media_table.php b/database/migrations/2022_12_30_105153_create_media_table.php index 3873828..711cf66 100644 --- a/database/migrations/2022_12_30_105153_create_media_table.php +++ b/database/migrations/2022_12_30_105153_create_media_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('media', function (Blueprint $table) { $table->uuid('id')->primary(); @@ -30,7 +30,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('media'); } diff --git a/database/migrations/2022_12_30_110049_create_permissions_table.php b/database/migrations/2022_12_30_110049_create_permissions_table.php index 2142080..e074e4d 100644 --- a/database/migrations/2022_12_30_110049_create_permissions_table.php +++ b/database/migrations/2022_12_30_110049_create_permissions_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('permissions', function (Blueprint $table) { $table->uuid('id')->primary(); @@ -28,7 +28,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('permissions'); } diff --git a/database/migrations/2023_01_01_103251_create_events_table.php b/database/migrations/2023_01_01_103251_create_events_table.php index 7e9cde3..467874d 100644 --- a/database/migrations/2023_01_01_103251_create_events_table.php +++ b/database/migrations/2023_01_01_103251_create_events_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('events', function (Blueprint $table) { $table->uuid('id')->primary(); @@ -35,7 +35,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('events'); } diff --git a/database/migrations/2023_01_021_050482_create_subscriptions_table.php b/database/migrations/2023_01_021_050482_create_subscriptions_table.php index b47f416..656e15f 100644 --- a/database/migrations/2023_01_021_050482_create_subscriptions_table.php +++ b/database/migrations/2023_01_021_050482_create_subscriptions_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('subscriptions', function (Blueprint $table) { $table->uuid('id')->primary(); @@ -26,7 +26,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('subscriptions'); } diff --git a/database/migrations/2023_01_05_043106_create_jobs_table.php b/database/migrations/2023_01_05_043106_create_jobs_table.php index a786a89..560ae54 100644 --- a/database/migrations/2023_01_05_043106_create_jobs_table.php +++ b/database/migrations/2023_01_05_043106_create_jobs_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('jobs', function (Blueprint $table) { $table->bigIncrements('id'); @@ -29,7 +29,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('jobs'); } diff --git a/database/migrations/2023_01_05_112154_create_user_codes_table.php b/database/migrations/2023_01_05_112154_create_user_codes_table.php index 1d98f9c..d130b2f 100644 --- a/database/migrations/2023_01_05_112154_create_user_codes_table.php +++ b/database/migrations/2023_01_05_112154_create_user_codes_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('user_codes', function (Blueprint $table) { $table->id(); @@ -30,7 +30,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('user_codes'); } diff --git a/database/migrations/2023_01_08_045958_create_audits_table.php b/database/migrations/2023_01_08_045958_create_audits_table.php index 597a958..e363a3c 100644 --- a/database/migrations/2023_01_08_045958_create_audits_table.php +++ b/database/migrations/2023_01_08_045958_create_audits_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::connection(config('audit.drivers.database.connection', config('database.default')))->create('audits', function (Blueprint $table) { @@ -40,7 +40,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::connection(config('audit.drivers.database.connection', config('database.default')))->drop('audits'); } diff --git a/database/migrations/2023_01_08_050847_create_user_logins_table.php b/database/migrations/2023_01_08_050847_create_user_logins_table.php index b2200df..e97f025 100644 --- a/database/migrations/2023_01_08_050847_create_user_logins_table.php +++ b/database/migrations/2023_01_08_050847_create_user_logins_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('user_logins', function (Blueprint $table) { $table->uuid('id')->primary(); @@ -32,7 +32,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('user_logins'); } diff --git a/database/migrations/2023_01_24_080416_create_analytics_table.php b/database/migrations/2023_01_24_080416_create_analytics_table.php index 18db1cd..df4d332 100644 --- a/database/migrations/2023_01_24_080416_create_analytics_table.php +++ b/database/migrations/2023_01_24_080416_create_analytics_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('analytics', function (Blueprint $table) { $table->id(); @@ -28,7 +28,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('analytics'); } diff --git a/database/migrations/2023_02_24_023054_create_attachments_table.php b/database/migrations/2023_02_24_023054_create_attachments_table.php index dbf3f88..9bd6648 100644 --- a/database/migrations/2023_02_24_023054_create_attachments_table.php +++ b/database/migrations/2023_02_24_023054_create_attachments_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('attachments', function (Blueprint $table) { $table->id(); @@ -28,7 +28,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('attachments'); } diff --git a/database/migrations/2023_02_28_090609_add_price_to_events_table.php b/database/migrations/2023_02_28_090609_add_price_to_events_table.php index bee4565..31df4e7 100644 --- a/database/migrations/2023_02_28_090609_add_price_to_events_table.php +++ b/database/migrations/2023_02_28_090609_add_price_to_events_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->string('price')->default(""); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('price'); diff --git a/database/migrations/2023_03_01_075334_add_ages_to_events_table.php b/database/migrations/2023_03_01_075334_add_ages_to_events_table.php index b3543fb..133a5dd 100644 --- a/database/migrations/2023_03_01_075334_add_ages_to_events_table.php +++ b/database/migrations/2023_03_01_075334_add_ages_to_events_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->string('ages')->default(""); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('ages'); diff --git a/database/migrations/2023_04_05_222458_update_media_table.php b/database/migrations/2023_04_05_222458_update_media_table.php index 6df5d64..a836d2a 100644 --- a/database/migrations/2023_04_05_222458_update_media_table.php +++ b/database/migrations/2023_04_05_222458_update_media_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { DB::table('media')->whereNull('mime')->update(['mime' => '']); DB::table('media')->whereNull('permission')->update(['permission' => '']); @@ -40,7 +40,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('media', function (Blueprint $table) { $table->bigInteger('size')->change(); diff --git a/database/migrations/2023_04_18_111723_update_no_nullable_phone_on_users_table.php b/database/migrations/2023_04_18_111723_update_no_nullable_phone_on_users_table.php index 558c4f2..bd2c47c 100644 --- a/database/migrations/2023_04_18_111723_update_no_nullable_phone_on_users_table.php +++ b/database/migrations/2023_04_18_111723_update_no_nullable_phone_on_users_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { DB::table('users')->whereNull('phone')->update(['phone' => '']); @@ -26,7 +26,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('phone')->nullable(true)->change(); diff --git a/database/migrations/2023_04_18_113354_add_display_name_to_users_table.php b/database/migrations/2023_04_18_113354_add_display_name_to_users_table.php index 023c9b4..4fcb54d 100644 --- a/database/migrations/2023_04_18_113354_add_display_name_to_users_table.php +++ b/database/migrations/2023_04_18_113354_add_display_name_to_users_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('display_name')->default(""); @@ -31,7 +31,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('display_name'); diff --git a/database/migrations/2023_04_19_122711_drop_subscriptions_table.php b/database/migrations/2023_04_19_122711_drop_subscriptions_table.php index 61b90a2..118dcd6 100644 --- a/database/migrations/2023_04_19_122711_drop_subscriptions_table.php +++ b/database/migrations/2023_04_19_122711_drop_subscriptions_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::dropIfExists('subscriptions'); } @@ -21,7 +21,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::create('subscriptions', function (Blueprint $table) { $table->uuid('id')->primary(); diff --git a/database/migrations/2023_04_25_235615_update_posts_table.php b/database/migrations/2023_04_25_235615_update_posts_table.php index 228561d..7effe66 100644 --- a/database/migrations/2023_04_25_235615_update_posts_table.php +++ b/database/migrations/2023_04_25_235615_update_posts_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::rename('posts', 'articles'); @@ -25,7 +25,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::rename('articles', 'posts'); diff --git a/database/migrations/2023_05_01_045630_update_analytics_table.php b/database/migrations/2023_05_01_045630_update_analytics_table.php index 5ad2eee..d8a012d 100644 --- a/database/migrations/2023_05_01_045630_update_analytics_table.php +++ b/database/migrations/2023_05_01_045630_update_analytics_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('analytics', function (Blueprint $table) { $table->bigInteger('session')->nullable(false); @@ -100,7 +100,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('analytics', function (Blueprint $table) { $table->dropColumn('session'); diff --git a/database/migrations/2023_05_04_071954_remove_username_from_users_table.php b/database/migrations/2023_05_04_071954_remove_username_from_users_table.php index 05bde34..1381580 100644 --- a/database/migrations/2023_05_04_071954_remove_username_from_users_table.php +++ b/database/migrations/2023_05_04_071954_remove_username_from_users_table.php @@ -12,7 +12,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('username'); @@ -24,7 +24,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('username')->unique(); diff --git a/database/migrations/2023_05_06_080418_create_shortlinks_table.php b/database/migrations/2023_05_06_080418_create_shortlinks_table.php index 3220cb9..d101e1b 100644 --- a/database/migrations/2023_05_06_080418_create_shortlinks_table.php +++ b/database/migrations/2023_05_06_080418_create_shortlinks_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('shortlinks', function (Blueprint $table) { $table->id(); @@ -26,7 +26,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('shortlinks'); } diff --git a/database/migrations/2023_05_06_082705_add_counter_to_shortlinks_table.php b/database/migrations/2023_05_06_082705_add_counter_to_shortlinks_table.php index d0a2cd1..28f0f0f 100644 --- a/database/migrations/2023_05_06_082705_add_counter_to_shortlinks_table.php +++ b/database/migrations/2023_05_06_082705_add_counter_to_shortlinks_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('shortlinks', function (Blueprint $table) { $table->bigInteger('used')->default(0); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('shortlinks', function (Blueprint $table) { // diff --git a/database/migrations/2023_05_08_021929_update_users_table.php b/database/migrations/2023_05_08_021929_update_users_table.php index 744ca60..f21cca7 100644 --- a/database/migrations/2023_05_08_021929_update_users_table.php +++ b/database/migrations/2023_05_08_021929_update_users_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('users', function (Blueprint $table) { $table->string('first_name')->default('')->change(); @@ -24,7 +24,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('users', function (Blueprint $table) { $table->string('first_name')->nullable(false)->change(); diff --git a/database/migrations/2023_05_09_003156_add_location_url_to_events.php b/database/migrations/2023_05_09_003156_add_location_url_to_events.php index b8c5289..af93923 100644 --- a/database/migrations/2023_05_09_003156_add_location_url_to_events.php +++ b/database/migrations/2023_05_09_003156_add_location_url_to_events.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('events', function (Blueprint $table) { $table->string('location_url')->default(''); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('events', function (Blueprint $table) { $table->dropColumn('location_url'); diff --git a/database/migrations/2023_05_11_032859_add_private_to_attachments_table.php b/database/migrations/2023_05_11_032859_add_private_to_attachments_table.php index f150b3e..aa24e77 100644 --- a/database/migrations/2023_05_11_032859_add_private_to_attachments_table.php +++ b/database/migrations/2023_05_11_032859_add_private_to_attachments_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::table('attachments', function (Blueprint $table) { $table->boolean('private')->default(false); @@ -23,7 +23,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::table('attachments', function (Blueprint $table) { $table->dropColumn('private'); diff --git a/database/migrations/2023_05_11_033621_create_event_users_table.php b/database/migrations/2023_05_11_033621_create_event_users_table.php index d1895ec..e4a4702 100644 --- a/database/migrations/2023_05_11_033621_create_event_users_table.php +++ b/database/migrations/2023_05_11_033621_create_event_users_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::create('event_users', function (Blueprint $table) { $table->id(); @@ -29,7 +29,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::dropIfExists('event_users'); } diff --git a/database/migrations/2023_05_24_000000_rename_password_resets_table.php b/database/migrations/2023_05_24_000000_rename_password_resets_table.php index 7ea51ce..ab300e6 100644 --- a/database/migrations/2023_05_24_000000_rename_password_resets_table.php +++ b/database/migrations/2023_05_24_000000_rename_password_resets_table.php @@ -11,7 +11,7 @@ return new class extends Migration * * @return void */ - public function up() + public function up(): void { Schema::rename('password_resets', 'password_reset_tokens'); } @@ -21,7 +21,7 @@ return new class extends Migration * * @return void */ - public function down() + public function down(): void { Schema::rename('password_reset_tokens', 'password_resets'); } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 1080a0f..230545b 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -15,7 +15,7 @@ class DatabaseSeeder extends Seeder * * @return void */ - public function run() + public function run(): void { \App\Models\User::factory(40)->create(); diff --git a/tests/Feature/ArticlesApiTest.php b/tests/Feature/ArticlesApiTest.php index 938da9a..b0925d2 100644 --- a/tests/Feature/ArticlesApiTest.php +++ b/tests/Feature/ArticlesApiTest.php @@ -20,7 +20,7 @@ class ArticlesApiTest extends TestCase $this->faker = FakerFactory::create(); } - public function testAnyUserCanViewArticle() + public function testAnyUserCanViewArticle(): void { // Create an event $article = Article::factory()->create([ @@ -51,7 +51,7 @@ class ArticlesApiTest extends TestCase ]); } - public function testAdminCanCreateUpdateDeleteArticle() + public function testAdminCanCreateUpdateDeleteArticle(): void { // Create a user with the admin/events permission $adminUser = User::factory()->create(); @@ -102,7 +102,7 @@ class ArticlesApiTest extends TestCase ]); } - public function testNonAdminCannotCreateUpdateDeleteArticle() + public function testNonAdminCannotCreateUpdateDeleteArticle(): void { // Create a user without admin/events permission $user = User::factory()->create(); diff --git a/tests/Feature/AuthApiTest.php b/tests/Feature/AuthApiTest.php index c35a1a4..4df3c7f 100644 --- a/tests/Feature/AuthApiTest.php +++ b/tests/Feature/AuthApiTest.php @@ -9,7 +9,7 @@ class AuthApiTest extends TestCase use RefreshDatabase; - public function testLogin() + public function testLogin(): void { $user = User::factory()->create([ 'password' => bcrypt('password'), diff --git a/tests/Feature/ContactFormTest.php b/tests/Feature/ContactFormTest.php index 3bb7f94..72e8464 100644 --- a/tests/Feature/ContactFormTest.php +++ b/tests/Feature/ContactFormTest.php @@ -8,7 +8,7 @@ class ContactFormTest extends TestCase use RefreshDatabase; - public function testContactForm() + public function testContactForm(): void { $formData = [ 'name' => 'John Doe', diff --git a/tests/Feature/EventsApiTest.php b/tests/Feature/EventsApiTest.php index 4fb2e21..6c80c54 100644 --- a/tests/Feature/EventsApiTest.php +++ b/tests/Feature/EventsApiTest.php @@ -21,7 +21,7 @@ class EventsApiTest extends TestCase $this->faker = FakerFactory::create(); } - public function testAnyUserCanViewEvent() + public function testAnyUserCanViewEvent(): void { // Create an event $event = Event::factory()->create([ @@ -52,7 +52,7 @@ class EventsApiTest extends TestCase ]); } - public function testAnyUserCannotSeeDraftEvent() + public function testAnyUserCannotSeeDraftEvent(): void { // Create a draft event $draftEvent = Event::factory()->create([ @@ -85,7 +85,7 @@ class EventsApiTest extends TestCase ]); } - public function testAdminCanCreateUpdateDeleteEvent() + public function testAdminCanCreateUpdateDeleteEvent(): void { // Create a user with the admin/events permission $adminUser = User::factory()->create(); @@ -139,7 +139,7 @@ class EventsApiTest extends TestCase ]); } - public function testNonAdminCannotCreateUpdateDeleteEvent() + public function testNonAdminCannotCreateUpdateDeleteEvent(): void { // Create a user without admin/events permission $user = User::factory()->create(); diff --git a/tests/Feature/UsersApiTest.php b/tests/Feature/UsersApiTest.php index 5633e90..0d7b2c1 100644 --- a/tests/Feature/UsersApiTest.php +++ b/tests/Feature/UsersApiTest.php @@ -10,7 +10,7 @@ class UsersApiTest extends TestCase use RefreshDatabase; - public function testNonAdminUsersCanOnlyViewBasicUserInfo() + public function testNonAdminUsersCanOnlyViewBasicUserInfo(): void { // create a non-admin user $nonAdminUser = User::factory()->create(); @@ -71,7 +71,7 @@ class UsersApiTest extends TestCase ]); } - public function testGuestCannotCreateUser() + public function testGuestCannotCreateUser(): void { $userData = [ 'email' => 'johndoe@example.com', @@ -85,7 +85,7 @@ class UsersApiTest extends TestCase ]); } - public function testGuestCanRegisterUser() + public function testGuestCanRegisterUser(): void { $userData = [ 'first_name' => 'John', @@ -102,7 +102,7 @@ class UsersApiTest extends TestCase ]); } - public function testCannotCreateDuplicateEmailOrDisplayName() + public function testCannotCreateDuplicateEmailOrDisplayName(): void { $userData = [ 'display_name' => 'JackDoe', @@ -125,7 +125,7 @@ class UsersApiTest extends TestCase $response->assertJsonValidationErrors(['display_name', 'email']); } - public function testUserCanOnlyUpdateOwnUser() + public function testUserCanOnlyUpdateOwnUser(): void { $user = User::factory()->create(); @@ -153,7 +153,7 @@ class UsersApiTest extends TestCase $response->assertStatus(403); } - public function testUserCannotDeleteUsers() + public function testUserCannotDeleteUsers(): void { $user = User::factory()->create(); @@ -169,7 +169,7 @@ class UsersApiTest extends TestCase $this->assertDatabaseHas('users', ['id' => $otherUser->id]); } - public function testAdminCanUpdateAnyUser() + public function testAdminCanUpdateAnyUser(): void { $admin = User::factory()->create(); $admin->givePermission('admin/users'); @@ -204,7 +204,7 @@ class UsersApiTest extends TestCase ]); } - public function testAdminCanDeleteAnyUser() + public function testAdminCanDeleteAnyUser(): void { $admin = User::factory()->create(); $admin->givePermission('admin/users'); diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index e5c5fef..d809638 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -11,7 +11,7 @@ class ExampleTest extends TestCase * * @return void */ - public function test_that_true_is_true() + public function test_that_true_is_true(): void { $this->assertTrue(true); }