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 Nov 11, 2023
1 parent 9b5c301 commit 8862f53
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 25 deletions.
8 changes: 4 additions & 4 deletions src/Accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ public function run(): string
/**
* Renders collapsible items as specified on [[items]].
*
* @return string the rendering result.
*
* @throws InvalidConfigException if label isn't specified.
* @throws Exception
* @throws Throwable
*
* @return string the rendering result.
*/
public function renderItems(): string
{
Expand Down Expand Up @@ -191,11 +191,11 @@ public function renderItems(): string
* @param array $item a single item from [[items]].
* @param int $index the item index as each item group content must have an id.
*
* @return string the rendering result.
*
* @throws Exception
* @throws Throwable
* @throws InvalidConfigException
*
* @return string the rendering result.
*/
public function renderItem(string $header, array $item, int $index): string
{
Expand Down
20 changes: 10 additions & 10 deletions src/ActiveField.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function render($content = null): string
*
* @see https://getbootstrap.com/docs/5.1/forms/checks-radios/#switches
*/
public function checkbox($options = [], $enclosedByLabel = false): ActiveField
public function checkbox($options = [], $enclosedByLabel = false): self
{
$checkOptions = $this->checkOptions;
$options = ArrayHelper::merge($checkOptions, $options);
Expand Down Expand Up @@ -317,7 +317,7 @@ public function checkbox($options = [], $enclosedByLabel = false): ActiveField
/**
* {@inheritdoc}
*/
public function radio($options = [], $enclosedByLabel = false): ActiveField
public function radio($options = [], $enclosedByLabel = false): self
{
$checkOptions = $this->radioOptions;
$options = ArrayHelper::merge($checkOptions, $options);
Expand Down Expand Up @@ -354,7 +354,7 @@ public function radio($options = [], $enclosedByLabel = false): ActiveField
*
* @throws Exception
*/
public function checkboxList($items, $options = []): ActiveField
public function checkboxList($items, $options = []): self
{
if (!isset($options['item'])) {
$this->template = str_replace("\n{error}", '', $this->template);
Expand Down Expand Up @@ -398,7 +398,7 @@ public function checkboxList($items, $options = []): ActiveField
*
* @throws Exception
*/
public function radioList($items, $options = []): ActiveField
public function radioList($items, $options = []): self
{
if (!isset($options['item'])) {
$this->template = str_replace("\n{error}", '', $this->template);
Expand Down Expand Up @@ -440,7 +440,7 @@ public function radioList($items, $options = []): ActiveField
/**
* {@inheritdoc}
*/
public function listBox($items, $options = []): ActiveField
public function listBox($items, $options = []): self
{
if ($this->form->layout === ActiveForm::LAYOUT_INLINE) {
Html::removeCssClass($this->labelOptions, 'visually-hidden');
Expand All @@ -453,7 +453,7 @@ public function listBox($items, $options = []): ActiveField
/**
* {@inheritdoc}
*/
public function dropDownList($items, $options = []): ActiveField
public function dropDownList($items, $options = []): self

Check warning on line 456 in src/ActiveField.php

View check run for this annotation

Codecov / codecov/patch

src/ActiveField.php#L456

Added line #L456 was not covered by tests
{
if ($this->form->layout === ActiveForm::LAYOUT_INLINE) {
Html::removeCssClass($this->labelOptions, 'visually-hidden');

Check warning on line 459 in src/ActiveField.php

View check run for this annotation

Codecov / codecov/patch

src/ActiveField.php#L458-L459

Added lines #L458 - L459 were not covered by tests
Expand Down Expand Up @@ -488,7 +488,7 @@ public function staticControl(array $options = []): self
/**
* {@inheritdoc}
*/
public function label($label = null, $options = []): ActiveField
public function label($label = null, $options = []): self
{
if (is_bool($label)) {
$this->enableLabel = $label;
Expand Down Expand Up @@ -520,7 +520,7 @@ public function inline(bool $value = true): self
/**
* {@inheritdoc}
*/
public function fileInput($options = []): ActiveField
public function fileInput($options = []): self
{
Html::addCssClass($options, ['widget' => 'form-control']);

Expand All @@ -540,7 +540,7 @@ public function fileInput($options = []): ActiveField
*
* @see https://getbootstrap.com/docs/5.1/forms/range/
*/
public function rangeInput(array $options = []): ActiveField
public function rangeInput(array $options = []): self
{
Html::addCssClass($options, ['widget' => 'form-range']);

Expand All @@ -556,7 +556,7 @@ public function rangeInput(array $options = []): ActiveField
*
* @see https://getbootstrap.com/docs/5.1/forms/form-control/#color
*/
public function colorInput(array $options = []): ActiveField
public function colorInput(array $options = []): self
{
Html::removeCssClass($options, 'form-control');
Html::addCssClass($options, ['widget' => 'form-control form-control-color']);
Expand Down
1 change: 0 additions & 1 deletion src/BootstrapPluginAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace yii\bootstrap5;

use yii\web\AssetBundle;
use yii\bootstrap5\BootstrapAsset;

/**
* Twitter Bootstrap 5 JavaScript bundle.
Expand Down
2 changes: 1 addition & 1 deletion src/Breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function encodeLabels(bool $value): self
* If this property is not set, it will default to a link pointing with the label 'Home.'
* If this property is false, the home link will not be rendered.
*
* @param bool|array $value
* @param array|bool $value
*
* @return $this
*/
Expand Down
2 changes: 1 addition & 1 deletion src/ButtonDropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ protected function renderButton(): string
if (is_array($buttonOptions['href'])) {
$buttonOptions['href'] = Url::to($buttonOptions['href']);

Check warning on line 180 in src/ButtonDropdown.php

View check run for this annotation

Codecov / codecov/patch

src/ButtonDropdown.php#L179-L180

Added lines #L179 - L180 were not covered by tests
}
} else if ($this->tagName === 'a') {
} elseif ($this->tagName === 'a') {
$buttonOptions['href'] = '#';
$buttonOptions['role'] = 'button';

Check warning on line 184 in src/ButtonDropdown.php

View check run for this annotation

Codecov / codecov/patch

src/ButtonDropdown.php#L183-L184

Added lines #L183 - L184 were not covered by tests
}
Expand Down
4 changes: 2 additions & 2 deletions src/Carousel.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ public function renderItems(): string
* @param array|string $item a single item from [[items]]
* @param int $index the item index as the first item should be set to `active`
*
* @return string the rendering result
*@throws Exception
*
* @throws InvalidConfigException if the item is invalid
*
* @return string the rendering result
*/
public function renderItem(array|string $item, int $index): string
{
Expand Down
8 changes: 4 additions & 4 deletions src/Dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ public function init(): void
/**
* Renders the widget.
*
* @return string
*
* @throws InvalidConfigException
* @throws Throwable
*
* @return string
*/
public function run(): string
{
Expand All @@ -102,11 +102,11 @@ public function run(): string
* @param array $items the menu items to be rendered
* @param array $options the container HTML attributes
*
* @return string the rendering result.
*
* @throws Exception
* @throws Throwable
* @throws InvalidConfigException if the label option is not specified in one of the items.
*
* @return string the rendering result.
*/
protected function renderItems(array $items, array $options = []): string
{
Expand Down
4 changes: 2 additions & 2 deletions src/ToggleButtonGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ public function init(): void
/**
* {@inheritdoc}
*
* @return string
*
* @throws Exception
* @throws InvalidConfigException
*
* @return string
*/
public function run(): string
{
Expand Down

0 comments on commit 8862f53

Please sign in to comment.