Commit 5cc2dc8d authored by SonicGD's avatar SonicGD

Reformat code te be PSR-2 compatible

parent 99928844
...@@ -68,7 +68,6 @@ class Alert extends Widget ...@@ -68,7 +68,6 @@ class Alert extends Widget
*/ */
public $closeButton = []; public $closeButton = [];
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
...@@ -123,6 +122,7 @@ class Alert extends Widget ...@@ -123,6 +122,7 @@ class Alert extends Widget
if ($tag === 'button' && !isset($this->closeButton['type'])) { if ($tag === 'button' && !isset($this->closeButton['type'])) {
$this->closeButton['type'] = 'button'; $this->closeButton['type'] = 'button';
} }
return Html::tag($tag, $label, $this->closeButton); return Html::tag($tag, $label, $this->closeButton);
} else { } else {
return null; return null;
......
...@@ -39,7 +39,6 @@ class Button extends Widget ...@@ -39,7 +39,6 @@ class Button extends Widget
*/ */
public $encodeLabel = true; public $encodeLabel = true;
/** /**
* Initializes the widget. * Initializes the widget.
* If you override this method, make sure you call the parent implementation first. * If you override this method, make sure you call the parent implementation first.
......
...@@ -59,7 +59,6 @@ class ButtonDropdown extends Widget ...@@ -59,7 +59,6 @@ class ButtonDropdown extends Widget
*/ */
public $encodeLabel = true; public $encodeLabel = true;
/** /**
* Renders the widget. * Renders the widget.
*/ */
...@@ -100,6 +99,7 @@ class ButtonDropdown extends Widget ...@@ -100,6 +99,7 @@ class ButtonDropdown extends Widget
$options['data-toggle'] = 'dropdown'; $options['data-toggle'] = 'dropdown';
$splitButton = ''; $splitButton = '';
} }
return Button::widget([ return Button::widget([
'tagName' => $this->tagName, 'tagName' => $this->tagName,
'label' => $label, 'label' => $label,
...@@ -118,6 +118,7 @@ class ButtonDropdown extends Widget ...@@ -118,6 +118,7 @@ class ButtonDropdown extends Widget
$config = $this->dropdown; $config = $this->dropdown;
$config['clientOptions'] = false; $config['clientOptions'] = false;
$config['view'] = $this->getView(); $config['view'] = $this->getView();
return Dropdown::widget($config); return Dropdown::widget($config);
} }
} }
...@@ -52,7 +52,6 @@ class ButtonGroup extends Widget ...@@ -52,7 +52,6 @@ class ButtonGroup extends Widget
*/ */
public $encodeLabels = true; public $encodeLabels = true;
/** /**
* Initializes the widget. * Initializes the widget.
* If you override this method, make sure you call the parent implementation first. * If you override this method, make sure you call the parent implementation first.
...@@ -93,6 +92,7 @@ class ButtonGroup extends Widget ...@@ -93,6 +92,7 @@ class ButtonGroup extends Widget
$buttons[] = $button; $buttons[] = $button;
} }
} }
return implode("\n", $buttons); return implode("\n", $buttons);
} }
} }
...@@ -61,7 +61,6 @@ class Carousel extends Widget ...@@ -61,7 +61,6 @@ class Carousel extends Widget
*/ */
public $items = []; public $items = [];
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
...@@ -98,6 +97,7 @@ class Carousel extends Widget ...@@ -98,6 +97,7 @@ class Carousel extends Widget
} }
$indicators[] = Html::tag('li', '', $options); $indicators[] = Html::tag('li', '', $options);
} }
return Html::tag('ol', implode("\n", $indicators), ['class' => 'carousel-indicators']); return Html::tag('ol', implode("\n", $indicators), ['class' => 'carousel-indicators']);
} }
...@@ -111,6 +111,7 @@ class Carousel extends Widget ...@@ -111,6 +111,7 @@ class Carousel extends Widget
for ($i = 0, $count = count($this->items); $i < $count; $i++) { for ($i = 0, $count = count($this->items); $i < $count; $i++) {
$items[] = $this->renderItem($this->items[$i], $i); $items[] = $this->renderItem($this->items[$i], $i);
} }
return Html::tag('div', implode("\n", $items), ['class' => 'carousel-inner']); return Html::tag('div', implode("\n", $items), ['class' => 'carousel-inner']);
} }
......
...@@ -59,7 +59,6 @@ class Collapse extends Widget ...@@ -59,7 +59,6 @@ class Collapse extends Widget
*/ */
public $items = []; public $items = [];
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
......
...@@ -82,7 +82,6 @@ class Modal extends Widget ...@@ -82,7 +82,6 @@ class Modal extends Widget
*/ */
public $toggleButton; public $toggleButton;
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
...@@ -174,6 +173,7 @@ class Modal extends Widget ...@@ -174,6 +173,7 @@ class Modal extends Widget
if ($tag === 'button' && !isset($this->toggleButton['type'])) { if ($tag === 'button' && !isset($this->toggleButton['type'])) {
$this->toggleButton['type'] = 'button'; $this->toggleButton['type'] = 'button';
} }
return Html::tag($tag, $label, $this->toggleButton); return Html::tag($tag, $label, $this->toggleButton);
} else { } else {
return null; return null;
...@@ -192,6 +192,7 @@ class Modal extends Widget ...@@ -192,6 +192,7 @@ class Modal extends Widget
if ($tag === 'button' && !isset($this->closeButton['type'])) { if ($tag === 'button' && !isset($this->closeButton['type'])) {
$this->closeButton['type'] = 'button'; $this->closeButton['type'] = 'button';
} }
return Html::tag($tag, $label, $this->closeButton); return Html::tag($tag, $label, $this->closeButton);
} else { } else {
return null; return null;
......
...@@ -89,7 +89,6 @@ class Nav extends Widget ...@@ -89,7 +89,6 @@ class Nav extends Widget
*/ */
public $params; public $params;
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
...@@ -208,8 +207,10 @@ class Nav extends Widget ...@@ -208,8 +207,10 @@ class Nav extends Widget
} }
} }
} }
return true; return true;
} }
return false; return false;
} }
} }
...@@ -149,6 +149,7 @@ class NavBar extends Widget ...@@ -149,6 +149,7 @@ class NavBar extends Widget
{ {
$bar = Html::tag('span', '', ['class' => 'icon-bar']); $bar = Html::tag('span', '', ['class' => 'icon-bar']);
$screenReader = "<span class=\"sr-only\">{$this->screenReaderToggleText}</span>"; $screenReader = "<span class=\"sr-only\">{$this->screenReaderToggleText}</span>";
return Html::button("{$screenReader}\n{$bar}\n{$bar}\n{$bar}", [ return Html::button("{$screenReader}\n{$bar}\n{$bar}\n{$bar}", [
'class' => 'navbar-toggle', 'class' => 'navbar-toggle',
'data-toggle' => 'collapse', 'data-toggle' => 'collapse',
......
...@@ -89,7 +89,6 @@ class Progress extends Widget ...@@ -89,7 +89,6 @@ class Progress extends Widget
*/ */
public $bars; public $bars;
/** /**
* Initializes the widget. * Initializes the widget.
* If you override this method, make sure you call the parent implementation first. * If you override this method, make sure you call the parent implementation first.
...@@ -130,6 +129,7 @@ class Progress extends Widget ...@@ -130,6 +129,7 @@ class Progress extends Widget
$options = ArrayHelper::getValue($bar, 'options', []); $options = ArrayHelper::getValue($bar, 'options', []);
$bars[] = $this->renderBar($bar['percent'], $label, $options); $bars[] = $this->renderBar($bar['percent'], $label, $options);
} }
return implode("\n", $bars); return implode("\n", $bars);
} }
...@@ -158,6 +158,7 @@ class Progress extends Widget ...@@ -158,6 +158,7 @@ class Progress extends Widget
'class' => 'sr-only' 'class' => 'sr-only'
]); ]);
$out .= Html::endTag('div'); $out .= Html::endTag('div');
return $out; return $out;
} }
} }
...@@ -100,7 +100,6 @@ class Tabs extends Widget ...@@ -100,7 +100,6 @@ class Tabs extends Widget
*/ */
public $navType = 'nav-tabs'; public $navType = 'nav-tabs';
/** /**
* Initializes the widget. * Initializes the widget.
*/ */
...@@ -186,6 +185,7 @@ class Tabs extends Widget ...@@ -186,6 +185,7 @@ class Tabs extends Widget
return true; return true;
} }
} }
return false; return false;
} }
...@@ -226,6 +226,7 @@ class Tabs extends Widget ...@@ -226,6 +226,7 @@ class Tabs extends Widget
unset($item); unset($item);
} }
return $itemActive; return $itemActive;
} }
} }
...@@ -39,7 +39,6 @@ class Widget extends \yii\base\Widget ...@@ -39,7 +39,6 @@ class Widget extends \yii\base\Widget
*/ */
public $clientEvents = []; public $clientEvents = [];
/** /**
* Initializes the widget. * Initializes the widget.
* This method will register the bootstrap asset bundle. If you override this method, * This method will register the bootstrap asset bundle. If you override this method,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment