Skip to content

Commit

Permalink
PHP Linting (Pint)
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk authored and github-actions[bot] committed Nov 17, 2023
1 parent 100d16a commit bfdc223
Show file tree
Hide file tree
Showing 40 changed files with 176 additions and 152 deletions.
6 changes: 3 additions & 3 deletions src/Components/Choice/Checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Checkbox extends BladeComponent
use HandlesValidationErrors {
ariaDescribedBy as validationAriaDescribedBy;
}
use HasModels;
use HasExtraAttributes;
use HasModels;

public string $type = 'checkbox';

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

// Extra Attributes
null|string|HtmlString|array|Collection $extraAttributes = null,
string|HtmlString|array|Collection $extraAttributes = null,
) {
$this->id = $id ?? $name;

Expand All @@ -57,7 +57,7 @@ public function inputClass(): string
]);
}

public function containerClass(?string $inputSize = null): string
public function containerClass(string $inputSize = null): string
{
// Input size from parent has priority over individual defined size.
if ($inputSize) {
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Choice/SwitchToggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
class SwitchToggle extends BladeComponent
{
use HandlesValidationErrors;
use HasModels;
use HasExtraAttributes;
use HasModels;

public function __construct(
public ?string $name = null,
Expand All @@ -35,7 +35,7 @@ public function __construct(
public bool $short = false,

// Extra Attributes
null|string|HtmlString|array|Collection $extraAttributes = null,
string|HtmlString|array|Collection $extraAttributes = null,
) {
$this->id = $id ?? $name;

Expand Down
8 changes: 4 additions & 4 deletions src/Components/Files/FilePond.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

class FilePond extends BladeComponent
{
use HandlesValidationErrors;
use AcceptsFiles;
use HandlesValidationErrors;
use HasExtraAttributes;
use HasModels;

Expand All @@ -28,11 +28,11 @@ public function __construct(
public ?int $maxFiles = null,
public ?array $options = null,
public ?string $description = null,
?string $type = null,
?bool $showErrors = null,
string $type = null,
bool $showErrors = null,

// Extra attributes
null|string|HtmlString|array|Collection $extraAttributes = null,
string|HtmlString|array|Collection $extraAttributes = null,
) {
$this->id = $id ?? $name;

Expand Down
10 changes: 5 additions & 5 deletions src/Components/Files/FileUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@

class FileUpload extends BladeComponent
{
use HandlesValidationErrors;
use AcceptsFiles;
use HasModels;
use HandlesValidationErrors;
use HasExtraAttributes;
use HasModels;

protected ?bool $canShowUploadProgress = null;

public function __construct(
public ?string $name = null,
public ?string $id = null,
public bool $multiple = false,
?string $type = null,
?bool $showErrors = null,
string $type = null,
bool $showErrors = null,
public ?bool $displayUploadProgress = null,
public ?string $size = null,
public ?string $containerClass = null,
public ?bool $useNativeProgressBar = null,

// Extra attributes
null|string|HtmlString|array|Collection $extraAttributes = null,
string|HtmlString|array|Collection $extraAttributes = null,
) {
$this->id = $id ?? $name;
$this->type = $type;
Expand Down
5 changes: 3 additions & 2 deletions src/Components/FormGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

namespace Rawilk\FormComponents\Components;

use function config;
use Illuminate\Support\Arr;
use Rawilk\FormComponents\Concerns\HandlesValidationErrors;

use function config;

class FormGroup extends BladeComponent
{
use HandlesValidationErrors;
Expand All @@ -15,7 +16,7 @@ public function __construct(
public ?string $inputId = null,
public null|bool|string $label = null,
public ?bool $inline = null,
?bool $showErrors = null,
bool $showErrors = null,
public ?string $helpText = null,
public bool $isCheckboxGroup = false,
public ?bool $marginBottom = null,
Expand Down
14 changes: 7 additions & 7 deletions src/Components/Inputs/CustomSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
class CustomSelect extends BladeComponent
{
use HandlesValidationErrors;
use HasAddons;
use HasExtraAttributes;
use HasModels;
use HasAddons;

public function __construct(
public ?string $name = null,
public ?string $id = null,
public mixed $value = null,
?bool $showErrors = null,
bool $showErrors = null,
public bool $multiple = false,
public array|Collection $options = [],
public ?string $size = null,
Expand All @@ -51,13 +51,13 @@ public function __construct(
public ?string $containerClass = null,

// Extra Attributes
null|string|HtmlString|array|Collection $extraAttributes = null,
string|HtmlString|array|Collection $extraAttributes = null,

// Addons
?string $leadingAddon = null,
?string $leadingIcon = null,
?string $inlineAddon = null,
?string $trailingAddon = null,
string $leadingAddon = null,
string $leadingIcon = null,
string $inlineAddon = null,
string $trailingAddon = null,
) {
$this->id = $id ?? $name;
$this->value = $name ? old($name, $value) : $value;
Expand Down
24 changes: 12 additions & 12 deletions src/Components/Inputs/DatePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
class DatePicker extends Input
{
public function __construct(
?string $name = null,
?string $id = null,
string $name = null,
string $id = null,
mixed $value = null,
?string $containerClass = null,
?string $size = null,
?bool $showErrors = null,
string $containerClass = null,
string $size = null,
bool $showErrors = null,

// Extra Attributes
null|HtmlString|array|string|Collection $extraAttributes = null,
HtmlString|array|string|Collection $extraAttributes = null,

// Addons
?string $leadingAddon = null,
?string $leadingIcon = null,
?string $inlineAddon = null,
?string $trailingAddon = null,
?string $trailingInlineAddon = null,
?string $trailingIcon = null,
string $leadingAddon = null,
string $leadingIcon = null,
string $inlineAddon = null,
string $trailingAddon = null,
string $trailingInlineAddon = null,
string $trailingIcon = null,

// Date picker specific
public array $options = [],
Expand Down
18 changes: 9 additions & 9 deletions src/Components/Inputs/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
class Input extends BladeComponent
{
use HandlesValidationErrors;
use HasAddons;
use HasExtraAttributes;
use HasModels;
use HasAddons;

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

// Extra Attributes
null|string|HtmlString|array|Collection $extraAttributes = null,
string|HtmlString|array|Collection $extraAttributes = null,

// Addons
?string $leadingAddon = null,
?string $leadingIcon = null,
?string $inlineAddon = null,
?string $trailingAddon = null,
?string $trailingInlineAddon = null,
?string $trailingIcon = null,
string $leadingAddon = null,
string $leadingIcon = null,
string $inlineAddon = null,
string $trailingAddon = null,
string $trailingInlineAddon = null,
string $trailingIcon = null,
) {
$this->id = $this->id ?? $this->name;
$this->value = $name ? old($name, $value) : $value;
Expand Down
24 changes: 12 additions & 12 deletions src/Components/Inputs/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
class Password extends Input
{
public function __construct(
?string $name = null,
?string $id = null,
string $name = null,
string $id = null,
mixed $value = null,
?string $containerClass = null,
?string $size = null,
?bool $showErrors = null,
string $containerClass = null,
string $size = null,
bool $showErrors = null,

// Extra Attributes
null|HtmlString|array|string|Collection $extraAttributes = null,
HtmlString|array|string|Collection $extraAttributes = null,

// Addons
?string $leadingAddon = null,
?string $leadingIcon = null,
?string $inlineAddon = null,
?string $trailingAddon = null,
?string $trailingInlineAddon = null,
?string $trailingIcon = null,
string $leadingAddon = null,
string $leadingIcon = null,
string $inlineAddon = null,
string $trailingAddon = null,
string $trailingInlineAddon = null,
string $trailingIcon = null,

// Password specific
public ?bool $showToggle = null,
Expand Down
24 changes: 12 additions & 12 deletions src/Components/Inputs/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ class Select extends Input
use GetsSelectOptionProperties;

public function __construct(
?string $name = null,
?string $id = null,
string $name = null,
string $id = null,
mixed $value = null,
?string $containerClass = null,
?string $size = null,
?bool $showErrors = null,
string $containerClass = null,
string $size = null,
bool $showErrors = null,

// Extra attributes
null|HtmlString|array|string|Collection $extraAttributes = null,
HtmlString|array|string|Collection $extraAttributes = null,

// Addons
?string $leadingAddon = null,
?string $leadingIcon = null,
?string $inlineAddon = null,
?string $trailingAddon = null,
?string $trailingInlineAddon = null,
?string $trailingIcon = null,
string $leadingAddon = null,
string $leadingIcon = null,
string $inlineAddon = null,
string $trailingAddon = null,
string $trailingInlineAddon = null,
string $trailingIcon = null,

// Select specific
public bool $multiple = false,
Expand Down
24 changes: 12 additions & 12 deletions src/Components/Inputs/Textarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
class Textarea extends Input
{
public function __construct(
?string $name = null,
?string $id = null,
string $name = null,
string $id = null,
mixed $value = null,
?string $containerClass = null,
?string $size = null,
?bool $showErrors = null,
string $containerClass = null,
string $size = null,
bool $showErrors = null,

// Extra attributes
null|HtmlString|array|string|Collection $extraAttributes = null,
HtmlString|array|string|Collection $extraAttributes = null,

// Addons
?string $leadingAddon = null,
?string $leadingIcon = null,
?string $inlineAddon = null,
?string $trailingAddon = null,
?string $trailingInlineAddon = null,
?string $trailingIcon = null,
string $leadingAddon = null,
string $leadingIcon = null,
string $inlineAddon = null,
string $trailingAddon = null,
string $trailingInlineAddon = null,
string $trailingIcon = null,

// Textarea specific
public ?bool $autoResize = null,
Expand Down
26 changes: 13 additions & 13 deletions src/Components/Inputs/TimezoneSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@
class TimezoneSelect extends Select
{
public function __construct(
?string $name = null,
?string $id = null,
string $name = null,
string $id = null,
mixed $value = null,
?string $containerClass = null,
?string $size = null,
?bool $showErrors = null,
string $containerClass = null,
string $size = null,
bool $showErrors = null,

// Extra Attributes
null|HtmlString|array|string|Collection $extraAttributes = null,
HtmlString|array|string|Collection $extraAttributes = null,

// Addons
?string $leadingAddon = null,
?string $leadingIcon = null,
?string $inlineAddon = null,
?string $trailingAddon = null,
?string $trailingInlineAddon = null,
?string $trailingIcon = null,
string $leadingAddon = null,
string $leadingIcon = null,
string $inlineAddon = null,
string $trailingAddon = null,
string $trailingInlineAddon = null,
string $trailingIcon = null,

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

// Timezone specific
null|array|string|bool $only = null,
array|string|bool $only = null,
) {
parent::__construct(
name: $name,
Expand Down
Loading

0 comments on commit bfdc223

Please sign in to comment.