Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

Commit 420e6de

Browse files
authored
use Arr::get() helper instead of deprecated array_get()
`array_get()` has been removed from larvel 6.0.
1 parent 9f4a706 commit 420e6de

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/Ipunkt/LaravelAnalytics/Providers/GoogleAnalytics.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Ipunkt\LaravelAnalytics\Providers;
44

55
use App;
6+
use Illuminate\Support\Arr;
67
use InvalidArgumentException;
78
use Ipunkt\LaravelAnalytics\Contracts\AnalyticsProviderInterface;
89
use Ipunkt\LaravelAnalytics\Data\Campaign;
@@ -138,14 +139,14 @@ class GoogleAnalytics implements AnalyticsProviderInterface
138139
*/
139140
public function __construct(array $options = [])
140141
{
141-
$this->trackingId = array_get($options, 'tracking_id');
142-
$this->optimizeId = array_get($options, 'optimize_id');
143-
$this->trackingDomain = array_get($options, 'tracking_domain', 'auto');
144-
$this->trackerName = array_get($options, 'tracker_name', 't0');
145-
$this->displayFeatures = array_get($options, 'display_features', false);
146-
$this->anonymizeIp = array_get($options, 'anonymize_ip', false);
147-
$this->autoTrack = array_get($options, 'auto_track', false);
148-
$this->debug = array_get($options, 'debug', false);
142+
$this->trackingId = Arr::get($options, 'tracking_id');
143+
$this->optimizeId = Arr::get($options, 'optimize_id');
144+
$this->trackingDomain = Arr::get($options, 'tracking_domain', 'auto');
145+
$this->trackerName = Arr::get($options, 'tracker_name', 't0');
146+
$this->displayFeatures = Arr::get($options, 'display_features', false);
147+
$this->anonymizeIp = Arr::get($options, 'anonymize_ip', false);
148+
$this->autoTrack = Arr::get($options, 'auto_track', false);
149+
$this->debug = Arr::get($options, 'debug', false);
149150

150151
if ($this->trackingId === null) {
151152
throw new InvalidArgumentException('Argument tracking_id can not be null');

0 commit comments

Comments
 (0)