diff --git a/src/BasicFormBuilder.php b/src/BasicFormBuilder.php index 1f44aff..54a7562 100644 --- a/src/BasicFormBuilder.php +++ b/src/BasicFormBuilder.php @@ -13,10 +13,7 @@ class BasicFormBuilder { - /** - * @var FormBuilder - */ - protected $builder; + protected FormBuilder $builder; public function __construct(FormBuilder $builder) { diff --git a/src/BootForm.php b/src/BootForm.php index 7492030..be1c72e 100644 --- a/src/BootForm.php +++ b/src/BootForm.php @@ -6,20 +6,11 @@ class BootForm { - /** - * @var BasicFormBuilder - */ - protected $builder; - - /** - * @var BasicFormBuilder - */ - protected $basicFormBuilder; - - /** - * @var HorizontalFormBuilder - */ - protected $horizontalFormBuilder; + protected BasicFormBuilder $builder; + + protected BasicFormBuilder $basicFormBuilder; + + protected HorizontalFormBuilder $horizontalFormBuilder; public function __construct(BasicFormBuilder $basicFormBuilder, HorizontalFormBuilder $horizontalFormBuilder) { diff --git a/src/BootFormsServiceProvider.php b/src/BootFormsServiceProvider.php index a3e47cd..ec580fd 100644 --- a/src/BootFormsServiceProvider.php +++ b/src/BootFormsServiceProvider.php @@ -10,9 +10,6 @@ class BootFormsServiceProvider extends ServiceProvider implements DeferrableProvider { - /** - * Register the service provider. - */ public function register() { $this->registerErrorStore(); diff --git a/src/Elements/CheckGroup.php b/src/Elements/CheckGroup.php index b0f30ff..a9b572c 100644 --- a/src/Elements/CheckGroup.php +++ b/src/Elements/CheckGroup.php @@ -7,14 +7,9 @@ class CheckGroup extends FormGroup { - protected $label; - - /** - * BootForm implementation. - * - * @var \TypiCMS\Form\Elements\Element - */ - protected $control; + protected Label $label; + + protected Element $control; public function __construct(Label $label, Element $control) { diff --git a/src/Elements/FormGroup.php b/src/Elements/FormGroup.php index dc5b017..980c365 100644 --- a/src/Elements/FormGroup.php +++ b/src/Elements/FormGroup.php @@ -7,25 +7,13 @@ class FormGroup extends Element { - /** - * @var Label - */ - protected $label; - - /** - * @var \TypiCMS\Form\Elements\Element - */ - protected $control; - - /** - * @var ?FormText - */ - protected $formText; - - /** - * @var ?InvalidFeedback - */ - protected $invalidFeedback; + protected Label $label; + + protected Element $control; + + protected ?FormText $formText = null; + + protected ?InvalidFeedback $invalidFeedback = null; public function __construct(Label $label, Element $control) { diff --git a/src/Elements/FormText.php b/src/Elements/FormText.php index 950a354..8a8b555 100644 --- a/src/Elements/FormText.php +++ b/src/Elements/FormText.php @@ -6,10 +6,7 @@ class FormText extends Element { - /** - * @var string - */ - private $message; + private string $message; public function __construct(string $message) { diff --git a/src/Elements/GroupWrapper.php b/src/Elements/GroupWrapper.php index 104dd5b..699a636 100644 --- a/src/Elements/GroupWrapper.php +++ b/src/Elements/GroupWrapper.php @@ -2,17 +2,13 @@ namespace TypiCMS\BootForms\Elements; +use TypiCMS\Form\Elements\Element; + class GroupWrapper { - /** - * @var FormGroup - */ - protected $formGroup; - - /** - * @var \TypiCMS\Form\Elements\Element - */ - protected $target; + protected FormGroup $formGroup; + + protected Element $target; public function __construct(FormGroup $formGroup) { diff --git a/src/Elements/HorizontalFormGroup.php b/src/Elements/HorizontalFormGroup.php index 86b4f40..5aa05b3 100644 --- a/src/Elements/HorizontalFormGroup.php +++ b/src/Elements/HorizontalFormGroup.php @@ -7,10 +7,7 @@ class HorizontalFormGroup extends FormGroup { - /** - * @var array - */ - protected $controlSizes; + protected array $controlSizes; public function __construct(Label $label, Element $control, array $controlSizes) { diff --git a/src/Elements/InputGroup.php b/src/Elements/InputGroup.php index 5e13061..e1061f5 100644 --- a/src/Elements/InputGroup.php +++ b/src/Elements/InputGroup.php @@ -6,15 +6,9 @@ class InputGroup extends Text { - /** - * @var array - */ - protected $beforeAddon = []; + protected array $beforeAddon = []; - /** - * @var array - */ - protected $afterAddon = []; + protected array $afterAddon = []; public function beforeAddon(string $addon): self { @@ -37,7 +31,7 @@ public function type(string $type): self return $this; } - protected function renderAddons(array $addons, string $class): string + protected function renderAddons(array $addons): string { $html = ''; @@ -51,9 +45,9 @@ protected function renderAddons(array $addons, string $class): string public function render(): string { $html = '
'; - $html .= $this->renderAddons($this->beforeAddon, 'prepend'); + $html .= $this->renderAddons($this->beforeAddon); $html .= parent::render(); - $html .= $this->renderAddons($this->afterAddon, 'append'); + $html .= $this->renderAddons($this->afterAddon); $html .= '
'; return $html; diff --git a/src/Elements/InvalidFeedback.php b/src/Elements/InvalidFeedback.php index d40e914..cbfc98f 100644 --- a/src/Elements/InvalidFeedback.php +++ b/src/Elements/InvalidFeedback.php @@ -6,10 +6,7 @@ class InvalidFeedback extends Element { - /** - * @var string - */ - private $message; + private string $message; public function __construct(string $message) { diff --git a/src/Elements/OffsetFormGroup.php b/src/Elements/OffsetFormGroup.php index 8e5acef..6396edb 100644 --- a/src/Elements/OffsetFormGroup.php +++ b/src/Elements/OffsetFormGroup.php @@ -4,15 +4,9 @@ class OffsetFormGroup { - /** - * @var mixed - */ - protected $control; - - /** - * @var array - */ - protected $columnSizes; + protected mixed $control; + + protected array $columnSizes; public function __construct(mixed $control, array $columnSizes) { diff --git a/src/HorizontalFormBuilder.php b/src/HorizontalFormBuilder.php index e059363..cc2fd46 100644 --- a/src/HorizontalFormBuilder.php +++ b/src/HorizontalFormBuilder.php @@ -11,15 +11,9 @@ class HorizontalFormBuilder extends BasicFormBuilder { - /** - * @var array - */ - protected $columnSizes; - - /** - * @var FormBuilder - */ - protected $builder; + protected array $columnSizes; + + protected FormBuilder $builder; public function __construct(FormBuilder $builder, array $columnSizes = ['lg' => [2, 10]]) {