Skip to content

Commit 2c68dd7

Browse files
author
graschik
committed
Fixes for the Magento Coding Standard
1 parent e1ff41e commit 2c68dd7

File tree

25 files changed

+126
-23
lines changed

25 files changed

+126
-23
lines changed

Block/Adminhtml/Widget/Ui/Components.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ public function __construct(
9999
}
100100

101101
/**
102+
* Prepare element HTML
103+
*
104+
* @param AbstractElement $element
105+
* @return AbstractElement
102106
* @throws LocalizedException
103107
*/
104108
public function prepareElementHtml(AbstractElement $element): AbstractElement
@@ -123,6 +127,8 @@ public function prepareElementHtml(AbstractElement $element): AbstractElement
123127
}
124128

125129
/**
130+
* Generate metadata
131+
*
126132
* @param AbstractElement $element
127133
* @return MetadataInterface
128134
*/
@@ -142,6 +148,8 @@ protected function generateMetadata(AbstractElement $element): MetadataInterface
142148
}
143149

144150
/**
151+
* Get context
152+
*
145153
* @return ContextInterface
146154
* @throws LocalizedException
147155
*/
@@ -158,6 +166,8 @@ protected function getContext(): ContextInterface
158166
}
159167

160168
/**
169+
* Render ui components
170+
*
161171
* @param array $configuration
162172
* @return string
163173
*/
@@ -180,6 +190,8 @@ class="entry-edit form-inline widget-ui-components admin__fieldset"
180190
}
181191

182192
/**
193+
* Get scope
194+
*
183195
* @return string
184196
*/
185197
public function getScope(): string
@@ -188,6 +200,8 @@ public function getScope(): string
188200
}
189201

190202
/**
203+
* Wrap content
204+
*
191205
* @param string $content
192206
* @return string
193207
*/

Block/Widget/AbstractWidget.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ public function __construct(
3030
}
3131

3232
/**
33-
* @param $key
34-
* @param $index
33+
* Get data
34+
*
35+
* @param string $key
36+
* @param string|int $index
3537
* @return array|mixed|string|null
3638
*/
3739
public function getData($key = '', $index = null)

Block/Widget/ExampleOfUIComponents.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
class ExampleOfUIComponents extends AbstractWidget implements BlockInterface
99
{
1010
/**
11+
* Render block HTML
12+
*
1113
* @return string
1214
*/
1315
protected function _toHtml(): string
1416
{
1517
$data = $this->getData('component_data');
18+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1619
print_r($data);
1720

1821
return '';

Component/EntitiesSelector.php

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ public function __construct(
116116
}
117117

118118
/**
119+
* Init columns config
120+
*
119121
* @throws LocalizedException
120122
*/
121123
protected function _initColumnsConfig()
@@ -141,16 +143,15 @@ protected function _initColumnsConfig()
141143
}
142144

143145
/**
144-
* @return string
146+
* @inheritDoc
145147
*/
146148
public function getComponentName(): string
147149
{
148150
return static::NAME;
149151
}
150152

151153
/**
152-
* @inheritdoc
153-
* @throws LocalizedException
154+
* @inheritDoc
154155
*/
155156
public function prepare()
156157
{
@@ -163,6 +164,8 @@ public function prepare()
163164
}
164165

165166
/**
167+
* Get child components as array
168+
*
166169
* @return array
167170
* @throws LocalizedException
168171
*/
@@ -177,6 +180,8 @@ public function getChildComponentsAsArray(): array
177180
}
178181

179182
/**
183+
* Get grid component
184+
*
180185
* @return array
181186
* @throws LocalizedException
182187
*/
@@ -234,6 +239,8 @@ public function getGrid(): array
234239
}
235240

236241
/**
242+
* Fill meta
243+
*
237244
* @return array[]
238245
*/
239246
public function fillMeta(): array
@@ -252,6 +259,8 @@ public function fillMeta(): array
252259
}
253260

254261
/**
262+
* Get text column component
263+
*
255264
* @param string $columnName
256265
* @param array $columnConfig
257266
* @return array
@@ -282,6 +291,8 @@ public function getTextColumn(
282291
}
283292

284293
/**
294+
* Get thumbnail column component
295+
*
285296
* @param string $columnName
286297
* @param array $columnConfig
287298
* @return array
@@ -312,6 +323,8 @@ public function getThumbnailColumn(
312323
}
313324

314325
/**
326+
* Get action delete column component
327+
*
315328
* @return array
316329
*/
317330
public function getActionDeleteColumn(): array
@@ -337,6 +350,8 @@ public function getActionDeleteColumn(): array
337350
}
338351

339352
/**
353+
* Get position column component
354+
*
340355
* @return array
341356
*/
342357
public function getPositionColumn(): array
@@ -361,6 +376,8 @@ public function getPositionColumn(): array
361376
}
362377

363378
/**
379+
* Get button set component
380+
*
364381
* @return array
365382
* @throws LocalizedException
366383
*/
@@ -417,6 +434,8 @@ public function getButtonSet(): array
417434
}
418435

419436
/**
437+
* Get selections provider
438+
*
420439
* @return string
421440
* @throws LocalizedException
422441
*/
@@ -434,6 +453,8 @@ protected function getSelectionsProvider(): string
434453
}
435454

