Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit bfdc223

Browse files
rawilkgithub-actions[bot]
authored andcommitted
PHP Linting (Pint)
1 parent 100d16a commit bfdc223

40 files changed

+176
-152
lines changed

src/Components/Choice/Checkbox.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Checkbox extends BladeComponent
1616
use HandlesValidationErrors {
1717
ariaDescribedBy as validationAriaDescribedBy;
1818
}
19-
use HasModels;
2019
use HasExtraAttributes;
20+
use HasModels;
2121

2222
public string $type = 'checkbox';
2323

@@ -34,7 +34,7 @@ public function __construct(
3434
public ?bool $labelLeft = null,
3535

3636
// Extra Attributes
37-
null|string|HtmlString|array|Collection $extraAttributes = null,
37+
string|HtmlString|array|Collection $extraAttributes = null,
3838
) {
3939
$this->id = $id ?? $name;
4040

@@ -57,7 +57,7 @@ public function inputClass(): string
5757
]);
5858
}
5959

60-
public function containerClass(?string $inputSize = null): string
60+
public function containerClass(string $inputSize = null): string
6161
{
6262
// Input size from parent has priority over individual defined size.
6363
if ($inputSize) {

src/Components/Choice/SwitchToggle.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
class SwitchToggle extends BladeComponent
1616
{
1717
use HandlesValidationErrors;
18-
use HasModels;
1918
use HasExtraAttributes;
19+
use HasModels;
2020

2121
public function __construct(
2222
public ?string $name = null,
@@ -35,7 +35,7 @@ public function __construct(
3535
public bool $short = false,
3636

3737
// Extra Attributes
38-
null|string|HtmlString|array|Collection $extraAttributes = null,
38+
string|HtmlString|array|Collection $extraAttributes = null,
3939
) {
4040
$this->id = $id ?? $name;
4141

src/Components/Files/FilePond.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
class FilePond extends BladeComponent
1616
{
17-
use HandlesValidationErrors;
1817
use AcceptsFiles;
18+
use HandlesValidationErrors;
1919
use HasExtraAttributes;
2020
use HasModels;
2121

@@ -28,11 +28,11 @@ public function __construct(
2828
public ?int $maxFiles = null,
2929
public ?array $options = null,
3030
public ?string $description = null,
31-
?string $type = null,
32-
?bool $showErrors = null,
31+
string $type = null,
32+
bool $showErrors = null,
3333

3434
// Extra attributes
35-
null|string|HtmlString|array|Collection $extraAttributes = null,
35+
string|HtmlString|array|Collection $extraAttributes = null,
3636
) {
3737
$this->id = $id ?? $name;
3838

src/Components/Files/FileUpload.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@
1515

1616
class FileUpload extends BladeComponent
1717
{
18-
use HandlesValidationErrors;
1918
use AcceptsFiles;
20-
use HasModels;
19+
use HandlesValidationErrors;
2120
use HasExtraAttributes;
21+
use HasModels;
2222

2323
protected ?bool $canShowUploadProgress = null;
2424

2525
public function __construct(
2626
public ?string $name = null,
2727
public ?string $id = null,
2828
public bool $multiple = false,
29-
?string $type = null,
30-
?bool $showErrors = null,
29+
string $type = null,
30+
bool $showErrors = null,
3131
public ?bool $displayUploadProgress = null,
3232
public ?string $size = null,
3333
public ?string $containerClass = null,
3434
public ?bool $useNativeProgressBar = null,
3535

3636
// Extra attributes
37-
null|string|HtmlString|array|Collection $extraAttributes = null,
37+
string|HtmlString|array|Collection $extraAttributes = null,
3838
) {
3939
$this->id = $id ?? $name;
4040
$this->type = $type;

src/Components/FormGroup.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
namespace Rawilk\FormComponents\Components;
44

5-
use function config;
65
use Illuminate\Support\Arr;
76
use Rawilk\FormComponents\Concerns\HandlesValidationErrors;
87

8+
use function config;
9+
910
class FormGroup extends BladeComponent
1011
{
1112
use HandlesValidationErrors;
@@ -15,7 +16,7 @@ public function __construct(
1516
public ?string $inputId = null,
1617
public null|bool|string $label = null,
1718
public ?bool $inline = null,
18-
?bool $showErrors = null,
19+
bool $showErrors = null,
1920
public ?string $helpText = null,
2021
public bool $isCheckboxGroup = false,
2122
public ?bool $marginBottom = null,

src/Components/Inputs/CustomSelect.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
class CustomSelect extends BladeComponent
1919
{
2020
use HandlesValidationErrors;
21+
use HasAddons;
2122
use HasExtraAttributes;
2223
use HasModels;
23-
use HasAddons;
2424

2525
public function __construct(
2626
public ?string $name = null,
2727
public ?string $id = null,
2828
public mixed $value = null,
29-
?bool $showErrors = null,
29+
bool $showErrors = null,
3030
public bool $multiple = false,
3131
public array|Collection $options = [],
3232
public ?string $size = null,
@@ -51,13 +51,13 @@ public function __construct(
5151
public ?string $containerClass = null,
5252

5353
// Extra Attributes
54-
null|string|HtmlString|array|Collection $extraAttributes = null,
54+
string|HtmlString|array|Collection $extraAttributes = null,
5555

5656
// Addons
57-
?string $leadingAddon = null,
58-
?string $leadingIcon = null,
59-
?string $inlineAddon = null,
60-
?string $trailingAddon = null,
57+
string $leadingAddon = null,
58+
string $leadingIcon = null,
59+
string $inlineAddon = null,
60+
string $trailingAddon = null,
6161
) {
6262
$this->id = $id ?? $name;
6363
$this->value = $name ? old($name, $value) : $value;

src/Components/Inputs/DatePicker.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@
1111
class DatePicker extends Input
1212
{
1313
public function __construct(
14-
?string $name = null,
15-
?string $id = null,
14+
string $name = null,
15+
string $id = null,
1616
mixed $value = null,
17-
?string $containerClass = null,
18-
?string $size = null,
19-
?bool $showErrors = null,
17+
string $containerClass = null,
18+
string $size = null,
19+
bool $showErrors = null,
2020

2121
// Extra Attributes
22-
null|HtmlString|array|string|Collection $extraAttributes = null,
22+
HtmlString|array|string|Collection $extraAttributes = null,
2323

2424
// Addons
25-
?string $leadingAddon = null,
26-
?string $leadingIcon = null,
27-
?string $inlineAddon = null,
28-
?string $trailingAddon = null,
29-
?string $trailingInlineAddon = null,
30-
?string $trailingIcon = null,
25+
string $leadingAddon = null,
26+
string $leadingIcon = null,
27+
string $inlineAddon = null,
28+
string $trailingAddon = null,
29+
string $trailingInlineAddon = null,
30+
string $trailingIcon = null,
3131

3232
// Date picker specific
3333
public array $options = [],

src/Components/Inputs/Input.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
class Input extends BladeComponent
1717
{
1818
use HandlesValidationErrors;
19+
use HasAddons;
1920
use HasExtraAttributes;
2021
use HasModels;
21-
use HasAddons;
2222

2323
/**
2424
* Normally we want arrays to be encoded, but some components don't need that, like Select.
@@ -32,18 +32,18 @@ public function __construct(
3232
public mixed $value = null,
3333
public ?string $containerClass = null,
3434
public ?string $size = null,
35-
?bool $showErrors = null,
35+
bool $showErrors = null,
3636

3737
// Extra Attributes
38-
null|string|HtmlString|array|Collection $extraAttributes = null,
38+
string|HtmlString|array|Collection $extraAttributes = null,
3939

4040
// Addons
41-
?string $leadingAddon = null,
42-
?string $leadingIcon = null,
43-
?string $inlineAddon = null,
44-
?string $trailingAddon = null,
45-
?string $trailingInlineAddon = null,
46-
?string $trailingIcon = null,
41+
string $leadingAddon = null,
42+
string $leadingIcon = null,
43+
string $inlineAddon = null,
44+
string $trailingAddon = null,
45+
string $trailingInlineAddon = null,
46+
string $trailingIcon = null,
4747
) {
4848
$this->id = $this->id ?? $this->name;
4949
$this->value = $name ? old($name, $value) : $value;

src/Components/Inputs/Password.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@
1111
class Password extends Input
1212
{
1313
public function __construct(
14-
?string $name = null,
15-
?string $id = null,
14+
string $name = null,
15+
string $id = null,
1616
mixed $value = null,
17-
?string $containerClass = null,
18-
?string $size = null,
19-
?bool $showErrors = null,
17+
string $containerClass = null,
18+
string $size = null,
19+
bool $showErrors = null,
2020

2121
// Extra Attributes
22-
null|HtmlString|array|string|Collection $extraAttributes = null,
22+
HtmlString|array|string|Collection $extraAttributes = null,
2323

2424
// Addons
25-
?string $leadingAddon = null,
26-
?string $leadingIcon = null,
27-
?string $inlineAddon = null,
28-
?string $trailingAddon = null,
29-
?string $trailingInlineAddon = null,
30-
?string $trailingIcon = null,
25+
string $leadingAddon = null,
26+
string $leadingIcon = null,
27+
string $inlineAddon = null,
28+
string $trailingAddon = null,
29+
string $trailingInlineAddon = null,
30+
string $trailingIcon = null,
3131

3232
// Password specific
3333
public ?bool $showToggle = null,

src/Components/Inputs/Select.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ class Select extends Input
1313
use GetsSelectOptionProperties;
1414

1515
public function __construct(
16-
?string $name = null,
17-
?string $id = null,
16+
string $name = null,
17+
string $id = null,
1818
mixed $value = null,
19-
?string $containerClass = null,
20-
?string $size = null,
21-
?bool $showErrors = null,
19+
string $containerClass = null,
20+
string $size = null,
21+
bool $showErrors = null,
2222

2323
// Extra attributes
24-
null|HtmlString|array|string|Collection $extraAttributes = null,
24+
HtmlString|array|string|Collection $extraAttributes = null,
2525

2626
// Addons
27-
?string $leadingAddon = null,
28-
?string $leadingIcon = null,
29-
?string $inlineAddon = null,
30-
?string $trailingAddon = null,
31-
?string $trailingInlineAddon = null,
32-
?string $trailingIcon = null,
27+
string $leadingAddon = null,
28+
string $leadingIcon = null,
29+
string $inlineAddon = null,
30+
string $trailingAddon = null,
31+
string $trailingInlineAddon = null,
32+
string $trailingIcon = null,
3333

3434
// Select specific
3535
public bool $multiple = false,

src/Components/Inputs/Textarea.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
class Textarea extends Input
1010
{
1111
public function __construct(
12-
?string $name = null,
13-
?string $id = null,
12+
string $name = null,
13+
string $id = null,
1414
mixed $value = null,
15-
?string $containerClass = null,
16-
?string $size = null,
17-
?bool $showErrors = null,
15+
string $containerClass = null,
16+
string $size = null,
17+
bool $showErrors = null,
1818

1919
// Extra attributes
20-
null|HtmlString|array|string|Collection $extraAttributes = null,
20+
HtmlString|array|string|Collection $extraAttributes = null,
2121

2222
// Addons
23-
?string $leadingAddon = null,
24-
?string $leadingIcon = null,
25-
?string $inlineAddon = null,
26-
?string $trailingAddon = null,
27-
?string $trailingInlineAddon = null,
28-
?string $trailingIcon = null,
23+
string $leadingAddon = null,
24+
string $leadingIcon = null,
25+
string $inlineAddon = null,
26+
string $trailingAddon = null,
27+
string $trailingInlineAddon = null,
28+
string $trailingIcon = null,
2929

3030
// Textarea specific
3131
public ?bool $autoResize = null,

src/Components/Inputs/TimezoneSelect.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010
class TimezoneSelect extends Select
1111
{
1212
public function __construct(
13-
?string $name = null,
14-
?string $id = null,
13+
string $name = null,
14+
string $id = null,
1515
mixed $value = null,
16-
?string $containerClass = null,
17-
?string $size = null,
18-
?bool $showErrors = null,
16+
string $containerClass = null,
17+
string $size = null,
18+
bool $showErrors = null,
1919

2020
// Extra Attributes
21-
null|HtmlString|array|string|Collection $extraAttributes = null,
21+
HtmlString|array|string|Collection $extraAttributes = null,
2222

2323
// Addons
24-
?string $leadingAddon = null,
25-
?string $leadingIcon = null,
26-
?string $inlineAddon = null,
27-
?string $trailingAddon = null,
28-
?string $trailingInlineAddon = null,
29-
?string $trailingIcon = null,
24+
string $leadingAddon = null,
25+
string $leadingIcon = null,
26+
string $inlineAddon = null,
27+
string $trailingAddon = null,
28+
string $trailingInlineAddon = null,
29+
string $trailingIcon = null,
3030

3131
bool $multiple = false,
3232
array|Collection $options = [],
@@ -45,7 +45,7 @@ public function __construct(
4545
public ?string $optionSelectedIcon = null,
4646

4747
// Timezone specific
48-
null|array|string|bool $only = null,
48+
array|string|bool $only = null,
4949
) {
5050
parent::__construct(
5151
name: $name,

0 commit comments

Comments
 (0)