3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+ declare (strict_types=1 );
6
7
7
8
namespace Magento \Ui \Model \Export ;
8
9
@@ -83,10 +84,11 @@ public function __construct(
83
84
* Returns Columns component
84
85
*
85
86
* @param UiComponentInterface $component
87
+ *
86
88
* @return UiComponentInterface
87
89
* @throws Exception
88
90
*/
89
- protected function getColumnsComponent (UiComponentInterface $ component )
91
+ protected function getColumnsComponent (UiComponentInterface $ component ): UiComponentInterface
90
92
{
91
93
foreach ($ component ->getChildComponents () as $ childComponent ) {
92
94
if ($ childComponent instanceof Columns) {
@@ -104,7 +106,7 @@ protected function getColumnsComponent(UiComponentInterface $component)
104
106
* @return UiComponentInterface[]
105
107
* @throws Exception
106
108
*/
107
- protected function getColumns (UiComponentInterface $ component )
109
+ protected function getColumns (UiComponentInterface $ component ): array
108
110
{
109
111
if (!isset ($ this ->columns [$ component ->getName ()])) {
110
112
$ columns = $ this ->getColumnsComponent ($ component );
@@ -114,6 +116,7 @@ protected function getColumns(UiComponentInterface $component)
114
116
}
115
117
}
116
118
}
119
+
117
120
return $ this ->columns [$ component ->getName ()];
118
121
}
119
122
@@ -125,7 +128,7 @@ protected function getColumns(UiComponentInterface $component)
125
128
* @return string[]
126
129
* @throws Exception
127
130
*/
128
- public function getHeaders (UiComponentInterface $ component )
131
+ public function getHeaders (UiComponentInterface $ component ): array
129
132
{
130
133
$ row = [];
131
134
foreach ($ this ->getColumns ($ component ) as $ column ) {
@@ -140,15 +143,16 @@ public function getHeaders(UiComponentInterface $component)
140
143
*
141
144
* @param UiComponentInterface $component
142
145
*
143
- * @return array
146
+ * @return string[]
144
147
* @throws Exception
145
148
*/
146
- public function getFields (UiComponentInterface $ component )
149
+ public function getFields (UiComponentInterface $ component ): array
147
150
{
148
151
$ row = [];
149
152
foreach ($ this ->getColumns ($ component ) as $ column ) {
150
153
$ row [] = $ column ->getName ();
151
154
}
155
+
152
156
return $ row ;
153
157
}
154
158
@@ -158,9 +162,10 @@ public function getFields(UiComponentInterface $component)
158
162
* @param DocumentInterface $document
159
163
* @param array $fields
160
164
* @param array $options
161
- * @return array
165
+ *
166
+ * @return string[]
162
167
*/
163
- public function getRowData (DocumentInterface $ document , $ fields , $ options )
168
+ public function getRowData (DocumentInterface $ document , $ fields , $ options ): array
164
169
{
165
170
$ row = [];
166
171
foreach ($ fields as $ column ) {
@@ -175,6 +180,7 @@ public function getRowData(DocumentInterface $document, $fields, $options)
175
180
$ row [] = $ document ->getCustomAttribute ($ column )->getValue ();
176
181
}
177
182
}
183
+
178
184
return $ row ;
179
185
}
180
186
@@ -184,9 +190,10 @@ public function getRowData(DocumentInterface $document, $fields, $options)
184
190
* @param array $list
185
191
* @param string $label
186
192
* @param array $output
193
+ *
187
194
* @return void
188
195
*/
189
- protected function getComplexLabel ($ list , $ label , &$ output )
196
+ protected function getComplexLabel ($ list , $ label , &$ output ): void
190
197
{
191
198
foreach ($ list as $ item ) {
192
199
if (!is_array ($ item ['value ' ])) {
@@ -228,7 +235,7 @@ protected function getOptionsArray(array $options): array
228
235
* @return array
229
236
* @throws LocalizedException
230
237
*/
231
- public function getOptions ()
238
+ public function getOptions (): array
232
239
{
233
240
return array_merge (
234
241
$ this ->getColumnOptions (),
@@ -243,7 +250,7 @@ public function getOptions()
243
250
* @throws LocalizedException
244
251
* @throws Exception
245
252
*/
246
- protected function getColumnOptions ()
253
+ protected function getColumnOptions (): array
247
254
{
248
255
$ options = [];
249
256
$ component = $ this ->filter ->getComponent ();
@@ -264,7 +271,7 @@ protected function getColumnOptions()
264
271
* @return array
265
272
* @throws LocalizedException
266
273
*/
267
- protected function getFilterOptions ()
274
+ protected function getFilterOptions (): array
268
275
{
269
276
$ options = [];
270
277
$ component = $ this ->filter ->getComponent ();
@@ -279,6 +286,7 @@ protected function getFilterOptions()
279
286
}
280
287
}
281
288
}
289
+
282
290
return $ options ;
283
291
}
284
292
@@ -287,10 +295,11 @@ protected function getFilterOptions()
287
295
*
288
296
* @param DocumentInterface $document
289
297
* @param string $componentName
298
+ *
290
299
* @return void
291
300
* @throws Exception
292
301
*/
293
- public function convertDate ($ document , $ componentName )
302
+ public function convertDate ($ document , $ componentName ): void
294
303
{
295
304
if (!isset ($ this ->data [$ componentName ])) {
296
305
return ;
0 commit comments