EscolaLMS/Consultations

View on GitHub
src/Policies/ConsultationPolicy.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Parameter $user has undeclared type \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

    public function read(User $user, Consultation $consultation): bool
Severity: Minor
Found in src/Policies/ConsultationPolicy.php by phan

Class uses undeclared trait \Illuminate\Auth\Access\HandlesAuthorization
Open

class ConsultationPolicy
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Parameter $user has undeclared type \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

    public function list(User $user): bool
Severity: Minor
Found in src/Policies/ConsultationPolicy.php by phan

Call to method can from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

        return $user->can(ConsultationsPermissionsEnum::CONSULTATION_LIST) || $user->can(ConsultationsPermissionsEnum::CONSULTATION_LIST_OWN);
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Call to method can from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

        return $user->can(ConsultationsPermissionsEnum::CONSULTATION_DELETE)
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Call to method getKey from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

        || ($user->can(ConsultationsPermissionsEnum::CONSULTATION_DELETE_OWN) && $consultation->author_id === $user->getKey());
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Call to method can from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

        return $user->can(ConsultationsPermissionsEnum::CONSULTATION_READ)
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Call to method can from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

            || ($user->can(ConsultationsPermissionsEnum::CONSULTATION_UPDATE_OWN) && $consultation->author_id === $user->getKey());
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Call to method getKey from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

            || ($user->can(ConsultationsPermissionsEnum::CONSULTATION_UPDATE_OWN) && $consultation->author_id === $user->getKey());
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Parameter $user has undeclared type \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

    public function create(User $user): bool
Severity: Minor
Found in src/Policies/ConsultationPolicy.php by phan

Parameter $user has undeclared type \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

    public function delete(User $user, Consultation $consultation): bool
Severity: Minor
Found in src/Policies/ConsultationPolicy.php by phan

Call to method can from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

        || ($user->can(ConsultationsPermissionsEnum::CONSULTATION_DELETE_OWN) && $consultation->author_id === $user->getKey());
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Parameter $user has undeclared type \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

    public function update(User $user, Consultation $consultation): bool
Severity: Minor
Found in src/Policies/ConsultationPolicy.php by phan

Call to method can from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

        return $user->can(ConsultationsPermissionsEnum::CONSULTATION_CREATE);
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Call to method can from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

        return $user->can(ConsultationsPermissionsEnum::CONSULTATION_UPDATE)
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Call to method can from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

            || ($user->can(ConsultationsPermissionsEnum::CONSULTATION_READ_OWN) && $consultation->author_id === $user->getKey());
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Call to method getKey from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

            || ($user->can(ConsultationsPermissionsEnum::CONSULTATION_READ_OWN) && $consultation->author_id === $user->getKey());
Severity: Critical
Found in src/Policies/ConsultationPolicy.php by phan

Line exceeds 120 characters; contains 129 characters
Open

            || ($user->can(ConsultationsPermissionsEnum::CONSULTATION_READ_OWN) && $consultation->author_id === $user->getKey());

Line exceeds 120 characters; contains 142 characters
Open

        return $user->can(ConsultationsPermissionsEnum::CONSULTATION_LIST) || $user->can(ConsultationsPermissionsEnum::CONSULTATION_LIST_OWN);

Line exceeds 120 characters; contains 127 characters
Open

        || ($user->can(ConsultationsPermissionsEnum::CONSULTATION_DELETE_OWN) && $consultation->author_id === $user->getKey());

Line exceeds 120 characters; contains 131 characters
Open

            || ($user->can(ConsultationsPermissionsEnum::CONSULTATION_UPDATE_OWN) && $consultation->author_id === $user->getKey());

There are no issues that match your filters.

Category
Status