From fce42df96c3528b096ada418f197031869f15444 Mon Sep 17 00:00:00 2001 From: Nima HeydariNasab Date: Sun, 7 Jan 2024 01:37:20 +0330 Subject: [PATCH] Remove PHP version comparison if statements (#401) --- src/Modal.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Modal.php b/src/Modal.php index 1c6d25b..bca3ea9 100644 --- a/src/Modal.php +++ b/src/Modal.php @@ -61,12 +61,8 @@ public function openModal($component, $arguments = [], $modalAttributes = []): v $this->dispatch('activeModalComponentChanged', id: $id); } - public function resolveComponentProps(array $attributes, Component $component) + public function resolveComponentProps(array $attributes, Component $component): Collection { - if (PHP_VERSION_ID < 70400) { - return; - } - return $this->getPublicPropertyTypes($component) ->intersectByKeys($attributes) ->map(function ($className, $propName) use ($attributes) { @@ -101,12 +97,8 @@ protected function resolveParameter($attributes, $parameterName, $parameterClass return $model; } - public function getPublicPropertyTypes($component) + public function getPublicPropertyTypes($component): Collection { - if (PHP_VERSION_ID < 70400) { - return new Collection(); - } - return collect($component->all()) ->map(function ($value, $name) use ($component) { return Reflector::getParameterClassName(new \ReflectionProperty($component, $name));