@@ -19,19 +19,15 @@ |
||
| 19 | 19 | use Nette\ComponentModel; |
| 20 | 20 | use Nette\Localization; |
| 21 | 21 | use Nette\Utils; |
| 22 | - |
|
| 23 | 22 | use IPub; |
| 24 | 23 | use IPub\Widgets\Decorators; |
| 25 | 24 | use IPub\Widgets\Entities; |
| 26 | 25 | use IPub\Widgets\Exceptions; |
| 27 | 26 | use IPub\Widgets\Widgets; |
| 28 | - |
|
| 29 | 27 | use IPub\Widgets\WidgetsManager; |
| 30 | 28 | use IPub\Widgets\FiltersManager; |
| 31 | 29 | use IPub\Widgets\DecoratorsManager; |
| 32 | 30 | |
| 33 | -use IPub\Packages; |
|
| 34 | - |
|
| 35 | 31 | /** |
| 36 | 32 | * Widgets container control definition |
| 37 | 33 | * |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $dir = dirname($this->getReflection()->getFileName()); |
| 160 | 160 | |
| 161 | 161 | // ...try to get base component template file |
| 162 | - $templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default.latte'; |
|
| 162 | + $templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR.'default.latte'; |
|
| 163 | 163 | $this->template->setFile($templateFile); |
| 164 | 164 | } |
| 165 | 165 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | $widget = $factory->create($data); |
| 288 | 288 | |
| 289 | 289 | // Add widget component to container/position |
| 290 | - $positionContainer->addComponent($widget, ($widget->getName() . spl_object_hash($data))); |
|
| 290 | + $positionContainer->addComponent($widget, ($widget->getName().spl_object_hash($data))); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /** |
@@ -14,9 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Widgets\Filter; |
| 16 | 16 | |
| 17 | -use Nette; |
|
| 18 | -use Nette\Application; |
|
| 19 | - |
|
| 20 | 17 | /** |
| 21 | 18 | * Widgets priority filter |
| 22 | 19 | * |
@@ -14,9 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Widgets\Filter; |
| 16 | 16 | |
| 17 | -use Nette; |
|
| 18 | -use Nette\Application; |
|
| 19 | - |
|
| 20 | 17 | /** |
| 21 | 18 | * Widgets status filter |
| 22 | 19 | * |
@@ -19,10 +19,8 @@ |
||
| 19 | 19 | use Nette\ComponentModel; |
| 20 | 20 | use Nette\Localization; |
| 21 | 21 | use Nette\Utils; |
| 22 | - |
|
| 23 | 22 | use IPub; |
| 24 | 23 | use IPub\Widgets; |
| 25 | -use IPub\Widgets\Decorators; |
|
| 26 | 24 | use IPub\Widgets\Entities; |
| 27 | 25 | use IPub\Widgets\Exceptions; |
| 28 | 26 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | // Widget data must be loaded |
| 80 | 80 | if (!$this->data instanceof Entities\IData) { |
| 81 | - throw new \LogicException('Missing call ' . get_called_class() . '::setData($entity)'); |
|
| 81 | + throw new \LogicException('Missing call '.get_called_class().'::setData($entity)'); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | return $this->data->getTitle(); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | // Widget data must be loaded |
| 93 | 93 | if (!$this->data instanceof Entities\IData) { |
| 94 | - throw new \LogicException('Missing call ' . get_called_class() . '::setData($entity)'); |
|
| 94 | + throw new \LogicException('Missing call '.get_called_class().'::setData($entity)'); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | return $this->data->getDescription(); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | { |
| 105 | 105 | // Widget data must be loaded |
| 106 | 106 | if (!$this->data instanceof Entities\IData) { |
| 107 | - throw new \LogicException('Missing call ' . get_called_class() . '::setData($entity)'); |
|
| 107 | + throw new \LogicException('Missing call '.get_called_class().'::setData($entity)'); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | return $this->data->getPriority(); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | // Widget data must be loaded |
| 119 | 119 | if (!$this->data instanceof Entities\IData) { |
| 120 | - throw new \LogicException('Missing call ' . get_called_class() . '::setData($entity)'); |
|
| 120 | + throw new \LogicException('Missing call '.get_called_class().'::setData($entity)'); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | return $this->data->getStatus(); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | // Widget data must be loaded |
| 132 | 132 | if (!$this->data instanceof Entities\IData) { |
| 133 | - throw new \LogicException('Missing call ' . get_called_class() . '::setData($entity)'); |
|
| 133 | + throw new \LogicException('Missing call '.get_called_class().'::setData($entity)'); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | return $this->data->getPosition(); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $dir = dirname($this->getReflection()->getFileName()); |
| 158 | 158 | |
| 159 | 159 | // ...try to get base component template file |
| 160 | - $templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default.latte'; |
|
| 160 | + $templateFile = $this->templateFile !== NULL && is_file($this->templateFile) ? $this->templateFile : $dir.DIRECTORY_SEPARATOR.'template'.DIRECTORY_SEPARATOR.'default.latte'; |
|
| 161 | 161 | $this->template->setFile($templateFile); |
| 162 | 162 | } |
| 163 | 163 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | ->render(); |
| 187 | 187 | |
| 188 | 188 | // Modify widget name |
| 189 | - $name = $name . mb_substr($this->data->getTitle(), $pos); |
|
| 189 | + $name = $name.mb_substr($this->data->getTitle(), $pos); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | // If widget name has subtitle... |
@@ -203,20 +203,20 @@ discard block |
||
| 203 | 203 | ->render(); |
| 204 | 204 | |
| 205 | 205 | // Split name to title & subtitle |
| 206 | - $name = $title . $subtitle; |
|
| 206 | + $name = $title.$subtitle; |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | // Set badge if exists |
| 210 | 210 | if ($badge = $this->data->getBadge()) { |
| 211 | 211 | $badge = Utils\Html::el('span') |
| 212 | - ->addAttributes(['class' => 'badge badge-' . $badge]) |
|
| 212 | + ->addAttributes(['class' => 'badge badge-'.$badge]) |
|
| 213 | 213 | ->render(); |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | // Set icon if exists |
| 217 | 217 | if ($icon = $this->data->getIcon()) { |
| 218 | 218 | $icon = Utils\Html::el('span') |
| 219 | - ->addAttributes(['class' => 'icon icon-' . $icon]) |
|
| 219 | + ->addAttributes(['class' => 'icon icon-'.$icon]) |
|
| 220 | 220 | ->render(); |
| 221 | 221 | } |
| 222 | 222 | |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Widgets\Exceptions; |
| 16 | 16 | |
| 17 | -class InvalidArgumentException extends \InvalidArgumentException implements IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +class InvalidArgumentException extends \InvalidArgumentException implements IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Widgets\Exceptions; |
| 16 | 16 | |
| 17 | -class DecoratorNotRegisteredException extends InvalidStateException {} |
|
| 17 | +class DecoratorNotRegisteredException extends InvalidStateException |
|
| 18 | +{ |
|
| 19 | +} |
|
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Widgets\Exceptions; |
| 16 | 16 | |
| 17 | -class WidgetLoadException extends \Exception implements IException {} |
|
| 17 | +class WidgetLoadException extends \Exception implements IException |
|
| 18 | +{ |
|
| 19 | +} |
|
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Widgets\Exceptions; |
| 16 | 16 | |
| 17 | -interface IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +interface IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Widgets\Exceptions; |
| 16 | 16 | |
| 17 | -class FileNotFoundException extends IOException implements IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +class FileNotFoundException extends IOException implements IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |