diff --git a/src/TwbsHelper/Form/View/Helper/FormRow.php b/src/TwbsHelper/Form/View/Helper/FormRow.php index 72d169f05..adf4a7747 100644 --- a/src/TwbsHelper/Form/View/Helper/FormRow.php +++ b/src/TwbsHelper/Form/View/Helper/FormRow.php @@ -94,7 +94,7 @@ public function renderFormRow(\Laminas\Form\ElementInterface $element, string $e // Render form row $elementType = $element->getAttribute('type'); switch (true) { - // Inline form + // Inline form case $this->elementIsLayout($element, \TwbsHelper\Form\View\Helper\Form::LAYOUT_INLINE): // Form group disabled case $element->getOption('form_group') === false: diff --git a/src/TwbsHelper/Form/View/Helper/FormRowElement.php b/src/TwbsHelper/Form/View/Helper/FormRowElement.php index 66c83ece7..77b6eb452 100644 --- a/src/TwbsHelper/Form/View/Helper/FormRowElement.php +++ b/src/TwbsHelper/Form/View/Helper/FormRowElement.php @@ -232,6 +232,7 @@ protected function getDefaultLabelPosition(\Laminas\Form\ElementInterface $eleme return self::LABEL_APPEND; } // Default behaviour + // no break default: if ($labelPosition) { return $labelPosition; diff --git a/src/TwbsHelper/Form/View/Helper/FormRows.php b/src/TwbsHelper/Form/View/Helper/FormRows.php index eaad35f06..b23e78ea5 100644 --- a/src/TwbsHelper/Form/View/Helper/FormRows.php +++ b/src/TwbsHelper/Form/View/Helper/FormRows.php @@ -102,7 +102,8 @@ protected function renderElement( if ( $element->getOption('row_name') - && ($element instanceof \Laminas\Form\Element\Button + && ( + $element instanceof \Laminas\Form\Element\Button || $element instanceof \Laminas\Form\Element\Submit ) ) { diff --git a/src/TwbsHelper/View/Helper/GridColumn.php b/src/TwbsHelper/View/Helper/GridColumn.php index 3077e1c5f..3ce0516cc 100644 --- a/src/TwbsHelper/View/Helper/GridColumn.php +++ b/src/TwbsHelper/View/Helper/GridColumn.php @@ -96,7 +96,8 @@ protected function prepareAttributes(iterable $optionsAndAttributes): iterable $order = $optionsAndAttributes['order']; if ( !in_array($order, self::$allowedOrder) - && (!is_int($order) + && ( + !is_int($order) || $order < 1 || $order > 12 ) diff --git a/src/TwbsHelper/View/Helper/Navigation/Menu.php b/src/TwbsHelper/View/Helper/Navigation/Menu.php index 515e4d9ed..a4c298049 100644 --- a/src/TwbsHelper/View/Helper/Navigation/Menu.php +++ b/src/TwbsHelper/View/Helper/Navigation/Menu.php @@ -215,13 +215,13 @@ protected function getMenuItemsNavClasses(iterable $options, bool $isRoot): iter $classes = []; foreach ( [ - 'tabs' => 'nav-tabs', - 'pills' => 'nav-pills', - 'fill' => 'nav-fill', - 'justified' => 'nav-justified', - 'centered' => 'justify-content-center', - 'right_aligned' => 'justify-content-end', - 'vertical' => 'flex-column', + 'tabs' => 'nav-tabs', + 'pills' => 'nav-pills', + 'fill' => 'nav-fill', + 'justified' => 'nav-justified', + 'centered' => 'justify-content-center', + 'right_aligned' => 'justify-content-end', + 'vertical' => 'flex-column', ] as $option => $className ) { if (!empty($options[$option])) { diff --git a/src/TwbsHelper/View/Helper/ProgressBar.php b/src/TwbsHelper/View/Helper/ProgressBar.php index ee207677d..6867f27b8 100644 --- a/src/TwbsHelper/View/Helper/ProgressBar.php +++ b/src/TwbsHelper/View/Helper/ProgressBar.php @@ -46,7 +46,8 @@ public function renderProgressBarContent(iterable $optionsAndAttributes, bool $e $percent = $optionsAndAttributes['min'] === $optionsAndAttributes['max'] ? .0 : (float)( - ($current - $min) / ($max - $min)) * 100; + ($current - $min) / ($max - $min) + ) * 100; $attributes = $this->getView()->plugin('htmlattributes')->__invoke([ 'role' => 'progressbar', diff --git a/tests/TestSuite/Documentation/Tests/Components/Buttons/Examples.php b/tests/TestSuite/Documentation/Tests/Components/Buttons/Examples.php index 0696df777..17b23db3a 100644 --- a/tests/TestSuite/Documentation/Tests/Components/Buttons/Examples.php +++ b/tests/TestSuite/Documentation/Tests/Components/Buttons/Examples.php @@ -7,8 +7,8 @@ 'rendering' => function (\Laminas\View\Renderer\PhpRenderer $view) { foreach ( [ - 'primary', 'secondary', 'success', 'danger', - 'warning', 'info', 'light', 'dark', 'link', + 'primary', 'secondary', 'success', 'danger', + 'warning', 'info', 'light', 'dark', 'link', ] as $variant ) { echo $view->formButton()->renderSpec([ diff --git a/tests/TestSuite/Documentation/Tests/Components/Buttons/OutlineButtons.php b/tests/TestSuite/Documentation/Tests/Components/Buttons/OutlineButtons.php index 47930c6f9..05150d216 100644 --- a/tests/TestSuite/Documentation/Tests/Components/Buttons/OutlineButtons.php +++ b/tests/TestSuite/Documentation/Tests/Components/Buttons/OutlineButtons.php @@ -7,8 +7,8 @@ 'rendering' => function (\Laminas\View\Renderer\PhpRenderer $view) { foreach ( [ - 'primary', 'secondary', 'success', 'danger', - 'warning', 'info', 'light', 'dark', + 'primary', 'secondary', 'success', 'danger', + 'warning', 'info', 'light', 'dark', ] as $variant ) { echo $view->formButton()->renderSpec([ diff --git a/tests/TestSuite/Documentation/Tests/Components/Card/CardStyles.php b/tests/TestSuite/Documentation/Tests/Components/Card/CardStyles.php index 5a95e273e..589c6fe14 100644 --- a/tests/TestSuite/Documentation/Tests/Components/Card/CardStyles.php +++ b/tests/TestSuite/Documentation/Tests/Components/Card/CardStyles.php @@ -11,14 +11,14 @@ 'rendering' => function (\Laminas\View\Renderer\PhpRenderer $view) { foreach ( [ - ['primary', 'white'], - ['secondary', 'white'], - ['success', 'white'], - ['danger', 'white'], - ['warning', 'dark'], - ['info', 'dark'], - ['light', 'dark'], - ['dark', 'white'], + ['primary', 'white'], + ['secondary', 'white'], + ['success', 'white'], + ['danger', 'white'], + ['warning', 'dark'], + ['info', 'dark'], + ['light', 'dark'], + ['dark', 'white'], ] as [$variant, $text] ) { echo $view->card([ @@ -40,14 +40,14 @@ 'rendering' => function (\Laminas\View\Renderer\PhpRenderer $view) { foreach ( [ - ['primary', 'primary'], - ['secondary', 'secondary'], - ['success', 'success'], - ['danger', 'danger'], - ['warning', null], - ['info', null], - ['light', null], - ['dark', 'dark'], + ['primary', 'primary'], + ['secondary', 'secondary'], + ['success', 'success'], + ['danger', 'danger'], + ['warning', null], + ['info', null], + ['light', null], + ['dark', 'dark'], ] as [$variant, $body_variant] ) { echo $view->card( diff --git a/tests/TestSuite/Documentation/Tests/Components/Dropdowns/Examples.php b/tests/TestSuite/Documentation/Tests/Components/Dropdowns/Examples.php index 0d5b45007..814fa44f7 100644 --- a/tests/TestSuite/Documentation/Tests/Components/Dropdowns/Examples.php +++ b/tests/TestSuite/Documentation/Tests/Components/Dropdowns/Examples.php @@ -36,8 +36,8 @@ // Variations foreach ( [ - 'primary', 'secondary', 'success', - 'info', 'warning', 'danger', + 'primary', 'secondary', 'success', + 'info', 'warning', 'danger', ] as $variant ) { echo $view->formButton()->renderSpec([ @@ -66,8 +66,8 @@ 'rendering' => function (\Laminas\View\Renderer\PhpRenderer $view) { foreach ( [ - 'primary', 'secondary', 'success', - 'info', 'warning', 'danger', + 'primary', 'secondary', 'success', + 'info', 'warning', 'danger', ] as $variant ) { echo $view->formButton()->renderSpec([ diff --git a/tests/TestSuite/Documentation/Tests/Components/Dropdowns/MenuAlignment.php b/tests/TestSuite/Documentation/Tests/Components/Dropdowns/MenuAlignment.php index 76357b24b..aa8146b14 100644 --- a/tests/TestSuite/Documentation/Tests/Components/Dropdowns/MenuAlignment.php +++ b/tests/TestSuite/Documentation/Tests/Components/Dropdowns/MenuAlignment.php @@ -57,10 +57,10 @@ // Alignments foreach ( [ - 'Dropdown' => null, - 'Right-aligned menu' => 'end', - 'Left-aligned, right-aligned lg' => 'lg-end', - 'Right-aligned, left-aligned lg' => 'lg-start', + 'Dropdown' => null, + 'Right-aligned menu' => 'end', + 'Left-aligned, right-aligned lg' => 'lg-end', + 'Right-aligned, left-aligned lg' => 'lg-start', ] as $label => $alignment ) { echo $view->formButton()->renderSpec([ @@ -80,9 +80,9 @@ // Directions foreach ( [ - 'Dropstart' => 'start', - 'Dropend' => 'end', - 'Dropup' => 'up', + 'Dropstart' => 'start', + 'Dropend' => 'end', + 'Dropup' => 'up', ] as $label => $direction ) { echo $view->formButton()->renderSpec([ diff --git a/tests/TestSuite/Documentation/Tests/Components/Progress/Backgrounds.php b/tests/TestSuite/Documentation/Tests/Components/Progress/Backgrounds.php index 81d55add6..5f34a5f78 100644 --- a/tests/TestSuite/Documentation/Tests/Components/Progress/Backgrounds.php +++ b/tests/TestSuite/Documentation/Tests/Components/Progress/Backgrounds.php @@ -7,10 +7,10 @@ 'rendering' => function (\Laminas\View\Renderer\PhpRenderer $view) { foreach ( [ - 'success' => 25, - 'info' => 50, - 'warning' => 75, - 'danger' => 100, + 'success' => 25, + 'info' => 50, + 'warning' => 75, + 'danger' => 100, ] as $variant => $current ) { echo $view->progressBar([ diff --git a/tests/TestSuite/Documentation/Tests/Components/Progress/Striped.php b/tests/TestSuite/Documentation/Tests/Components/Progress/Striped.php index 3d0242806..cac4fd72d 100644 --- a/tests/TestSuite/Documentation/Tests/Components/Progress/Striped.php +++ b/tests/TestSuite/Documentation/Tests/Components/Progress/Striped.php @@ -7,11 +7,11 @@ 'rendering' => function (\Laminas\View\Renderer\PhpRenderer $view) { foreach ( [ - null => 10, - 'success' => 25, - 'info' => 50, - 'warning' => 75, - 'danger' => 100, + null => 10, + 'success' => 25, + 'info' => 50, + 'warning' => 75, + 'danger' => 100, ] as $variant => $current ) { echo $view->progressBar([ diff --git a/tests/TestSuite/Documentation/Tests/Components/Spinners/BorderSpinner.php b/tests/TestSuite/Documentation/Tests/Components/Spinners/BorderSpinner.php index 5db389701..b2a8cd766 100644 --- a/tests/TestSuite/Documentation/Tests/Components/Spinners/BorderSpinner.php +++ b/tests/TestSuite/Documentation/Tests/Components/Spinners/BorderSpinner.php @@ -14,8 +14,8 @@ 'rendering' => function (\Laminas\View\Renderer\PhpRenderer $view) { foreach ( [ - 'primary', 'secondary', 'success', 'danger', - 'warning', 'info', 'light', 'dark', + 'primary', 'secondary', 'success', 'danger', + 'warning', 'info', 'light', 'dark', ] as $variant ) { echo $view->spinner([ diff --git a/tests/TestSuite/Documentation/Tests/Components/Spinners/GrowingSpinner.php b/tests/TestSuite/Documentation/Tests/Components/Spinners/GrowingSpinner.php index 4021407f9..8e3b7fc4c 100644 --- a/tests/TestSuite/Documentation/Tests/Components/Spinners/GrowingSpinner.php +++ b/tests/TestSuite/Documentation/Tests/Components/Spinners/GrowingSpinner.php @@ -11,8 +11,8 @@ foreach ( [ - 'primary', 'secondary', 'success', 'danger', - 'warning', 'info', 'light', 'dark', + 'primary', 'secondary', 'success', 'danger', + 'warning', 'info', 'light', 'dark', ] as $variant ) { echo $view->spinner([ diff --git a/tests/TestSuite/Documentation/Tests/Components/Tooltips/Examples.php b/tests/TestSuite/Documentation/Tests/Components/Tooltips/Examples.php index d0263087c..14ef76262 100644 --- a/tests/TestSuite/Documentation/Tests/Components/Tooltips/Examples.php +++ b/tests/TestSuite/Documentation/Tests/Components/Tooltips/Examples.php @@ -7,10 +7,10 @@ 'rendering' => function (\Laminas\View\Renderer\PhpRenderer $view) { foreach ( [ - 'top' => 'Tooltip on top', - 'right' => 'Tooltip on right', - 'bottom' => 'Tooltip on bottom', - 'left' => 'Tooltip on left', + 'top' => 'Tooltip on top', + 'right' => 'Tooltip on right', + 'bottom' => 'Tooltip on bottom', + 'left' => 'Tooltip on left', ] as $placement => $label ) { echo $view->formButton()->renderSpec([ diff --git a/tests/TestSuite/TwbsHelper/Form/View/Helper/FormTest.php b/tests/TestSuite/TwbsHelper/Form/View/Helper/FormTest.php index 2fcd26f94..b711abdf2 100644 --- a/tests/TestSuite/TwbsHelper/Form/View/Helper/FormTest.php +++ b/tests/TestSuite/TwbsHelper/Form/View/Helper/FormTest.php @@ -41,8 +41,7 @@ public function testRenderEmptyForm() public function testInitializeAnHorizontalFormClass() { - $horizontalFormClass = new class () extends \Laminas\Form\Form - { + $horizontalFormClass = new class () extends \Laminas\Form\Form { public function prepare() { $this->setName('form');