diff --git a/.styleci.yml b/.styleci.yml index 6a678b7d2..7474500f1 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -1,3 +1,7 @@ preset: laravel enabled: - - fully_qualified_strict_types \ No newline at end of file + - fully_qualified_strict_types +finder: + not-name: + - index.php + - server.php diff --git a/app/Console/Scheduling/CronEvent.php b/app/Console/Scheduling/CronEvent.php index c9f7b8f29..15b32ec13 100644 --- a/app/Console/Scheduling/CronEvent.php +++ b/app/Console/Scheduling/CronEvent.php @@ -41,6 +41,7 @@ class CronEvent */ public static function command(string $command) : self { + /** @var \App\Models\Instance\Cron $cron */ $cron = Cron::firstOrCreate(['command' => $command]); return new self($cron); diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index da01e9dea..ca34dc2b9 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -113,8 +113,9 @@ class RegisterController extends Controller */ protected function registered(Request $request, $user) { - $first = Account::count() == 1; - if (! config('monica.signup_double_optin') || $first) { + /** @var int $count */ + $count = Account::count(); + if (! config('monica.signup_double_optin') || $count == 1) { // if signup_double_optin is disabled, skip the confirm email part $user->markEmailAsVerified(); } diff --git a/app/Models/Account/Account.php b/app/Models/Account/Account.php index 07ababe12..ae8da86dd 100644 --- a/app/Models/Account/Account.php +++ b/app/Models/Account/Account.php @@ -794,7 +794,7 @@ class Account extends Model * Gets the RelationshipType object matching the given type. * * @param string $relationshipTypeName - * @return RelationshipType + * @return RelationshipType|null */ public function getRelationshipTypeByType(string $relationshipTypeName) { diff --git a/app/Models/Contact/Contact.php b/app/Models/Contact/Contact.php index 4c4d71482..c996bb061 100644 --- a/app/Models/Contact/Contact.php +++ b/app/Models/Contact/Contact.php @@ -465,14 +465,14 @@ class Contact extends Model $builder->leftJoin('activity_contact', 'contacts.id', '=', 'activity_contact.contact_id'); $builder->leftJoin('activities', 'activity_contact.activity_id', '=', 'activities.id'); $builder->orderBy('activities.date_it_happened', 'desc'); - $builder->select('*', 'contacts.id as id'); + $builder->select(['*', 'contacts.id as id']); return $builder; case 'lastactivitydateOldtoNew': $builder->leftJoin('activity_contact', 'contacts.id', '=', 'activity_contact.contact_id'); $builder->leftJoin('activities', 'activity_contact.activity_id', '=', 'activities.id'); $builder->orderBy('activities.date_it_happened', 'asc'); - $builder->select('*', 'contacts.id as id'); + $builder->select(['*', 'contacts.id as id']); return $builder; default: @@ -1154,6 +1154,7 @@ class Contact extends Model } try { + /** @var Contact $contact */ $contact = self::where('account_id', $this->account_id) ->findOrFail($this->first_met_through_contact_id); } catch (ModelNotFoundException $e) { diff --git a/app/Models/Relationship/RelationshipType.php b/app/Models/Relationship/RelationshipType.php index f4c7eb82d..7ca5c63d3 100644 --- a/app/Models/Relationship/RelationshipType.php +++ b/app/Models/Relationship/RelationshipType.php @@ -51,7 +51,7 @@ class RelationshipType extends Model /** * Get the reverser relationship type of this one. * - * @return self + * @return self|null */ public function reverseRelationshipType() { diff --git a/app/Notifications/ConfirmEmail.php b/app/Notifications/ConfirmEmail.php index 448d45652..30f3ce100 100644 --- a/app/Notifications/ConfirmEmail.php +++ b/app/Notifications/ConfirmEmail.php @@ -36,8 +36,9 @@ class ConfirmEmail extends LaravelNotification implements ShouldQueue, MailNotif public function via() { if (! $this->force) { - $first = Account::count() == 1; - if (! config('monica.signup_double_optin') || $first) { + /** @var int $count */ + $count = Account::count(); + if (! config('monica.signup_double_optin') || $count == 1) { return []; } } diff --git a/artisan b/artisan index df630d0d6..f80e64147 100644 --- a/artisan +++ b/artisan @@ -1,6 +1,8 @@ #!/usr/bin/env php - - */ +define('LARAVEL_START', microtime(true)); + /* |-------------------------------------------------------------------------- | Register The Auto Loader @@ -18,7 +21,7 @@ | */ -require __DIR__.'/../bootstrap/autoload.php'; +require __DIR__.'/../vendor/autoload.php'; /* |-------------------------------------------------------------------------- diff --git a/resources/views/activities/form.blade.php b/resources/views/activities/form.blade.php index 523917c21..09a298a07 100644 --- a/resources/views/activities/form.blade.php +++ b/resources/views/activities/form.blade.php @@ -1,6 +1,6 @@
- {{ method_field($method) }} - {{ csrf_field() }} + @method($method) + @csrf

{{ trans('people.activities_add_title', ['name' => $contact->first_name]) }}

diff --git a/resources/views/activities/index.blade.php b/resources/views/activities/index.blade.php index 0f9845228..ecb20c001 100644 --- a/resources/views/activities/index.blade.php +++ b/resources/views/activities/index.blade.php @@ -44,8 +44,8 @@ - {{ method_field('DELETE') }} - {{ csrf_field() }} + @method('DELETE') + @csrf
diff --git a/resources/views/auth/emailchange1.blade.php b/resources/views/auth/emailchange1.blade.php index 88845d409..ec933edcb 100644 --- a/resources/views/auth/emailchange1.blade.php +++ b/resources/views/auth/emailchange1.blade.php @@ -23,7 +23,7 @@ @endif
- {{ csrf_field() }} + @csrf
diff --git a/resources/views/auth/emailchange2.blade.php b/resources/views/auth/emailchange2.blade.php index 395864348..2f53b083a 100644 --- a/resources/views/auth/emailchange2.blade.php +++ b/resources/views/auth/emailchange2.blade.php @@ -23,7 +23,7 @@ @endif - {{ csrf_field() }} + @csrf
diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 3f2bc87e5..fcc4f5b78 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -35,7 +35,7 @@ @endif - {{ csrf_field() }} + @csrf
diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 76351b06b..248dd5437 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -16,7 +16,7 @@ @endif - {{ csrf_field() }} + @csrf
diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php index ef5bdc8f7..4ca533e5c 100644 --- a/resources/views/auth/passwords/reset.blade.php +++ b/resources/views/auth/passwords/reset.blade.php @@ -12,7 +12,7 @@
- {{ csrf_field() }} + @csrf diff --git a/resources/views/auth/recovery/login.blade.php b/resources/views/auth/recovery/login.blade.php index 36d4c7ea4..dfe19e9dd 100644 --- a/resources/views/auth/recovery/login.blade.php +++ b/resources/views/auth/recovery/login.blade.php @@ -22,7 +22,7 @@ @endif - {{ csrf_field() }} + @csrf
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index d1ad394e1..ce71d3c35 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -51,7 +51,7 @@ @endif - {{ csrf_field() }} + @csrf
diff --git a/resources/views/compliance/index.blade.php b/resources/views/compliance/index.blade.php index 82ac56dea..e6b42910f 100644 --- a/resources/views/compliance/index.blade.php +++ b/resources/views/compliance/index.blade.php @@ -9,7 +9,7 @@

{{ trans('app.compliance_desc_end') }}

- {{ csrf_field() }} + @csrf
diff --git a/resources/views/journal/add.blade.php b/resources/views/journal/add.blade.php index 834579589..4c8a84ba4 100644 --- a/resources/views/journal/add.blade.php +++ b/resources/views/journal/add.blade.php @@ -26,7 +26,7 @@
- {{ csrf_field() }} + @csrf @include('partials.errors') diff --git a/resources/views/journal/edit.blade.php b/resources/views/journal/edit.blade.php index a0f72c5a9..905ba3cea 100644 --- a/resources/views/journal/edit.blade.php +++ b/resources/views/journal/edit.blade.php @@ -27,7 +27,7 @@
@method('PUT') - {{ csrf_field() }} + @csrf @include('partials.errors') diff --git a/resources/views/people/avatar/edit.blade.php b/resources/views/people/avatar/edit.blade.php index c229e51d4..26adb209c 100644 --- a/resources/views/people/avatar/edit.blade.php +++ b/resources/views/people/avatar/edit.blade.php @@ -11,7 +11,7 @@
- {{ csrf_field() }} + @csrf @include('partials.errors') diff --git a/resources/views/people/conversations/edit.blade.php b/resources/views/people/conversations/edit.blade.php index 2a86f3d28..b3da48e1a 100644 --- a/resources/views/people/conversations/edit.blade.php +++ b/resources/views/people/conversations/edit.blade.php @@ -11,8 +11,8 @@

{{ trans('people.conversation_edit_title') }}

{{ trans('people.conversation_delete_link') }}

- {{ method_field('DELETE') }} - {{ csrf_field() }} + @method('DELETE') + @csrf
@@ -29,7 +29,7 @@
@method('PUT') - {{ csrf_field() }} + @csrf {{-- When did it take place --}}
diff --git a/resources/views/people/conversations/new.blade.php b/resources/views/people/conversations/new.blade.php index 162c50404..90fde2df4 100644 --- a/resources/views/people/conversations/new.blade.php +++ b/resources/views/people/conversations/new.blade.php @@ -23,7 +23,7 @@ @include('partials.errors') - {{ csrf_field() }} + @csrf {{-- When did it take place --}}
diff --git a/resources/views/people/create.blade.php b/resources/views/people/create.blade.php index 6b9d63997..389a690ad 100644 --- a/resources/views/people/create.blade.php +++ b/resources/views/people/create.blade.php @@ -26,7 +26,7 @@ @include('partials.errors') - {{ csrf_field() }} + @csrf
{{-- This check is for the cultures that are used to say the last name first --}} diff --git a/resources/views/people/debt/form.blade.php b/resources/views/people/debt/form.blade.php index 89c9c9b5e..fbf807ab7 100755 --- a/resources/views/people/debt/form.blade.php +++ b/resources/views/people/debt/form.blade.php @@ -1,6 +1,6 @@ - {{ method_field($method) }} - {{ csrf_field() }} + @method($method) + @csrf @include('partials.errors') diff --git a/resources/views/people/debt/index.blade.php b/resources/views/people/debt/index.blade.php index a073a8ea7..cf7564d1d 100644 --- a/resources/views/people/debt/index.blade.php +++ b/resources/views/people/debt/index.blade.php @@ -55,8 +55,8 @@
- {{ method_field('DELETE') }} - {{ csrf_field() }} + @method('DELETE') + @csrf @endforeach diff --git a/resources/views/people/edit.blade.php b/resources/views/people/edit.blade.php index c131c0161..1e8712f5a 100644 --- a/resources/views/people/edit.blade.php +++ b/resources/views/people/edit.blade.php @@ -16,7 +16,7 @@
@method('PUT') - {{ csrf_field() }} + @csrf @include('partials.errors') @@ -155,7 +155,7 @@
- {{ method_field('DELETE') }} - {{ csrf_field() }} + @method('DELETE') + @csrf @endsection diff --git a/resources/views/people/food-preferences/edit.blade.php b/resources/views/people/food-preferences/edit.blade.php index 880260585..8ce7fa11e 100644 --- a/resources/views/people/food-preferences/edit.blade.php +++ b/resources/views/people/food-preferences/edit.blade.php @@ -33,7 +33,7 @@
- {{ csrf_field() }} + @csrf

{{ trans('people.food_preferences_edit_title') }}

diff --git a/resources/views/people/gifts/form.blade.php b/resources/views/people/gifts/form.blade.php index 452794e14..33204b790 100644 --- a/resources/views/people/gifts/form.blade.php +++ b/resources/views/people/gifts/form.blade.php @@ -1,6 +1,6 @@ - {{ method_field($method) }} - {{ csrf_field() }} + @method($method) + @csrf

{{ trans('people.gifts_add_title', ['name' => $contact->first_name]) }}

diff --git a/resources/views/people/index.blade.php b/resources/views/people/index.blade.php index 60c64426c..c339b719a 100644 --- a/resources/views/people/index.blade.php +++ b/resources/views/people/index.blade.php @@ -2,7 +2,7 @@ @section('content')
- {{ csrf_field() }} + @csrf {{-- Breadcrumb --}}