Skip to content

Commit

Permalink
style: fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
neilime committed Dec 20, 2023
1 parent 33ab455 commit cb97193
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 61 deletions.
2 changes: 1 addition & 1 deletion src/TwbsHelper/Form/View/Helper/FormRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/TwbsHelper/Form/View/Helper/FormRowElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ protected function getDefaultLabelPosition(\Laminas\Form\ElementInterface $eleme
return self::LABEL_APPEND;
}
// Default behaviour
// no break
default:
if ($labelPosition) {
return $labelPosition;
Expand Down
3 changes: 2 additions & 1 deletion src/TwbsHelper/Form/View/Helper/FormRows.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
) {
Expand Down
3 changes: 2 additions & 1 deletion src/TwbsHelper/View/Helper/GridColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
14 changes: 7 additions & 7 deletions src/TwbsHelper/View/Helper/Navigation/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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])) {
Expand Down
3 changes: 2 additions & 1 deletion src/TwbsHelper/View/Helper/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
32 changes: 16 additions & 16 deletions tests/TestSuite/Documentation/Tests/Components/Card/CardStyles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
// Variations
foreach (
[
'primary', 'secondary', 'success',
'info', 'warning', 'danger',
'primary', 'secondary', 'success',
'info', 'warning', 'danger',
] as $variant
) {
echo $view->formButton()->renderSpec([
Expand Down Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
3 changes: 1 addition & 2 deletions tests/TestSuite/TwbsHelper/Form/View/Helper/FormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit cb97193

Please sign in to comment.