Skip to content

Commit a997238

Browse files
committed
Merge branch 'develop' of https://github.com/rappasoft/laravel-livewire-tables into develop
2 parents 5a1dde9 + 868d2d6 commit a997238

File tree

8 files changed

+62
-47
lines changed

8 files changed

+62
-47
lines changed

src/Traits/CanBeHidden.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
trait CanBeHidden
99
{
10-
1110
/**
1211
* @var bool
1312
*/
@@ -18,7 +17,8 @@ trait CanBeHidden
1817
*
1918
* @return $this
2019
*/
21-
public function hideIf($condition) : self {
20+
public function hideIf($condition): self
21+
{
2222
$this->hidden = $condition === true;
2323

2424
return $this;
@@ -29,7 +29,8 @@ public function hideIf($condition) : self {
2929
*
3030
* @return $this
3131
*/
32-
public function hide($hidden = true) : self {
32+
public function hide($hidden = true): self
33+
{
3334
$this->hidden = $hidden;
3435

3536
return $this;
@@ -38,7 +39,8 @@ public function hide($hidden = true) : self {
3839
/**
3940
* @return bool
4041
*/
41-
public function isHidden() : bool {
42+
public function isHidden(): bool
43+
{
4244
return $this->hidden;
4345
}
4446
}

src/Traits/Checkboxes.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ trait Checkboxes
4646
*/
4747
public $checkboxValues = [];
4848

49-
/**
50-
*
51-
*/
5249
public function updatedCheckboxAll()
5350
{
5451
$this->checkboxValues = [];
@@ -60,9 +57,6 @@ public function updatedCheckboxAll()
6057
}
6158
}
6259

63-
/**
64-
*
65-
*/
6660
public function updatedCheckboxValues()
6761
{
6862
$this->checkboxAll = false;

src/Traits/HasComponents.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
trait HasComponents
99
{
10-
1110
/**
1211
* @var array
1312
*/
@@ -30,7 +29,8 @@ trait HasComponents
3029
*
3130
* @return $this
3231
*/
33-
public function components(array $components = [], $hidden = false, $hiddenMessage = false) : self {
32+
public function components(array $components = [], $hidden = false, $hiddenMessage = false): self
33+
{
3434
$this->components = $components;
3535
$this->hidden = $hidden;
3636
$this->hiddenMessage = $hiddenMessage;
@@ -43,7 +43,8 @@ public function components(array $components = [], $hidden = false, $hiddenMessa
4343
*
4444
* @return $this
4545
*/
46-
public function addComponent($component) : self {
46+
public function addComponent($component): self
47+
{
4748
$this->components[] = $component;
4849

4950
return $this;
@@ -52,14 +53,16 @@ public function addComponent($component) : self {
5253
/**
5354
* @return bool
5455
*/
55-
public function hasComponents() : bool {
56+
public function hasComponents(): bool
57+
{
5658
return count($this->components) > 0;
5759
}
5860

5961
/**
6062
* @return array
6163
*/
62-
public function getComponents() : array {
64+
public function getComponents(): array
65+
{
6366
return $this->components;
6467
}
6568

@@ -68,7 +71,8 @@ public function getComponents() : array {
6871
*
6972
* @return mixed
7073
*/
71-
public function componentsAreHiddenForModel($model) {
74+
public function componentsAreHiddenForModel($model)
75+
{
7276
if (is_callable($this->hidden)) {
7377
return app()->call($this->hidden, ['model' => $model]);
7478
}
@@ -81,7 +85,8 @@ public function componentsAreHiddenForModel($model) {
8185
*
8286
* @return bool|mixed
8387
*/
84-
public function componentsHiddenMessageForModel($model) {
88+
public function componentsHiddenMessageForModel($model)
89+
{
8590
if (is_callable($this->hiddenMessage)) {
8691
return app()->call($this->hiddenMessage, ['model' => $model]);
8792
}

src/Views/Button.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/**
66
* Class Button.
77
*/
8-
class Button extends Component {
9-
8+
class Button extends Component
9+
{
1010
/**
1111
* Component constructor.
1212
*
@@ -24,7 +24,8 @@ public function __construct($text = false)
2424
*
2525
* @return self
2626
*/
27-
public static function make($text) : self {
27+
public static function make($text): self
28+
{
2829
return new static($text);
2930
}
3031

@@ -33,7 +34,8 @@ public static function make($text) : self {
3334
*
3435
* @return self
3536
*/
36-
public function text($text) : self {
37+
public function text($text): self
38+
{
3739
return $this->setAttribute('text', $text);
3840
}
3941

@@ -42,7 +44,8 @@ public function text($text) : self {
4244
*
4345
* @return $this
4446
*/
45-
public function class($class) : self {
47+
public function class($class): self
48+
{
4649
return $this->setAttribute('class', $class);
4750
}
4851

@@ -51,7 +54,8 @@ public function class($class) : self {
5154
*
5255
* @return $this
5356
*/
54-
public function id($id) : self {
57+
public function id($id): self
58+
{
5559
return $this->setAttribute('id', $id);
5660
}
5761

@@ -60,14 +64,16 @@ public function id($id) : self {
6064
*
6165
* @return $this
6266
*/
63-
public function icon($icon) : self {
67+
public function icon($icon): self
68+
{
6469
return $this->setOption('icon', $icon);
6570
}
6671

6772
/**
6873
* @return string
6974
*/
70-
public function view() : string {
75+
public function view(): string
76+
{
7177
return 'laravel-livewire-tables::components.button';
7278
}
7379
}

src/Views/Column.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*/
1111
class Column
1212
{
13-
1413
use HasComponents;
1514

1615
/**

src/Views/Component.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*/
1111
abstract class Component implements ComponentContract
1212
{
13-
1413
use CanBeHidden;
1514

1615
/**
@@ -29,7 +28,8 @@ abstract class Component implements ComponentContract
2928
*
3029
* @return $this
3130
*/
32-
public function setAttribute($attribute, $value) : self {
31+
public function setAttribute($attribute, $value): self
32+
{
3333
$this->attributes[$attribute] = $value;
3434

3535
return $this;
@@ -40,7 +40,8 @@ public function setAttribute($attribute, $value) : self {
4040
*
4141
* @return $this
4242
*/
43-
public function setAttributes(array $attributes = []) : self {
43+
public function setAttributes(array $attributes = []): self
44+
{
4445
$this->attributes = array_merge($this->attributes, $attributes);
4546

4647
return $this;
@@ -49,7 +50,8 @@ public function setAttributes(array $attributes = []) : self {
4950
/**
5051
* @return array
5152
*/
52-
public function getAttributes() : array {
53+
public function getAttributes(): array
54+
{
5355
return $this->attributes;
5456
}
5557

@@ -59,7 +61,8 @@ public function getAttributes() : array {
5961
*
6062
* @return $this
6163
*/
62-
public function setOption($option, $value) : self {
64+
public function setOption($option, $value): self
65+
{
6366
$this->options[$option] = $value;
6467

6568
return $this;
@@ -70,7 +73,8 @@ public function setOption($option, $value) : self {
7073
*
7174
* @return $this
7275
*/
73-
public function setOptions(array $options = []) : self {
76+
public function setOptions(array $options = []): self
77+
{
7478
$this->options = array_merge($this->options, $options);
7579

7680
return $this;
@@ -79,7 +83,8 @@ public function setOptions(array $options = []) : self {
7983
/**
8084
* @return array
8185
*/
82-
public function getOptions() : array {
86+
public function getOptions(): array
87+
{
8388
return $this->options;
8489
}
8590
}

src/Views/Contracts/ComponentContract.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
namespace Rappasoft\LaravelLivewireTables\Views\Contracts;
44

55
/**
6-
* Interface Component
7-
*
8-
* @package Rappasoft\LaravelLivewireTables\Views\Contracts
6+
* Interface Component.
97
*/
108
interface ComponentContract
119
{
12-
1310
/**
1411
* @return string
1512
*/
16-
public function view() : string;
13+
public function view(): string;
1714
}

src/Views/Link.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
/**
66
* Class Link.
77
*/
8-
class Link extends Component {
9-
8+
class Link extends Component
9+
{
1010
/**
1111
* Link constructor.
1212
*
@@ -24,7 +24,8 @@ public function __construct($text = false)
2424
*
2525
* @return self
2626
*/
27-
public static function make($text) : self {
27+
public static function make($text): self
28+
{
2829
return new static($text);
2930
}
3031

@@ -33,7 +34,8 @@ public static function make($text) : self {
3334
*
3435
* @return self
3536
*/
36-
public function text($text) : self {
37+
public function text($text): self
38+
{
3739
return $this->setAttribute('text', $text);
3840
}
3941

@@ -42,7 +44,8 @@ public function text($text) : self {
4244
*
4345
* @return $this
4446
*/
45-
public function class($class) : self {
47+
public function class($class): self
48+
{
4649
return $this->setAttribute('class', $class);
4750
}
4851

@@ -51,7 +54,8 @@ public function class($class) : self {
5154
*
5255
* @return $this
5356
*/
54-
public function id($id) : self {
57+
public function id($id): self
58+
{
5559
return $this->setAttribute('id', $id);
5660
}
5761

@@ -60,7 +64,8 @@ public function id($id) : self {
6064
*
6165
* @return $this
6266
*/
63-
public function icon($icon) : self {
67+
public function icon($icon): self
68+
{
6469
return $this->setOption('icon', $icon);
6570
}
6671

@@ -69,14 +74,16 @@ public function icon($icon) : self {
6974
*
7075
* @return $this
7176
*/
72-
public function href($href) : self {
77+
public function href($href): self
78+
{
7379
return $this->setAttribute('href', $href);
7480
}
7581

7682
/**
7783
* @return string
7884
*/
79-
public function view() : string {
85+
public function view(): string
86+
{
8087
return 'laravel-livewire-tables::components.link';
8188
}
8289
}

0 commit comments

Comments
 (0)