Skip to content

Commit

Permalink
Refactors array_get to Arr::get
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnathonKoster committed May 24, 2024
1 parent ab0e140 commit b6652d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Forms/FormHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Illuminate\Support\Arr;
use Illuminate\Validation\Factory;
use Statamic\Facades\Entry;
use Statamic\Fields\Blueprint;
Expand Down Expand Up @@ -160,7 +161,7 @@ public function validate()

// Merge in field rules
foreach ($this->getFields() as $field_name => $field_config) {
$field_rules = array_get($field_config, MeerkatForm::KEY_FORM_CONFIG_VALIDATE);
$field_rules = Arr::get($field_config, MeerkatForm::KEY_FORM_CONFIG_VALIDATE);

if ($field_rules) {
if (is_string($field_rules)) {
Expand All @@ -179,7 +180,7 @@ public function validate()
}

// Makes the names prettier.
$attributes[$field_name] = array_get(
$attributes[$field_name] = Arr::get(
$field_config,
MeerkatForm::KEY_FORM_CONFIG_DISPLAY_NAME, $field_name
);
Expand Down

0 comments on commit b6652d1

Please sign in to comment.