Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Oct 20, 2023
1 parent dfbd972 commit 5f6e579
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/Accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Stringable;
use Yiisoft\Arrays\ArrayHelper;
use Yiisoft\Html\Html;

use function array_key_exists;
use function implode;
use function is_array;
Expand Down Expand Up @@ -96,8 +97,8 @@ public function getId(?string $suffix = '-accordion'): ?string
}

/**
* @return string
* @throws JsonException
* @return string
*/
public function render(): string
{
Expand Down
1 change: 1 addition & 0 deletions src/Collapse.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Stringable;
use Yiisoft\Arrays\ArrayHelper;
use Yiisoft\Html\Html;

use function array_key_exists;

/**
Expand Down
1 change: 1 addition & 0 deletions src/Modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Stringable;
use Yiisoft\Arrays\ArrayHelper;
use Yiisoft\Html\Html;

use function array_merge;

/**
Expand Down
7 changes: 3 additions & 4 deletions src/NavBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Yiisoft\Arrays\ArrayHelper;
use Yiisoft\Html\Html;
use Yiisoft\Html\Tag\Base\Tag;

use function array_merge;

/**
Expand Down Expand Up @@ -128,7 +129,7 @@ final class NavBar extends AbstractToggleWidget
private ?string $brandUrl = '/';
private array $brandOptions = [];
private string $screenReaderToggleText = 'Toggle navigation';
protected string|Stringable $toggleLabel = '<span class="navbar-toggler-icon"></span>';
protected string|Stringable $toggleLabel = '<span class="navbar-toggler-icon"></span>';
private bool $renderInnerContainer = true;
private array $innerContainerOptions = [];
private array $options = [];
Expand All @@ -152,11 +153,11 @@ protected function toggleComponent(): string
}

/**
* @return string
* @throws \Yiisoft\Definitions\Exception\CircularReferenceException
* @throws \Yiisoft\Definitions\Exception\InvalidConfigException
* @throws \Yiisoft\Definitions\Exception\NotInstantiableException
* @throws \Yiisoft\Factory\NotFoundException
* @return string
*/
public function begin(): string
{
Expand All @@ -173,7 +174,6 @@ public function begin(): string
}

if ($this->widget) {

[$tagName, $options, $encode] = $this->prepareToggleOptions();
unset(
$options['data-bs-target'],
Expand All @@ -192,7 +192,6 @@ public function begin(): string
])
)
->begin();

} else {
$widget = '';
}
Expand Down
4 changes: 1 addition & 3 deletions tests/ModalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ public static function sizeDataProvider(): array

/**
* @dataProvider sizeDataProvider
* @return void
* @throws \Yiisoft\Definitions\Exception\CircularReferenceException
* @throws \Yiisoft\Definitions\Exception\InvalidConfigException
* @throws \Yiisoft\Definitions\Exception\NotInstantiableException
Expand Down Expand Up @@ -604,15 +603,14 @@ public static function screenSizeDataProvider(): array
</div>
</div>
HTML,
]
],
];
}

/**
* @dataProvider screenSizeDataProvider
* @param string $size
* @param string $exprected
* @return void
* @throws \Yiisoft\Definitions\Exception\CircularReferenceException
* @throws \Yiisoft\Definitions\Exception\InvalidConfigException
* @throws \Yiisoft\Definitions\Exception\NotInstantiableException
Expand Down
7 changes: 2 additions & 5 deletions tests/NavBarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ public static function expandSizeDataProvider(): array

/**
* @dataProvider expandSizeDataProvider
* @return void
* @throws \Yiisoft\Definitions\Exception\CircularReferenceException
* @throws \Yiisoft\Definitions\Exception\InvalidConfigException
* @throws \Yiisoft\Definitions\Exception\NotInstantiableException
Expand All @@ -428,8 +427,8 @@ public static function expandSizeDataProvider(): array
public function testExpandSize(string $size, string $expected): void
{
$html = NavBar::widget()->options([
'id' => 'expanded-navbar',
])
'id' => 'expanded-navbar',
])
->expandSize($size)
->begin() . NavBar::end();

Expand Down Expand Up @@ -568,7 +567,6 @@ public static function colorThemeDataProvider(): array
* @dataProvider colorThemeDataProvider
* @param string $theme
* @param string $expected
* @return void
* @throws \Yiisoft\Definitions\Exception\CircularReferenceException
* @throws \Yiisoft\Definitions\Exception\InvalidConfigException
* @throws \Yiisoft\Definitions\Exception\NotInstantiableException
Expand Down Expand Up @@ -616,7 +614,6 @@ public static function toggleWidgetDataProvider(): array
* @dataProvider toggleWidgetDataProvider
* @param Collapse|Offcanvas|null $widget
* @param string $expected
* @return void
*/
public function testToggle(?string $widget, string $expected): void
{
Expand Down
5 changes: 2 additions & 3 deletions tests/OffcanvasTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ public static function placementDataProvider(): array

/**
* @dataProvider placementDataProvider
* @return void
* @throws \Yiisoft\Definitions\Exception\CircularReferenceException
* @throws \Yiisoft\Definitions\Exception\InvalidConfigException
* @throws \Yiisoft\Definitions\Exception\NotInstantiableException
Expand All @@ -258,8 +257,8 @@ public static function placementDataProvider(): array
public function testPlacement(string $placement, string $expected): void
{
$html = Offcanvas::widget()->options([
'id' => 'offcanvas-placement',
])
'id' => 'offcanvas-placement',
])
->placement($placement)
->begin() . Offcanvas::end();

Expand Down

0 comments on commit 5f6e579

Please sign in to comment.