436455
/**
456+
* Get columns provider
457+
*
437458
* @return string
438459
* @throws LocalizedException
439460
*/
@@ -450,6 +471,8 @@ protected function getColumnsProvider(): string
450471
}
451472

452473
/**
474+
* Get external provider
475+
*
453476
* @return string
454477
* @throws LocalizedException
455478
*/
@@ -461,6 +484,8 @@ protected function getExternalProvider(): string
461484
}
462485

463486
/**
487+
* Get listing renderer component
488+
*
464489
* @return array
465490
* @throws LocalizedException
466491
*/
@@ -481,6 +506,8 @@ public function getListingRenderer(): array
481506
}
482507

483508
/**
509+
* Get generic modal component
510+
*
484511
* @return array
485512
* @throws LocalizedException
486513
*/
@@ -542,6 +569,8 @@ public function getGenericModal(): array
542569
}
543570

544571
/**
572+
* Get js modifier params
573+
*
545574
* @return array
546575
* @throws LocalizedException
547576
*/
@@ -561,6 +590,8 @@ public function getJsModifierParams(): array
561590
}
562591

563592
/**
593+
* Get generic modal buttons component
594+
*
564595
* @return array
565596
* @throws LocalizedException
566597
*/
@@ -604,6 +635,8 @@ public function getGenericModalButtons(): array
604635
}
605636

606637
/**
638+
* Get require config value by path
639+
*
607640
* @param string $path
608641
* @return array|mixed
609642
* @throws LocalizedException
@@ -623,6 +656,8 @@ public function getRequiredConfigValueByPath(string $path)
623656
}
624657

625658
/**
659+
* Get config by path
660+
*
626661
* @param string $path
627662
* @return array|mixed|null
628663
*/
@@ -632,6 +667,8 @@ public function getConfigByPath(string $path)
632667
}
633668

634669
/**
670+
* Generate uniq namespace
671+
*
635672
* @return string
636673
* @throws LocalizedException
637674
*/

Component/Widget/Form.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Form extends BaseForm
2727
* @param ContextInterface $context
2828
* @param FilterBuilder $filterBuilder
2929
* @param MetadataInterface $metadata
30+
* @param UiComponentFactory $uiComponentFactory
3031
* @param array $components
3132
* @param array $data
3233
*/
@@ -52,7 +53,7 @@ public function __construct(
5253
}
5354

5455
/**
55-
* @inheridoc
56+
* @inheritDoc
5657
*/
5758
public function prepare(): void
5859
{
@@ -80,6 +81,8 @@ public function prepare(): void
8081
}
8182

8283
/**
84+
* Get dataSource data
85+
*
8386
* @return array
8487
*/
8588
public function getDataSourceData(): array
@@ -88,6 +91,8 @@ public function getDataSourceData(): array
8891
}
8992

9093
/**
94+
* Get data provider
95+
*
9196
* @return DataProviderInterface
9297
*/
9398
public function getDataProvider(): DataProviderInterface

DataProvider/Widget/DataProvider.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class DataProvider extends ModifierPoolDataProvider implements DataProviderInter
1515
protected MetadataInterface $metadata;
1616

1717
/**
18-
* @param $name
18+
* @param string $name
1919
* @param array $meta
2020
* @param array $data
2121
* @param PoolInterface|null $pool
@@ -37,6 +37,8 @@ public function __construct(
3737
}
3838

3939
/**
40+
* Get data
41+
*
4042
* @return array
4143
*/
4244
public function getData(): array
@@ -45,16 +47,15 @@ public function getData(): array
4547
}
4648

4749
/**
48-
* @param MetadataInterface $metadata
49-
* @return void
50+
* @inheritDoc
5051
*/
5152
public function setMetadata(MetadataInterface $metadata): void
5253
{
5354
$this->metadata = $metadata;
5455
}
5556

5657
/**
57-
* @return MetadataInterface
58+
* @inheritDoc
5859
*/
5960
public function getMetadata(): MetadataInterface
6061
{

DataProvider/Widget/DataProviderInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99
interface DataProviderInterface extends BaseDataProviderInterface
1010
{
1111
/**
12+
* Set metadata
13+
*
1214
* @param MetadataInterface $metadata
1315
* @return mixed
1416
*/
1517
public function setMetadata(MetadataInterface $metadata): void;
1618

1719
/**
20+
* Get metadata
21+
*
1822
* @return MetadataInterface
1923
*/
2024
public function getMetadata(): MetadataInterface;

Model/DecodeComponentValue.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public function __construct(
4343
}
4444

4545
/**
46+
* Decode component value
47+
*
4648
* @param string $value
4749
* @return array
4850
*/

Model/JsConfiguration/ModifierComposite.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public function __construct(
2222
}
2323

2424
/**
25+
* Run modifiers
26+
*
2527
* @param array $configuration
2628
* @param ContextInterface $context
2729
* @param array $params

Model/JsConfiguration/ModifierInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
interface ModifierInterface
99
{
1010
/**
11+
* Run modifiers
12+
*
1113
* @param array $configuration
1214
* @param ContextInterface $context
1315
* @param array $params

0 commit comments

Comments
 (0)