diff --git a/src/Components/Choice/Checkbox.php b/src/Components/Choice/Checkbox.php index ebb52fa..ef346f5 100644 --- a/src/Components/Choice/Checkbox.php +++ b/src/Components/Choice/Checkbox.php @@ -14,11 +14,11 @@ class Checkbox extends BladeComponent public string $type = 'checkbox'; public function __construct( - public null | string $name = null, - public null | string $id = null, + public ?string $name = null, + public ?string $id = null, public mixed $value = null, - public null | string $label = null, - public null | string $description = '', + public ?string $label = null, + public ?string $description = '', public bool $checked = false, public $extraAttributes = '', ) { diff --git a/src/Components/Choice/CheckboxGroup.php b/src/Components/Choice/CheckboxGroup.php index 9e82c57..a83d011 100644 --- a/src/Components/Choice/CheckboxGroup.php +++ b/src/Components/Choice/CheckboxGroup.php @@ -6,7 +6,7 @@ class CheckboxGroup extends BladeComponent { - public function __construct(public bool $stacked = true, public int | string $gridCols = 3) + public function __construct(public bool $stacked = true, public int|string $gridCols = 3) { } } diff --git a/src/Components/Choice/SwitchToggle.php b/src/Components/Choice/SwitchToggle.php index 400cfa5..68a1be8 100644 --- a/src/Components/Choice/SwitchToggle.php +++ b/src/Components/Choice/SwitchToggle.php @@ -20,19 +20,19 @@ class SwitchToggle extends BladeComponent private string $labelId; public function __construct( - public null | string $name = null, - public null | string $id = null, + public ?string $name = null, + public ?string $id = null, public mixed $value = false, public mixed $onValue = true, public mixed $offValue = false, - public null | string $containerClass = null, + public ?string $containerClass = null, public bool $short = false, - public null | string $label = null, + public ?string $label = null, public string $labelPosition = 'right', - public null | string $offIcon = null, // doesn't apply to short mode - public null | string $onIcon = null, // doesn't apply to short mode - public null | string $buttonLabel = 'form-components::messages.switch_button_label', - public null | string $size = null, + public ?string $offIcon = null, // doesn't apply to short mode + public ?string $onIcon = null, // doesn't apply to short mode + public ?string $buttonLabel = 'form-components::messages.switch_button_label', + public ?string $size = null, public bool $disabled = false, public $extraAttributes = '', ) { diff --git a/src/Components/Files/FilePond.php b/src/Components/Files/FilePond.php index e1e7a3b..ab4beff 100644 --- a/src/Components/Files/FilePond.php +++ b/src/Components/Files/FilePond.php @@ -18,12 +18,12 @@ class FilePond extends BladeComponent public function __construct( public bool $multiple = false, public bool $allowDrop = true, - public null | string $name = null, + public ?string $name = null, public array $options = [], public bool $disabled = false, - public null | int $maxFiles = null, - null|string $type = null, - public null | string $description = null, + public ?int $maxFiles = null, + ?string $type = null, + public ?string $description = null, /* * When set to true, the component will watch for changes to the wire:model * and manually remove the files from the FilePond instance if they are diff --git a/src/Components/Files/FileUpload.php b/src/Components/Files/FileUpload.php index e111152..be29124 100644 --- a/src/Components/Files/FileUpload.php +++ b/src/Components/Files/FileUpload.php @@ -17,15 +17,16 @@ class FileUpload extends BladeComponent protected static array $assets = ['alpine']; - protected null|bool $canShowUploadProgress = null; - public null|string $label; + protected ?bool $canShowUploadProgress = null; + + public ?string $label; public function __construct( - public null | string $name = null, - public null | string $id = null, - null|string $label = 'form-components::messages.file_upload_label', + public ?string $name = null, + public ?string $id = null, + ?string $label = 'form-components::messages.file_upload_label', public bool $multiple = false, - null|string $type = null, + ?string $type = null, // Display the file upload progress if using livewire. // Only applies if a "wire:model" attribute is set. public bool $displayUploadProgress = true, @@ -39,7 +40,7 @@ public function __construct( $this->label = __($label); } - public function canShowUploadProgress($attributes): bool + public function canShowUploadProgress(): bool { if (! is_null($this->canShowUploadProgress)) { return $this->canShowUploadProgress; diff --git a/src/Components/FormError.php b/src/Components/FormError.php index 74540fb..549a622 100644 --- a/src/Components/FormError.php +++ b/src/Components/FormError.php @@ -7,8 +7,8 @@ class FormError extends BladeComponent { public function __construct( - public null | string $name = null, - public null | string $inputId = null, + public ?string $name = null, + public ?string $inputId = null, public string $bag = 'default', public string $tag = 'p', ) { diff --git a/src/Components/FormGroup.php b/src/Components/FormGroup.php index 79381b1..ef37613 100644 --- a/src/Components/FormGroup.php +++ b/src/Components/FormGroup.php @@ -11,16 +11,16 @@ class FormGroup extends BladeComponent public function __construct( public string $name = '', - public null | string | bool $label = null, - public null | string $inputId = null, + public null|string|bool $label = null, + public ?string $inputId = null, public bool $inline = false, bool $showErrors = true, - public null | string $helpText = null, + public ?string $helpText = null, public bool $border = true, public bool $isCheckboxGroup = false, - public null | string $labelId = null, + public ?string $labelId = null, public bool $marginBottom = true, - public null | string $hint = null, + public ?string $hint = null, public bool $optional = false, public bool $customSelectLabel = false, ) { diff --git a/src/Components/Inputs/DatePicker.php b/src/Components/Inputs/DatePicker.php index 2bf8e31..c24ff0f 100644 --- a/src/Components/Inputs/DatePicker.php +++ b/src/Components/Inputs/DatePicker.php @@ -8,13 +8,13 @@ class DatePicker extends Input { protected static array $assets = ['alpine', 'flatpickr']; - public null|string $placeholder; + public ?string $placeholder; public function __construct( - public null | string $name = null, - public null | string $id = null, + public ?string $name = null, + public ?string $id = null, public mixed $value = null, - public null | string $maxWidth = null, + public ?string $maxWidth = null, bool $showErrors = true, $leadingAddon = false, $inlineAddon = false, @@ -27,12 +27,12 @@ public function __construct( public bool $clickOpens = false, public bool $allowInput = true, public bool $enableTime = false, - public bool | null | string $format = false, + public bool|null|string $format = false, public bool $clearable = false, - null|string $placeholder = 'form-components::messages.date_picker_placeholder', - public bool | null | string $toggleIcon = null, - public null | string $clearIcon = null, - public null | string $containerClass = null, + ?string $placeholder = 'form-components::messages.date_picker_placeholder', + public bool|null|string $toggleIcon = null, + public ?string $clearIcon = null, + public ?string $containerClass = null, public $extraAttributes = '', public $after = null, ) { diff --git a/src/Components/Inputs/Input.php b/src/Components/Inputs/Input.php index d7241d7..22807af 100644 --- a/src/Components/Inputs/Input.php +++ b/src/Components/Inputs/Input.php @@ -28,13 +28,13 @@ class Input extends BladeComponent public const DEFAULT_TRAILING_ADDON_PADDING = 'pr-12'; public function __construct( - public null | string $name = null, - public null | string $id = null, + public ?string $name = null, + public ?string $id = null, public string $type = 'text', public mixed $value = null, - public null | string $maxWidth = null, + public ?string $maxWidth = null, bool $showErrors = true, - public null | string $containerClass = null, + public ?string $containerClass = null, $leadingAddon = false, $inlineAddon = false, $inlineAddonPadding = self::DEFAULT_INLINE_ADDON_PADDING, diff --git a/src/Components/Inputs/Password.php b/src/Components/Inputs/Password.php index 32f2342..827dfcb 100644 --- a/src/Components/Inputs/Password.php +++ b/src/Components/Inputs/Password.php @@ -9,22 +9,23 @@ class Password extends Input { protected static array $assets = ['alpine']; + protected bool $ignoreAddons = true; public function __construct( - public null | string $name = null, - public null | string $id = null, + public ?string $name = null, + public ?string $id = null, public mixed $value = null, - public null | string $maxWidth = null, + public ?string $maxWidth = null, bool $showErrors = true, $leadingAddon = false, $inlineAddon = false, $inlineAddonPadding = self::DEFAULT_INLINE_ADDON_PADDING, $leadingIcon = false, public bool $showToggle = true, - public null | string $showPasswordIcon = null, - public null | string $hidePasswordIcon = null, - public null | string $containerClass = null, + public ?string $showPasswordIcon = null, + public ?string $hidePasswordIcon = null, + public ?string $containerClass = null, public $extraAttributes = '', public $after = null, ) { diff --git a/src/Components/Inputs/Select.php b/src/Components/Inputs/Select.php index 3bdb3d5..2a10002 100644 --- a/src/Components/Inputs/Select.php +++ b/src/Components/Inputs/Select.php @@ -13,12 +13,12 @@ class Select extends Input public const DEFAULT_TRAILING_ADDON_PADDING = 'pr-14'; public function __construct( - public null | string $name = null, - public null | string $id = null, - public array | Collection $options = [], + public ?string $name = null, + public ?string $id = null, + public array|Collection $options = [], public mixed $value = null, public bool $multiple = false, - public null | string $maxWidth = null, + public ?string $maxWidth = null, bool $showErrors = true, $leadingAddon = false, $inlineAddon = false, @@ -27,7 +27,7 @@ public function __construct( $trailingAddon = false, $trailingAddonPadding = self::DEFAULT_TRAILING_ADDON_PADDING, $trailingIcon = false, - public null | string $containerClass = null, + public ?string $containerClass = null, public $extraAttributes = '', public $after = null, ) { diff --git a/src/Components/Inputs/TimezoneSelect.php b/src/Components/Inputs/TimezoneSelect.php index 65272c9..b4ce393 100644 --- a/src/Components/Inputs/TimezoneSelect.php +++ b/src/Components/Inputs/TimezoneSelect.php @@ -7,11 +7,11 @@ class TimezoneSelect extends Select { public function __construct( - public null|string $name = null, - public null|string $id = null, + public ?string $name = null, + public ?string $id = null, public mixed $value = null, public bool $multiple = false, - public null|string $maxWidth = null, // Native only + public ?string $maxWidth = null, // Native only bool $showErrors = true, $leadingAddon = false, // Native only $inlineAddon = false, // Native only @@ -25,14 +25,14 @@ public function __construct( public bool $searchable = true, public bool $optional = false, public bool|null|string $placeholder = null, - public null | string $containerClass = null, // Native only + public ?string $containerClass = null, // Native only public $extraAttributes = '', public $after = null, // Native only public int $minSelected = 1, - public null|int $maxSelected = null, + public ?int $maxSelected = null, public bool $disabled = false, - public null|string $clearIcon = null, - public null|bool $showCheckbox = null, + public ?string $clearIcon = null, + public ?bool $showCheckbox = null, public bool $autofocus = false, ) { parent::__construct( diff --git a/src/Components/Livewire/Concerns/HandlesSelectOptions.php b/src/Components/Livewire/Concerns/HandlesSelectOptions.php index 67c27cd..5f84981 100644 --- a/src/Components/Livewire/Concerns/HandlesSelectOptions.php +++ b/src/Components/Livewire/Concerns/HandlesSelectOptions.php @@ -9,9 +9,13 @@ trait HandlesSelectOptions use GetsSelectOptionProperties; public string $valueField = 'id'; + public string $labelField = 'name'; - public null|string $selectedLabelField = null; + + public ?string $selectedLabelField = null; + public string $disabledField = 'disabled'; + public string $isOptGroupField = 'is_opt_group'; public function handleSearch($search): void diff --git a/src/Components/Livewire/CustomSelect.php b/src/Components/Livewire/CustomSelect.php index 118006f..cafc359 100644 --- a/src/Components/Livewire/CustomSelect.php +++ b/src/Components/Livewire/CustomSelect.php @@ -13,26 +13,46 @@ abstract class CustomSelect extends Component { use HandlesSelectOptions; - public null|string $name = null; - public null|string $selectId = null; + public ?string $name = null; + + public ?string $selectId = null; + public $value; + public bool $multiple = false; + public int $minSelected = 1; - public null|int $maxSelected = null; + + public ?int $maxSelected = null; + public bool $disabled = false; - public null|string $labelledby = null; + + public ?string $labelledby = null; + public bool $searchable = true; + public bool $closeOnSelect = false; + public bool $autofocus = false; + public bool $optional = false; - public null|string $clearIcon = null; + + public ?string $clearIcon = null; + public bool|null|string $placeholder = null; + public bool|null|string $noOptionsText = null; + public bool|null|string $noResultsText = null; - public null|bool $showCheckbox = null; + + public ?bool $showCheckbox = null; + public $search = ''; + public $extraAttributes = ''; + public bool $showErrors = true; + public bool $defer = false; protected string $view = 'form-components::livewire.custom-select.custom-select'; diff --git a/src/Concerns/HasAddons.php b/src/Concerns/HasAddons.php index 66e219e..bc4a45d 100644 --- a/src/Concerns/HasAddons.php +++ b/src/Concerns/HasAddons.php @@ -10,12 +10,17 @@ trait HasAddons { public $leadingAddon; + public $inlineAddon; + public $inlineAddonPadding; + public $leadingIcon; public $trailingAddon; + public $trailingAddonPadding; + public $trailingIcon; protected function getAddonClass(): string @@ -57,7 +62,7 @@ protected function trailingAddonClass(): null|string * (e.g. instead of leading-addon="") * we need to set them in the render method as they don't get set in the constructor. * - * @param array $data + * @param array $data */ protected function setSlotAddonAttributes(array $data): void { diff --git a/src/Concerns/HasModels.php b/src/Concerns/HasModels.php index 89d0746..d022645 100644 --- a/src/Concerns/HasModels.php +++ b/src/Concerns/HasModels.php @@ -5,6 +5,7 @@ trait HasModels { protected $hasWireModel; + protected $hasXModel; public function hasBoundModel(): bool diff --git a/src/Dto/QuillOptions.php b/src/Dto/QuillOptions.php index 550b8ef..bf4d0a3 100644 --- a/src/Dto/QuillOptions.php +++ b/src/Dto/QuillOptions.php @@ -7,28 +7,48 @@ class QuillOptions { public string $theme = 'snow'; - public null|array $toolbar = null; + + public ?array $toolbar = null; // Toolbar options public bool|array $font = true; + public bool $size = true; + public bool $bold = true; + public bool $italic = true; + public bool $underline = true; + public bool $strike = true; + public bool|array $color = true; + public bool|array $background = true; + public bool $scripts = true; + public bool $codeBlock = true; + public bool $blockQuote = true; + public bool $orderedList = true; + public bool $unOrderedList = true; + public bool $indentText = true; + public bool $link = true; + public bool $image = false; + public bool $clearFormatting = true; + public bool $alignments = true; + public array $customToolbarButtons = []; + public array $toolbarHandlers = []; public static function defaults(): self diff --git a/src/FormComponents.php b/src/FormComponents.php index 79bc699..4eae44a 100644 --- a/src/FormComponents.php +++ b/src/FormComponents.php @@ -7,6 +7,7 @@ final class FormComponents { private array $styles = []; + private array $scripts = []; public function addStyle(string $style): void @@ -61,7 +62,7 @@ public function outputScripts(bool $force = false, $options = []): string * This will output the JavaScript necessary to run some components * such as CustomSelect. * - * @param array $options + * @param array $options * @return string */ public function javaScript(array $options = []): string diff --git a/src/Support/Timezone.php b/src/Support/Timezone.php index 96befcf..fc3a09e 100644 --- a/src/Support/Timezone.php +++ b/src/Support/Timezone.php @@ -108,7 +108,7 @@ protected function format(string $timezone): bool|string */ private function normalizeOffset(string $timezone, $offset): bool|string { - return match($timezone) { + return match ($timezone) { 'Africa/Juba' => '+02:00', 'Europe/Volgograd' => '+03:00', 'Australia/Currie' => false, diff --git a/tests/Components/Choice/CheckboxGroupTest.php b/tests/Components/Choice/CheckboxGroupTest.php index 66e0c19..ebceee6 100644 --- a/tests/Components/Choice/CheckboxGroupTest.php +++ b/tests/Components/Choice/CheckboxGroupTest.php @@ -25,7 +25,7 @@ public function can_be_not_stacked(): void /** @test */ public function can_have_a_custom_amount_of_grid_columns(): void { - $template = <<
checkbox 1
checkbox 2
diff --git a/tests/Components/Choice/CheckboxTest.php b/tests/Components/Choice/CheckboxTest.php index 40e4e9b..922d993 100644 --- a/tests/Components/Choice/CheckboxTest.php +++ b/tests/Components/Choice/CheckboxTest.php @@ -66,7 +66,7 @@ public function can_have_a_description(): void /** @test */ public function description_can_be_slotted(): void { - $template = << My description diff --git a/tests/Components/Choice/SwitchToggleTest.php b/tests/Components/Choice/SwitchToggleTest.php index f97649d..bfd2bc1 100644 --- a/tests/Components/Choice/SwitchToggleTest.php +++ b/tests/Components/Choice/SwitchToggleTest.php @@ -40,7 +40,7 @@ public function custom_attributes_are_applied_to_the_button(): void /** @test */ public function can_have_a_wire_model_instead_of_value(): void { - $template = << HTML; @@ -79,7 +79,7 @@ public function can_have_a_label_on_the_left(): void /** @test */ public function can_have_on_and_off_state_icons(): void { - $template = << off on diff --git a/tests/Components/Files/FileUploadTest.php b/tests/Components/Files/FileUploadTest.php index 7aec50d..6d6233b 100644 --- a/tests/Components/Files/FileUploadTest.php +++ b/tests/Components/Files/FileUploadTest.php @@ -38,7 +38,7 @@ public function can_have_wire_model_without_upload_progress(): void /** @test */ public function can_have_an_after_slot(): void { - $template = <<
After slot content...
@@ -57,7 +57,7 @@ public function can_have_an_after_slot(): void /** @test */ public function can_have_default_slotted_content(): void { - $template = <<
Default slot content...
@@ -80,8 +80,9 @@ public function shows_aria_attributes_on_error(): void /** * @test * @dataProvider acceptsTypes - * @param string $type - * @param string $expected + * + * @param string $type + * @param string $expected */ public function can_be_told_to_accept_certain_preset_types(string $type, string $expected): void { diff --git a/tests/Components/FormErrorTest.php b/tests/Components/FormErrorTest.php index 7e834e5..9c8cba3 100644 --- a/tests/Components/FormErrorTest.php +++ b/tests/Components/FormErrorTest.php @@ -20,11 +20,11 @@ public function it_can_be_slotted(): void { $this->withViewErrors(['first_name' => ['Incorrect first name.', 'Needs at least 5 characters.']]); - $template = <<
    - @foreach (\$component->messages(\$errors) as \$error) -
  • {{ \$error }}
  • + @foreach ($component->messages($errors) as $error) +
  • {{ $error }}
  • @endforeach
diff --git a/tests/Components/FormGroupTest.php b/tests/Components/FormGroupTest.php index 49d2595..0348de0 100644 --- a/tests/Components/FormGroupTest.php +++ b/tests/Components/FormGroupTest.php @@ -7,7 +7,7 @@ final class FormGroupTest extends ComponentTestCase /** @test */ public function can_be_rendered(): void { - $template = << Name input @@ -25,7 +25,7 @@ public function can_be_rendered(): void /** @test */ public function can_have_help_text(): void { - $template = << Name field @@ -40,7 +40,7 @@ public function can_have_help_text(): void /** @test */ public function help_text_can_be_slotted(): void { - $template = << Name field @@ -57,7 +57,7 @@ public function help_text_can_be_slotted(): void /** @test */ public function can_be_inline(): void { - $template = << Name field @@ -83,7 +83,7 @@ public function can_show_errors(): void { $this->withViewErrors(['name' => 'Name is required.']); - $template = << Name field @@ -99,7 +99,7 @@ public function can_show_errors(): void /** @test */ public function inline_checkbox_form_groups_labels_have_no_top_padding(): void { - $template = << Name field @@ -112,7 +112,7 @@ public function inline_checkbox_form_groups_labels_have_no_top_padding(): void /** @test */ public function label_can_be_omitted(): void { - $template = << Name field @@ -127,7 +127,7 @@ public function can_have_optional_help_text(): void { config()->set('form-components.optional_hint_text', 'Optional'); - $template = << @@ -143,7 +143,7 @@ public function can_have_optional_hint_when_inline(): void { config()->set('form-components.optional_hint_text', 'Optional'); - $template = << @@ -158,7 +158,7 @@ public function can_have_optional_hint_when_inline(): void /** @test */ public function can_have_custom_hint_text(): void { - $template = << diff --git a/tests/Components/FormTest.php b/tests/Components/FormTest.php index 30f3cf4..7b81b87 100644 --- a/tests/Components/FormTest.php +++ b/tests/Components/FormTest.php @@ -7,7 +7,7 @@ final class FormTest extends ComponentTestCase /** @test */ public function can_be_rendered(): void { - $template = << Form fields... @@ -24,7 +24,7 @@ public function can_be_rendered(): void /** @test */ public function the_method_can_be_set(): void { - $template = << Form fields... @@ -39,7 +39,7 @@ public function the_method_can_be_set(): void /** @test */ public function it_can_enable_file_uploads(): void { - $template = << Form fields... @@ -52,7 +52,7 @@ public function it_can_enable_file_uploads(): void /** @test */ public function spellcheck_can_be_enabled(): void { - $template = << Form fields... @@ -72,7 +72,8 @@ public function action_is_optional(): void /** * @test * @dataProvider formMethodsWithoutCsrf - * @param string $method + * + * @param string $method */ public function csrf_input_is_not_rendered_on_certain_form_methods(string $method): void { @@ -89,7 +90,7 @@ public function csrf_input_is_not_rendered_on_certain_form_methods(string $metho /** @test */ public function custom_attributes_can_be_applied(): void { - $template = << Form fields... diff --git a/tests/Components/Inputs/CustomSelectOptionTest.php b/tests/Components/Inputs/CustomSelectOptionTest.php index 00659c4..3aeffc8 100644 --- a/tests/Components/Inputs/CustomSelectOptionTest.php +++ b/tests/Components/Inputs/CustomSelectOptionTest.php @@ -19,7 +19,7 @@ public function can_render_component(): void /** @test */ public function is_aware_of_a_parent_select_name(): void { - $template = << @@ -34,7 +34,7 @@ public function is_aware_of_a_parent_select_name(): void /** @test */ public function can_render_a_checkbox_on_the_option(): void { - $template = << @@ -48,7 +48,7 @@ public function can_render_a_checkbox_on_the_option(): void /** @test */ public function checkbox_is_optional(): void { - $template = << @@ -62,7 +62,7 @@ public function checkbox_is_optional(): void /** @test */ public function label_can_be_slotted(): void { - $template = <<My custom label HTML; diff --git a/tests/Components/Inputs/CustomSelectTest.php b/tests/Components/Inputs/CustomSelectTest.php index a636207..3e0b31a 100644 --- a/tests/Components/Inputs/CustomSelectTest.php +++ b/tests/Components/Inputs/CustomSelectTest.php @@ -25,8 +25,8 @@ public function renders_an_array_of_options(): void ['id' => 'bar', 'name' => 'Bar'], ]; - $template = << + $template = <<<'HTML' + HTML; // By default, each option renders the label of an option in a tag. @@ -41,7 +41,7 @@ public function renders_an_array_of_options(): void /** @test */ public function can_render_slotted_options(): void { - $template = << @@ -110,7 +110,7 @@ public function hidden_inputs_are_rendered_without_a_wire_model_or_x_model_prese /** @test */ public function hidden_inputs_are_not_rendered_with_model_binding_present(): void { - $template = << HTML; diff --git a/tests/Components/Inputs/InputTest.php b/tests/Components/Inputs/InputTest.php index efba1c5..133a7ab 100644 --- a/tests/Components/Inputs/InputTest.php +++ b/tests/Components/Inputs/InputTest.php @@ -63,7 +63,7 @@ public function can_have_leading_addon(): void /** @test */ public function leading_addon_can_be_slotted(): void { - $template = << foo @@ -93,7 +93,7 @@ public function can_have_custom_inline_addon_padding(): void /** @test */ public function inline_addon_can_be_slotted(): void { - $template = << foo @@ -108,7 +108,7 @@ public function inline_addon_can_be_slotted(): void /** @test */ public function can_have_leading_icon(): void { - $template = << icon here @@ -124,7 +124,7 @@ public function can_have_leading_icon(): void public function only_renders_one_type_of_leading_addon(): void { // leading-addon should be the only one rendered. - $template = << icon here @@ -156,7 +156,7 @@ public function can_have_custom_trailing_addon_padding(): void /** @test */ public function trailing_addon_can_be_slotted(): void { - $template = << foo slotted @@ -173,7 +173,7 @@ public function trailing_addon_can_be_slotted(): void /** @test */ public function can_have_trailing_icon(): void { - $template = << icon here @@ -189,7 +189,7 @@ public function can_have_trailing_icon(): void public function will_only_render_one_type_of_trailing_addon(): void { // should only render the trailing-addon. - $template = << icon here @@ -205,7 +205,7 @@ public function will_only_render_one_type_of_trailing_addon(): void /** @test */ public function can_have_both_leading_and_trailing_addons(): void { - $template = << icon here @@ -288,7 +288,7 @@ public function name_can_be_omitted(): void /** @test */ public function can_have_custom_trailing_addon_markup(): void { - $template = <<
diff --git a/tests/Components/Inputs/PasswordTest.php b/tests/Components/Inputs/PasswordTest.php index 3541708..eb99604 100644 --- a/tests/Components/Inputs/PasswordTest.php +++ b/tests/Components/Inputs/PasswordTest.php @@ -51,7 +51,7 @@ public function it_ignores_trailing_addons(): void public function slotted_trailing_addons_are_ignored(): void { // Even if we try to specify a trailing addon, the component should render its toggle trailing addon instead. - $template = << trailing addon diff --git a/tests/Components/Inputs/SelectTest.php b/tests/Components/Inputs/SelectTest.php index 636aecf..51a376c 100644 --- a/tests/Components/Inputs/SelectTest.php +++ b/tests/Components/Inputs/SelectTest.php @@ -37,7 +37,7 @@ public function options_can_be_pre_selected(): void { $this->flashOld(['country' => 'usa']); - $template = << HTML; @@ -66,7 +66,7 @@ public function custom_attribute_values_can_be_used(): void $this->flashOld(['country' => 'usa']); // The "value" should be overridden by the flashed old input. - $template = << HTML; @@ -82,7 +82,7 @@ public function can_be_a_multi_select(): void { $this->flashOld(['country' => ['usa', 'mex']]); - $template = << HTML; @@ -107,7 +107,7 @@ public function it_indicates_it_has_an_error(): void { $this->withViewErrors(['country' => 'required']); - $template = << HTML; @@ -122,7 +122,7 @@ public function options_can_be_prepended_and_appended(): void { $this->flashOld(['country' => 'usa']); - $template = << diff --git a/tests/Components/Inputs/TreeSelectOptionTest.php b/tests/Components/Inputs/TreeSelectOptionTest.php index 95ecac4..08aa408 100644 --- a/tests/Components/Inputs/TreeSelectOptionTest.php +++ b/tests/Components/Inputs/TreeSelectOptionTest.php @@ -19,7 +19,7 @@ public function can_render_component(): void /** @test */ public function is_aware_of_parent_select_name(): void { - $template = << @@ -32,7 +32,7 @@ public function is_aware_of_parent_select_name(): void /** @test */ public function can_render_a_checkbox_on_the_option(): void { - $template = << @@ -46,7 +46,7 @@ public function can_render_a_checkbox_on_the_option(): void /** @test */ public function checkbox_is_optional(): void { - $template = << @@ -60,7 +60,7 @@ public function checkbox_is_optional(): void /** @test */ public function label_can_be_slotted(): void { - $template = <<My custom label HTML; @@ -78,9 +78,9 @@ public function renders_children_options(): void ['id' => 'child_2', 'name' => 'Child 2', 'children' => []], ]; - $template = << - + HTML; diff --git a/tests/Components/Inputs/TreeSelectTest.php b/tests/Components/Inputs/TreeSelectTest.php index 28979bb..64571cc 100644 --- a/tests/Components/Inputs/TreeSelectTest.php +++ b/tests/Components/Inputs/TreeSelectTest.php @@ -25,8 +25,8 @@ public function renders_an_array_of_options(): void ['id' => 'bar', 'name' => 'Bar'], ]; - $template = << + $template = <<<'HTML' + HTML; // By default, each option renders the label of an option in a tag. @@ -55,7 +55,7 @@ public function hidden_inputs_are_rendered_without_a_wire_model_or_x_model_prese /** @test */ public function hidden_inputs_are_not_rendered_with_model_binding_present(): void { - $template = << HTML; diff --git a/tests/Components/LabelTest.php b/tests/Components/LabelTest.php index c866aa2..f546637 100644 --- a/tests/Components/LabelTest.php +++ b/tests/Components/LabelTest.php @@ -17,7 +17,7 @@ public function can_be_rendered(): void /** @test */ public function a_custom_label_can_be_used(): void { - $template = << My custom label