| @@ -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; | 
| @@ -93,7 +93,7 @@ discard block | ||
| 93 | 93 | /** | 
| 94 | 94 | * @param string $ident The menu item identifier. | 
| 95 | 95 | * @throws InvalidArgumentException If the identifier argument is not a string. | 
| 96 | - * @return MenuItem Chainable | |
| 96 | + * @return AbstractMenuItem Chainable | |
| 97 | 97 | */ | 
| 98 | 98 | public function setIdent($ident) | 
| 99 | 99 |      { | 
| @@ -116,7 +116,7 @@ discard block | ||
| 116 | 116 | |
| 117 | 117 | /** | 
| 118 | 118 | * @param mixed $label The menu item label. | 
| 119 | - * @return MenuItem Chainable | |
| 119 | + * @return AbstractMenuItem Chainable | |
| 120 | 120 | */ | 
| 121 | 121 | public function setLabel($label) | 
| 122 | 122 |      { | 
| @@ -125,7 +125,7 @@ discard block | ||
| 125 | 125 | } | 
| 126 | 126 | |
| 127 | 127 | /** | 
| 128 | - * @return string | |
| 128 | + * @return \Charcoal\Translator\Translation|null | |
| 129 | 129 | */ | 
| 130 | 130 | public function label() | 
| 131 | 131 |      { | 
| @@ -134,7 +134,7 @@ discard block | ||
| 134 | 134 | |
| 135 | 135 | /** | 
| 136 | 136 | * @param string $url The menu item URL. | 
| 137 | - * @return MenuItem Chainable | |
| 137 | + * @return AbstractMenuItem Chainable | |
| 138 | 138 | */ | 
| 139 | 139 | public function setUrl($url) | 
| 140 | 140 |      { | 
| @@ -160,7 +160,7 @@ discard block | ||
| 160 | 160 | |
| 161 | 161 | /** | 
| 162 | 162 | * @param array $children The menu item children items structure. | 
| 163 | - * @return MenuItem Chainable | |
| 163 | + * @return AbstractMenuItem Chainable | |
| 164 | 164 | */ | 
| 165 | 165 | public function setChildren(array $children) | 
| 166 | 166 |      { | 
| @@ -174,7 +174,7 @@ discard block | ||
| 174 | 174 | /** | 
| 175 | 175 | * @param array|MenuItem $child The child menu structure or object. | 
| 176 | 176 | * @throws InvalidArgumentException If the child is not a menu object or structure. | 
| 177 | - * @return MenuItem Chainable | |
| 177 | + * @return AbstractMenuItem Chainable | |
| 178 | 178 | */ | 
| 179 | 179 | public function addChild($child) | 
| 180 | 180 |      { | 
| @@ -196,7 +196,7 @@ discard block | ||
| 196 | 196 | * Children (menu item) generator | 
| 197 | 197 | * | 
| 198 | 198 | * @param callable $childCallback Optional callback. | 
| 199 | - * @return MenuItemInterface[] | |
| 199 | + * @return \Generator | |
| 200 | 200 | */ | 
| 201 | 201 | public function children(callable $childCallback = null) | 
| 202 | 202 |      { | 
| @@ -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) { | 
| @@ -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) { |