Skip to content

Commit 5a1296f

Browse files
committed
More type hinting
1 parent 2dc5eb7 commit 5a1296f

20 files changed

+38
-134
lines changed

src/Binding/BoundData.php

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

55
class BoundData
66
{
7-
/**
8-
* @var mixed
9-
*/
10-
protected $data;
7+
protected mixed $data;
118

129
public function __construct(mixed $data)
1310
{

src/Elements/Button.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@
44

55
class Button extends FormControl
66
{
7-
/**
8-
* @var array
9-
*/
10-
protected $attributes = [
7+
protected array $attributes = [
118
'type' => 'button',
129
];
1310

14-
/**
15-
* @var string
16-
*/
17-
protected $value;
11+
protected string $value;
1812

1913
public function __construct(string $value, ?string $name = null)
2014
{

src/Elements/Checkbox.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,13 @@
44

55
class Checkbox extends Input
66
{
7-
/**
8-
* @var array
9-
*/
10-
protected $attributes = [
7+
protected array $attributes = [
118
'type' => 'checkbox',
129
];
1310

14-
/**
15-
* @var ?bool
16-
*/
17-
protected $checked;
11+
protected ?bool $checked;
1812

19-
/**
20-
* @var mixed
21-
*/
22-
protected $oldValue;
13+
protected mixed $oldValue = null;
2314

2415
public function __construct(string $name, mixed $value = 1)
2516
{

src/Elements/Date.php

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

55
class Date extends Text
66
{
7-
/**
8-
* @var array
9-
*/
10-
protected $attributes = [
7+
protected array $attributes = [
118
'type' => 'date',
129
];
1310

src/Elements/DateTimeLocal.php

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

55
class DateTimeLocal extends Text
66
{
7-
/**
8-
* @var array
9-
*/
10-
protected $attributes = [
7+
protected array $attributes = [
118
'type' => 'datetime-local',
129
];
1310

src/Elements/Element.php

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

55
abstract class Element
66
{
7-
/**
8-
* @var array
9-
*/
10-
protected $attributes = [];
7+
protected array $attributes = [];
118

129
protected function setAttribute(string $attribute, mixed $value = null): void
1310
{

src/Elements/Email.php

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

55
class Email extends Text
66
{
7-
/**
8-
* @var array
9-
*/
10-
protected $attributes = [
7+
protected array $attributes = [
118
'type' => 'email',
129
];
1310
}

src/Elements/File.php

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

55
class File extends Input
66
{
7-
/**
8-
* @var array
9-
*/
10-
protected $attributes = [
7+
protected array $attributes = [
118
'type' => 'file',
129
];
1310
}

src/Elements/FormOpen.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,14 @@
44

55
class FormOpen extends Element
66
{
7-
/**
8-
* @var array
9-
*/
10-
protected $attributes = [
7+
protected array $attributes = [
118
'method' => 'POST',
129
'action' => '',
1310
];
1411

15-
/**
16-
* @var ?Hidden
17-
*/
18-
protected $token;
12+
protected ?Hidden $token;
1913

20-
/**
21-
* @var ?Hidden
22-
*/
23-
protected $hiddenMethod;
14+
protected ?Hidden $hiddenMethod;
2415

2516
public function render(): string
2617
{

src/Elements/Hidden.php

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

55
class Hidden extends Input
66
{
7-
/**
8-
* @var array
9-
*/
10-
protected $attributes = [
7+
protected array $attributes = [
118
'type' => 'hidden',
129
];
1310
}

0 commit comments

Comments
 (0)