diff --git a/src/Traits/FilterByDimensionTrait.php b/src/Traits/FilterByDimensionTrait.php index 0c4f1ea..8304918 100644 --- a/src/Traits/FilterByDimensionTrait.php +++ b/src/Traits/FilterByDimensionTrait.php @@ -105,12 +105,12 @@ protected function createDimensionGroup($dimensions): array $filterExpressionList = []; foreach ($dimensions as $dimension) { - if($dimension instanceof Filter){ + if ($dimension instanceof Filter) { $filterExpressionList[] = (new FilterExpression())->setFilter($dimension); continue; } - if(is_array($dimension)){ + if (is_array($dimension)) { $stringFilter = (new StringFilter())->setCaseSensitive($dimension[3] ?? false) ->setMatchType($dimension[1]) ->setValue($dimension[2]); diff --git a/tests/LaravelGoogleAnalyticsTest.php b/tests/LaravelGoogleAnalyticsTest.php index 4b603aa..b927cdc 100644 --- a/tests/LaravelGoogleAnalyticsTest.php +++ b/tests/LaravelGoogleAnalyticsTest.php @@ -122,11 +122,11 @@ public function it_should_filter_dimension_with_or_group() /** @test */ public function it_should_filter_dimension_with_and_group_receiving_an_filter_object() { - $inListFilter = (new InListFilter())->setValues(["firefox","chrome"]); - $browserFilter = (new Filter())->setInListFilter($inListFilter)->setFieldName("browser"); + $inListFilter = (new InListFilter())->setValues(['firefox', 'chrome']); + $browserFilter = (new Filter())->setInListFilter($inListFilter)->setFieldName('browser'); $result = $this->analytics ->whereAndGroupDimensions([ - $browserFilter + $browserFilter, //Not sure which other metric is available, but can be something like ['country', MatchType::CONTAINS, 'India'] ]) ->get();