Skip to content

Commit af30f87

Browse files
committed
Apply fixes from StyleCI
[ci skip] [skip ci]
1 parent c509789 commit af30f87

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

src/app/Library/CrudPanel/CrudFilter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ public function forget($attribute)
223223
* @param string $attribute The name of the attribute being removed.
224224
*
225225
* @codeCoverageIgnore
226+
*
226227
* @deprecated
227228
*/
228229
public function removeFilterAttribute($filter, $attribute)

tests/Unit/CrudPanel/CrudPanelFiltersTest.php

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ public function testItCanCreateAFilterFluently()
5353
->view('simple')
5454
->viewNamespace('crud::filters')
5555
->ifActive(function () {
56-
return true;
57-
})
56+
return true;
57+
})
5858
->ifInactive(function () {
59-
return true;
60-
});
59+
return true;
60+
});
6161

6262
$this->assertCount(1, $this->crudPanel->filters());
6363
$filter = $this->crudPanel->filters()[0];
@@ -86,21 +86,27 @@ public function testWhenActiveAndWhenInactiveAliases()
8686

8787
public function testWhenNotActiveAlias()
8888
{
89-
$filter = CrudFilter::name('my_filter')->whenNotActive(function () {return true;});
89+
$filter = CrudFilter::name('my_filter')->whenNotActive(function () {
90+
return true;
91+
});
9092
$this->assertCount(1, $this->crudPanel->filters());
9193
$this->assertTrue(is_callable($filter->fallbackLogic));
9294
}
9395

9496
public function testIfNotActiveAlias()
9597
{
96-
$filter = CrudFilter::name('my_filter')->ifNotActive(function () {return true;});
98+
$filter = CrudFilter::name('my_filter')->ifNotActive(function () {
99+
return true;
100+
});
97101
$this->assertCount(1, $this->crudPanel->filters());
98102
$this->assertTrue(is_callable($filter->fallbackLogic));
99103
}
100104

101105
public function testElseAlias()
102106
{
103-
$filter = CrudFilter::name('my_filter')->else(function () {return true;});
107+
$filter = CrudFilter::name('my_filter')->else(function () {
108+
return true;
109+
});
104110
$this->assertCount(1, $this->crudPanel->filters());
105111
$this->assertTrue(is_callable($filter->fallbackLogic));
106112
}
@@ -112,7 +118,7 @@ public function testItCanAddAFilterBeforeOtherFilter()
112118
$filterCollection = $this->crudPanel->filters();
113119
$this->assertCount(2, $filterCollection);
114120
$firstFilter = $filterCollection[0];
115-
$this->assertEquals('test_filter_2', $firstFilter->name);
121+
$this->assertEquals('test_filter_2', $firstFilter->name);
116122
}
117123

118124
public function testItCanAddAFilterAfterOtherFilter()
@@ -123,7 +129,7 @@ public function testItCanAddAFilterAfterOtherFilter()
123129
$filterCollection = $this->crudPanel->filters();
124130
$this->assertCount(3, $filterCollection);
125131
$secondFilter = $filterCollection[1];
126-
$this->assertEquals('test_filter_2', $secondFilter->name);
132+
$this->assertEquals('test_filter_2', $secondFilter->name);
127133
}
128134

129135
public function testItCanMakeAFilterFirst()
@@ -133,7 +139,7 @@ public function testItCanMakeAFilterFirst()
133139
$filterCollection = $this->crudPanel->filters();
134140
$this->assertCount(2, $filterCollection);
135141
$firstFilter = $filterCollection[0];
136-
$this->assertEquals('test_filter_2', $firstFilter->name);
142+
$this->assertEquals('test_filter_2', $firstFilter->name);
137143
}
138144

139145
public function testItCanMakeAFilterLast()
@@ -143,7 +149,7 @@ public function testItCanMakeAFilterLast()
143149
CrudFilter::name('my_filter')->makeLast();
144150
$filterCollection = $this->crudPanel->filters();
145151
$this->assertCount(2, $filterCollection);
146-
$this->assertEquals(['my_filter_2', 'my_filter'], $filterCollection->pluck('name')->toArray());
152+
$this->assertEquals(['my_filter_2', 'my_filter'], $filterCollection->pluck('name')->toArray());
147153
}
148154

149155
public function testItCanRemoveAFilter()
@@ -153,7 +159,7 @@ public function testItCanRemoveAFilter()
153159
CrudFilter::name('my_filter')->remove();
154160
$filterCollection = $this->crudPanel->filters();
155161
$this->assertCount(1, $filterCollection);
156-
$this->assertEquals(['my_filter_2'], $filterCollection->pluck('name')->toArray());
162+
$this->assertEquals(['my_filter_2'], $filterCollection->pluck('name')->toArray());
157163
}
158164

159165
public function testItCanRemoveAFilterAttribute()
@@ -163,16 +169,16 @@ public function testItCanRemoveAFilterAttribute()
163169
CrudFilter::name('my_filter')->forget('type');
164170
$filterCollection = $this->crudPanel->filters();
165171
$this->assertCount(2, $filterCollection);
166-
$this->assertFalse($filterCollection[0]->type);
172+
$this->assertFalse($filterCollection[0]->type);
167173
}
168174

169175
public function testItCanGetTheViewWithNamespace()
170176
{
171-
$this->crudPanel->addFilter(...$this->testFilter);
177+
$this->crudPanel->addFilter(...$this->testFilter);
172178
$namespacedFilterView = CrudFilter::name('my_filter')->getViewWithNamespace();
173179
$filterCollection = $this->crudPanel->filters();
174180
$this->assertCount(1, $filterCollection);
175-
$this->assertEquals($filterCollection[0]->viewNamespace.'.'.$filterCollection[0]->view, $namespacedFilterView);
181+
$this->assertEquals($filterCollection[0]->viewNamespace.'.'.$filterCollection[0]->view, $namespacedFilterView);
176182
}
177183

178184
public function testItCanGetAllFilterViewNamespacesWithFallbacks()

0 commit comments

Comments
 (0)