Skip to content

Commit 2fc07ee

Browse files
committed
Remove deprecated helper function and use Facade instead
1 parent 48d7cff commit 2fc07ee

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Componentable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Collective\Html;
44

55
use BadMethodCallException;
6+
use Illuminate\Support\Arr;
67
use Illuminate\Support\HtmlString;
78

89
trait Componentable
@@ -81,7 +82,7 @@ protected function getComponentData(array $signature, array $arguments)
8182
$default = null;
8283
}
8384

84-
$data[$variable] = array_get($arguments, $i, $default);
85+
$data[$variable] = Arr::get($arguments, $i, $default);
8586

8687
$i++;
8788
}

src/FormBuilder.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Contracts\View\Factory;
1010
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
1111
use Illuminate\Http\Request;
12+
use Illuminate\Support\Arr;
1213
use Illuminate\Support\Collection;
1314
use Illuminate\Support\Facades\App;
1415
use Illuminate\Support\HtmlString;
@@ -134,7 +135,7 @@ public function __construct(HtmlBuilder $html, UrlGenerator $url, Factory $view,
134135
*/
135136
public function open(array $options = [])
136137
{
137-
$method = array_get($options, 'method', 'post');
138+
$method = Arr::get($options, 'method', 'post');
138139

139140
// We need to extract the proper method from the attributes. If the method is
140141
// something other than GET or POST we'll use POST since we will spoof the
@@ -159,7 +160,7 @@ public function open(array $options = [])
159160
// is used to spoof requests for this PUT, PATCH, etc. methods on forms.
160161
$attributes = array_merge(
161162

162-
$attributes, array_except($options, $this->reserved)
163+
$attributes, Arr::except($options, $this->reserved)
163164

164165
);
165166

@@ -589,9 +590,9 @@ protected function setTextAreaSize($options)
589590
// If the "size" attribute was not specified, we will just look for the regular
590591
// columns and rows attributes, using sane defaults if these do not exist on
591592
// the attributes array. We'll then return this entire options array back.
592-
$cols = array_get($options, 'cols', 50);
593+
$cols = Arr::get($options, 'cols', 50);
593594

594-
$rows = array_get($options, 'rows', 10);
595+
$rows = Arr::get($options, 'rows', 10);
595596

596597
return array_merge($options, compact('cols', 'rows'));
597598
}

0 commit comments

Comments
 (0)