Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable macro on Button builder #224

Merged
merged 2 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Html/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Fluent;
use Illuminate\Support\Traits\Macroable;

class Button extends Fluent implements Arrayable
{
use HasAuthorizations;
use Macroable;

/**
* Make a new button instance.
Expand Down
4 changes: 1 addition & 3 deletions src/Html/ColumnDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

use Illuminate\Support\Collection;

class ColumnDefinitions extends Collection
{
}
class ColumnDefinitions extends Collection {}
4 changes: 1 addition & 3 deletions src/Html/Editor/Fields/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Yajra\DataTables\Html\Editor\Fields;

class Text extends Field
{
}
class Text extends Field {}
3 changes: 1 addition & 2 deletions src/Html/HtmlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public function __construct(
* The View Factory instance.
*/
protected Factory $view
) {
}
) {}

/**
* Convert entities to HTML characters.
Expand Down
8 changes: 4 additions & 4 deletions tests/LayoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ public function it_can_accept_view_instance_or_string_for_layout_content(): void

$builder->layout(fn (Layout $layout) => $layout
->addView(
view: new TestView(),
view: new TestView,
layoutPosition: LayoutPosition::Top,
)
->addView(
view: new TestInlineView(),
view: new TestInlineView,
layoutPosition: LayoutPosition::Bottom,
)
->addView(
Expand All @@ -212,12 +212,12 @@ public function it_can_accept_view_instance_or_string_for_layout_content(): void
order: 2
)
->addView(
view: (new TestView())->render(),
view: (new TestView)->render(),
layoutPosition: LayoutPosition::Top,
order: 3
)
->addView(
view: (new TestInlineView())->render(),
view: (new TestInlineView)->render(),
layoutPosition: LayoutPosition::Bottom,
order: 4
)
Expand Down