forked from eatvio/eatvio-infra
meeting the requirements of a static analyzer
This commit is contained in:
@@ -6,13 +6,13 @@ use App\Models\ConsultantEducation;
|
||||
use App\Models\User;
|
||||
use App\Models\UserAttachment;
|
||||
use App\Notifications\ConsultantRequestStarted;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithFileUploads;
|
||||
use Illuminate\Contracts\View\Factory as ViewFactory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class RegistrationForm extends Component
|
||||
{
|
||||
@@ -30,16 +30,15 @@ class RegistrationForm extends Component
|
||||
|
||||
public string $telegramLink = '';
|
||||
|
||||
public int $hasMedicalEducation = 0;
|
||||
public bool|int $hasMedicalEducation = false;
|
||||
|
||||
public Collection $certPhotos;
|
||||
public array|Collection $certPhotos = [];
|
||||
|
||||
public array $tmpCertPhotos = [];
|
||||
|
||||
public string $legalType = 'selfemployed';
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
protected $rules = [
|
||||
protected array $rules = [
|
||||
'medicalEducations.*.title' => 'required|string|min:6',
|
||||
'medicalEducations.*.date' => 'required|date',
|
||||
'vkLink' => 'required|url',
|
||||
@@ -65,9 +64,9 @@ class RegistrationForm extends Component
|
||||
|
||||
$photos = $this->user->attachments()->certs()->get();
|
||||
|
||||
if (count($photos) > 0) {
|
||||
$this->certPhotos = collect($photos);
|
||||
}
|
||||
// if ($photos) {
|
||||
$this->certPhotos = collect($photos);
|
||||
// }
|
||||
}
|
||||
|
||||
public function render(): View|ViewFactory
|
||||
@@ -95,7 +94,7 @@ class RegistrationForm extends Component
|
||||
$this->medicalEducations = $medicalEducations;
|
||||
}
|
||||
|
||||
public function remove(int $index): void
|
||||
public function remove(string $index): void
|
||||
{
|
||||
$filteredEducations = array_filter(
|
||||
$this->medicalEducations,
|
||||
@@ -146,7 +145,7 @@ class RegistrationForm extends Component
|
||||
$newFile = UserAttachment::updateOrCreate(
|
||||
$fileData,
|
||||
[
|
||||
'path' => preg_replace("/public\//xi", '/storage/', $curCert),
|
||||
'path' => preg_replace('/public\//xi', '/storage/', $curCert),
|
||||
'specs' => json_encode(
|
||||
[
|
||||
'ext' => $photo->extension(),
|
||||
|
||||
Reference in New Issue
Block a user