Browse Source

Reformat code te be PSR-2 compatible

tags/2.0.0-beta
SonicGD 11 years ago
parent
commit
5cc2dc8dd4
  1. 2
      Alert.php
  2. 1
      Button.php
  3. 3
      ButtonDropdown.php
  4. 2
      ButtonGroup.php
  5. 3
      Carousel.php
  6. 1
      Collapse.php
  7. 3
      Modal.php
  8. 3
      Nav.php
  9. 1
      NavBar.php
  10. 3
      Progress.php
  11. 3
      Tabs.php
  12. 1
      Widget.php

2
Alert.php

@ -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
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;

1
Button.php

@ -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.

3
ButtonDropdown.php

@ -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
$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
$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);
} }
} }

2
ButtonGroup.php

@ -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
$buttons[] = $button; $buttons[] = $button;
} }
} }
return implode("\n", $buttons); return implode("\n", $buttons);
} }
} }

3
Carousel.php

@ -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
} }
$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
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']);
} }

1
Collapse.php

@ -59,7 +59,6 @@ class Collapse extends Widget
*/ */
public $items = []; public $items = [];
/** /**
* Initializes the widget. * Initializes the widget.
*/ */

3
Modal.php

@ -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
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
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;

3
Nav.php

@ -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
} }
} }
} }
return true; return true;
} }
return false; return false;
} }
} }

1
NavBar.php

@ -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',

3
Progress.php

@ -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
$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
'class' => 'sr-only' 'class' => 'sr-only'
]); ]);
$out .= Html::endTag('div'); $out .= Html::endTag('div');
return $out; return $out;
} }
} }

3
Tabs.php

@ -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
return true; return true;
} }
} }
return false; return false;
} }
@ -226,6 +226,7 @@ class Tabs extends Widget
unset($item); unset($item);
} }
return $itemActive; return $itemActive;
} }
} }

1
Widget.php

@ -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,

Loading…
Cancel
Save