Skip to content

Commit cf23c65

Browse files
authored
Merge pull request #224 from yajra/macro
feat: enable macro on Button builder
2 parents 3b3731b + 39da5aa commit cf23c65

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

src/Html/Button.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
use Illuminate\Contracts\Support\Arrayable;
66
use Illuminate\Support\Fluent;
7+
use Illuminate\Support\Traits\Macroable;
78

89
class Button extends Fluent implements Arrayable
910
{
1011
use HasAuthorizations;
12+
use Macroable;
1113

1214
/**
1315
* Make a new button instance.

src/Html/ColumnDefinitions.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
use Illuminate\Support\Collection;
66

7-
class ColumnDefinitions extends Collection
8-
{
9-
}
7+
class ColumnDefinitions extends Collection {}

src/Html/Editor/Fields/Text.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
namespace Yajra\DataTables\Html\Editor\Fields;
44

5-
class Text extends Field
6-
{
7-
}
5+
class Text extends Field {}

src/Html/HtmlBuilder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ public function __construct(
2020
* The View Factory instance.
2121
*/
2222
protected Factory $view
23-
) {
24-
}
23+
) {}
2524

2625
/**
2726
* Convert entities to HTML characters.

tests/LayoutTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ public function it_can_accept_view_instance_or_string_for_layout_content(): void
194194

195195
$builder->layout(fn (Layout $layout) => $layout
196196
->addView(
197-
view: new TestView(),
197+
view: new TestView,
198198
layoutPosition: LayoutPosition::Top,
199199
)
200200
->addView(
201-
view: new TestInlineView(),
201+
view: new TestInlineView,
202202
layoutPosition: LayoutPosition::Bottom,
203203
)
204204
->addView(
@@ -212,12 +212,12 @@ public function it_can_accept_view_instance_or_string_for_layout_content(): void
212212
order: 2
213213
)
214214
->addView(
215-
view: (new TestView())->render(),
215+
view: (new TestView)->render(),
216216
layoutPosition: LayoutPosition::Top,
217217
order: 3
218218
)
219219
->addView(
220-
view: (new TestInlineView())->render(),
220+
view: (new TestInlineView)->render(),
221221
layoutPosition: LayoutPosition::Bottom,
222222
order: 4
223223
)

0 commit comments

Comments
 (0)