@@ -33,11 +33,11 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function structure(); |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * Get the total number of rows |
|
| 38 | - * |
|
| 39 | - * @return integer |
|
| 40 | - */ |
|
| 36 | + /** |
|
| 37 | + * Get the total number of rows |
|
| 38 | + * |
|
| 39 | + * @return integer |
|
| 40 | + */ |
|
| 41 | 41 | public function numRows(); |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * @param FormInputBuilder $builder The builder, to create customized form input objects. |
| 77 | - * @return FormGroupInterface Chainable |
|
| 77 | + * @return FormGroupTrait Chainable |
|
| 78 | 78 | */ |
| 79 | 79 | protected function setFormInputBuilder(FormInputBuilder $builder) |
| 80 | 80 | { |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | 86 | * @param callable $cb The input callback. |
| 87 | - * @return FormGroupInterface Chainable |
|
| 87 | + * @return FormGroupTrait Chainable |
|
| 88 | 88 | */ |
| 89 | 89 | public function setInputCallback(callable $cb) |
| 90 | 90 | { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | 96 | * @param FormInterface $form The parent form object. |
| 97 | - * @return FormGroupInterface Chainable |
|
| 97 | + * @return FormGroupTrait Chainable |
|
| 98 | 98 | */ |
| 99 | 99 | public function setForm(FormInterface $form) |
| 100 | 100 | { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | 114 | * @param string $mode The l10n mode. |
| 115 | - * @return FormGroupInterface Chainable |
|
| 115 | + * @return FormGroupTrait Chainable |
|
| 116 | 116 | */ |
| 117 | 117 | public function setL10nMode($mode) |
| 118 | 118 | { |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | 132 | * @param array $inputs The group inputs. |
| 133 | - * @return FormGroupInterface Chainable |
|
| 133 | + * @return FormGroupTrait Chainable |
|
| 134 | 134 | */ |
| 135 | 135 | public function setInputs(array $inputs) |
| 136 | 136 | { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | * @param string $inputIdent The input identifier. |
| 146 | 146 | * @param array|FormInputInterface $input The input object or structure. |
| 147 | 147 | * @throws InvalidArgumentException If the ident argument is not a string or if the input is not valid. |
| 148 | - * @return FormGroupInterface Chainable |
|
| 148 | + * @return FormGroupTrait Chainable |
|
| 149 | 149 | */ |
| 150 | 150 | public function addInput($inputIdent, $input) |
| 151 | 151 | { |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * Form Input generator. |
| 176 | 176 | * |
| 177 | 177 | * @param callable $inputCallback Optional. Input callback. |
| 178 | - * @return FormGroupInterface[]|Generator |
|
| 178 | + * @return \Generator |
|
| 179 | 179 | */ |
| 180 | 180 | public function inputs(callable $inputCallback = null) |
| 181 | 181 | { |
@@ -195,7 +195,7 @@ |
||
| 195 | 195 | public function inputs(callable $inputCallback = null) |
| 196 | 196 | { |
| 197 | 197 | $groups = $this->groups; |
| 198 | - uasort($groups, [ $this, 'sortItemsByPriority' ]); |
|
| 198 | + uasort($groups, [$this, 'sortItemsByPriority']); |
|
| 199 | 199 | |
| 200 | 200 | $inputCallback = isset($inputCallback) ? $inputCallback : $this->inputCallback; |
| 201 | 201 | foreach ($inputs as $input) { |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | foreach ($layouts as $l) { |
| 58 | 58 | $loop = isset($l['loop']) ? (int)$l['loop'] : 1; |
| 59 | 59 | unset($l['loop']); |
| 60 | - for ($i=0; $i<$loop; $i++) { |
|
| 60 | + for ($i = 0; $i < $loop; $i++) { |
|
| 61 | 61 | $computedLayouts[] = $l; |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | } |
| 222 | 222 | $first = $this->rowFirstCellIndex($position); |
| 223 | 223 | |
| 224 | - return ($position - $first); |
|
| 224 | + return ($position-$first); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | /** |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | public function cellSpanBy12($position = null) |
| 264 | 264 | { |
| 265 | - $numColumns = $this->rowNumColumns($position); |
|
| 265 | + $numColumns = $this->rowNumColumns($position); |
|
| 266 | 266 | if (!$numColumns) { |
| 267 | 267 | return null; |
| 268 | 268 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param Container $container A Pimple DI container. |
| 36 | 36 | * @return LayoutFactory |
| 37 | 37 | */ |
| 38 | - $container['dashboard/factory'] = function (Container $container) { |
|
| 38 | + $container['dashboard/factory'] = function(Container $container) { |
|
| 39 | 39 | return new Factory([ |
| 40 | 40 | 'base_class' => DashboardInterface::class, |
| 41 | 41 | 'default_class' => GenericDashboard::class, |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * @param Container $container A Pimple DI container. |
| 56 | 56 | * @return LayoutBuilder |
| 57 | 57 | */ |
| 58 | - $container['dashboard/builder'] = function (Container $container) { |
|
| 58 | + $container['dashboard/builder'] = function(Container $container) { |
|
| 59 | 59 | $dashboardFactory = $container['dashboard/factory']; |
| 60 | 60 | $dashboardBuilder = new DashboardBuilder($dashboardFactory, $container); |
| 61 | 61 | return $dashboardBuilder; |
@@ -4,9 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Pimple\Container; |
| 6 | 6 | use Pimple\ServiceProviderInterface; |
| 7 | - |
|
| 8 | 7 | use Charcoal\Factory\GenericFactory as Factory; |
| 9 | - |
|
| 10 | 8 | use Charcoal\Ui\Dashboard\DashboardBuilder; |
| 11 | 9 | use Charcoal\Ui\Dashboard\DashboardInterface; |
| 12 | 10 | use Charcoal\Ui\Dashboard\GenericDashboard; |
@@ -152,7 +152,7 @@ |
||
| 152 | 152 | public function widgets(callable $widgetCallback = null) |
| 153 | 153 | { |
| 154 | 154 | $widgets = $this->widgets; |
| 155 | - uasort($widgets, [ $this, 'sortItemsByPriority' ]); |
|
| 155 | + uasort($widgets, [$this, 'sortItemsByPriority']); |
|
| 156 | 156 | |
| 157 | 157 | $widgetCallback = isset($widgetCallback) ? $widgetCallback : $this->widgetCallback; |
| 158 | 158 | foreach ($widgets as $widget) { |
@@ -160,7 +160,7 @@ |
||
| 160 | 160 | * Retrieve the dashboard's widgets. |
| 161 | 161 | * |
| 162 | 162 | * @param callable $widgetCallback A callback applied to each widget. |
| 163 | - * @return UiItemInterface[]|Generator |
|
| 163 | + * @return \Generator |
|
| 164 | 164 | */ |
| 165 | 165 | public function widgets(callable $widgetCallback = null) |
| 166 | 166 | { |
@@ -13,7 +13,6 @@ |
||
| 13 | 13 | use Charcoal\Ui\Form\FormBuilder; |
| 14 | 14 | use Charcoal\Ui\Form\FormInterface; |
| 15 | 15 | use Charcoal\Ui\Form\GenericForm; |
| 16 | -use Charcoal\Ui\FormGroup\FormGroupBuilder; |
|
| 17 | 16 | use Charcoal\Ui\FormGroup\FormGroupInterface; |
| 18 | 17 | use Charcoal\Ui\FormGroup\GenericFormGroup; |
| 19 | 18 | use Charcoal\Ui\FormInput\FormInputBuilder; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @param Container $container A Pimple DI container. |
| 35 | 35 | * @return LayoutFactory |
| 36 | 36 | */ |
| 37 | - $container['layout/factory'] = function () { |
|
| 37 | + $container['layout/factory'] = function() { |
|
| 38 | 38 | |
| 39 | 39 | $layoutFactory = new LayoutFactory(); |
| 40 | 40 | return $layoutFactory; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @param Container $container A Pimple DI container. |
| 45 | 45 | * @return LayoutBuilder |
| 46 | 46 | */ |
| 47 | - $container['layout/builder'] = function (Container $container) { |
|
| 47 | + $container['layout/builder'] = function(Container $container) { |
|
| 48 | 48 | $layoutFactory = $container['layout/factory']; |
| 49 | 49 | $layoutBuilder = new LayoutBuilder($layoutFactory, $container); |
| 50 | 50 | return $layoutBuilder; |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | public function items(callable $itemCallback = null) |
| 126 | 126 | { |
| 127 | 127 | $items = $this->items; |
| 128 | - uasort($items, [ $this, 'sortItemsByPriority' ]); |
|
| 128 | + uasort($items, [$this, 'sortItemsByPriority']); |
|
| 129 | 129 | |
| 130 | 130 | $itemCallback = isset($itemCallback) ? $itemCallback : $this->itemCallback; |
| 131 | 131 | foreach ($items as $item) { |
@@ -347,7 +347,7 @@ |
||
| 347 | 347 | public function groups(callable $groupCallback = null) |
| 348 | 348 | { |
| 349 | 349 | $groups = $this->groups; |
| 350 | - uasort($groups, [ $this, 'sortItemsByPriority' ]); |
|
| 350 | + uasort($groups, [$this, 'sortItemsByPriority']); |
|
| 351 | 351 | |
| 352 | 352 | $groupCallback = (isset($groupCallback) ? $groupCallback : $this->groupCallback); |
| 353 | 353 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | 113 | * @param FactoryInterface $factory A factory, to create customized form gorup objects. |
| 114 | - * @return FormInterface Chainable |
|
| 114 | + * @return FormTrait Chainable |
|
| 115 | 115 | */ |
| 116 | 116 | public function setFormGroupFactory(FactoryInterface $factory) |
| 117 | 117 | { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | /** |
| 139 | 139 | * @param callable $cb The group callback. |
| 140 | - * @return FormInterface Chainable |
|
| 140 | + * @return FormTrait Chainable |
|
| 141 | 141 | */ |
| 142 | 142 | public function setGroupCallback(callable $cb) |
| 143 | 143 | { |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | /** |
| 150 | 150 | * @param string $action The "action" value, typically a URL. |
| 151 | 151 | * @throws InvalidArgumentException If the action argument is not a string. |
| 152 | - * @return FormInterface Chainable |
|
| 152 | + * @return FormTrait Chainable |
|
| 153 | 153 | */ |
| 154 | 154 | public function setAction($action) |
| 155 | 155 | { |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * |
| 177 | 177 | * @param string $method Either "post" or "get". |
| 178 | 178 | * @throws InvalidArgumentException If the method is not post or get. |
| 179 | - * @return FormInterface Chainable |
|
| 179 | + * @return FormTrait Chainable |
|
| 180 | 180 | */ |
| 181 | 181 | public function setMethod($method) |
| 182 | 182 | { |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | /** |
| 203 | 203 | * @param string $mode The l10n mode. |
| 204 | - * @return FormInterface Chainable |
|
| 204 | + * @return FormTrait Chainable |
|
| 205 | 205 | */ |
| 206 | 206 | public function setL10nMode($mode) |
| 207 | 207 | { |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * Set the object's form groups. |
| 223 | 223 | * |
| 224 | 224 | * @param array $groups A collection of group structures. |
| 225 | - * @return FormInterface Chainable |
|
| 225 | + * @return FormTrait Chainable |
|
| 226 | 226 | */ |
| 227 | 227 | public function setGroups(array $groups) |
| 228 | 228 | { |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | * @param string $groupIdent The group identifier. |
| 280 | 280 | * @param array|FormGroupInterface $group The group object or structure. |
| 281 | 281 | * @throws InvalidArgumentException If the identifier is not a string or the group is invalid. |
| 282 | - * @return FormInterface Chainable |
|
| 282 | + * @return FormTrait Chainable |
|
| 283 | 283 | */ |
| 284 | 284 | public function addGroup($groupIdent, $group) |
| 285 | 285 | { |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | * Retrieve the form groups. |
| 400 | 400 | * |
| 401 | 401 | * @param callable $groupCallback Optional callback applied to each form group. |
| 402 | - * @return FormGroupInterface[]|Generator |
|
| 402 | + * @return \Generator |
|
| 403 | 403 | */ |
| 404 | 404 | public function groups(callable $groupCallback = null) |
| 405 | 405 | { |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | * |
| 521 | 521 | * @param string $mode Group display mode. |
| 522 | 522 | * @throws InvalidArgumentException If the display mode is not a string. |
| 523 | - * @return ObjectFormWidget Chainable. |
|
| 523 | + * @return FormTrait Chainable. |
|
| 524 | 524 | */ |
| 525 | 525 | public function setGroupDisplayMode($mode) |
| 526 | 526 | { |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | |
| 562 | 562 | /** |
| 563 | 563 | * @param array $formData The (pre-populated) form data, as [$key=>$val] array. |
| 564 | - * @return FormInterface Chainable |
|
| 564 | + * @return FormTrait Chainable |
|
| 565 | 565 | */ |
| 566 | 566 | public function setFormData(array $formData) |
| 567 | 567 | { |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | * @param string $key The form data key, or poperty identifier. |
| 575 | 575 | * @param mixed $val The form data value, for a given key. |
| 576 | 576 | * @throws InvalidArgumentException If the key argument is not a string. |
| 577 | - * @return FormInterface Chainable |
|
| 577 | + * @return FormTrait Chainable |
|
| 578 | 578 | */ |
| 579 | 579 | public function addFormData($key, $val) |
| 580 | 580 | { |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | } |
| 598 | 598 | |
| 599 | 599 | /** |
| 600 | - * @return FormWidget |
|
| 600 | + * @return FormTrait |
|
| 601 | 601 | */ |
| 602 | 602 | protected function formWidget() |
| 603 | 603 | { |