Skip to content

Commit 3a7e198

Browse files
author
Shikha Mishra
authored
Merge branch '2.4-develop' into 28200_custom_attribute
2 parents 9d7f91e + ca1b5b6 commit 3a7e198

File tree

137 files changed

+3099
-2146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+3099
-2146
lines changed

app/code/Magento/Backend/Block/Widget/Grid/Column.php

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Backend\Block\Widget\Grid;
78

89
use Magento\Backend\Block\Widget;
@@ -46,7 +47,7 @@ class Column extends Widget
4647
protected $_cssClass = null;
4748

4849
/**
49-
* Renderer types
50+
* The renderer types
5051
*
5152
* @var array
5253
*/
@@ -74,7 +75,7 @@ class Column extends Widget
7475
];
7576

7677
/**
77-
* Filter types
78+
* The filter types
7879
*
7980
* @var array
8081
*/
@@ -103,6 +104,8 @@ class Column extends Widget
103104
protected $_isGrouped = false;
104105

105106
/**
107+
* Set property is grouped.
108+
*
106109
* @return void
107110
*/
108111
public function _construct()
@@ -169,7 +172,8 @@ public function getHtmlProperty()
169172
}
170173

171174
/**
172-
* Get Header html
175+
* This method get Header html.
176+
*
173177
* @return string
174178
*/
175179
public function getHeaderHtml()
@@ -222,7 +226,8 @@ public function setSortable($value)
222226
}
223227

224228
/**
225-
* Get header css class name
229+
* Get header css class name.
230+
*
226231
* @return string
227232
*/
228233
public function getHeaderCssClass()
@@ -234,6 +239,8 @@ public function getHeaderCssClass()
234239
}
235240

236241
/**
242+
* This method check if is sortable.
243+
*
237244
* @return bool
238245
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
239246
*/
@@ -256,6 +263,7 @@ public function addHeaderCssClass($className)
256263

257264
/**
258265
* Get header class names
266+
*
259267
* @return string
260268
*/
261269
public function getHeaderHtmlProperty()
@@ -291,6 +299,7 @@ public function getRowField(\Magento\Framework\DataObject $row)
291299
$frameCallback = $this->getFrameCallback();
292300
if (is_array($frameCallback)) {
293301
$this->validateFrameCallback($frameCallback);
302+
//phpcs:ignore Magento2.Functions.DiscouragedFunction
294303
$renderedValue = call_user_func($frameCallback, $renderedValue, $row, $this, false);
295304
}
296305

@@ -334,6 +343,7 @@ public function getRowFieldExport(\Magento\Framework\DataObject $row)
334343
$frameCallback = $this->getFrameCallback();
335344
if (is_array($frameCallback)) {
336345
$this->validateFrameCallback($frameCallback);
346+
//phpcs:ignore Magento2.Functions.DiscouragedFunction
337347
$renderedValue = call_user_func($frameCallback, $renderedValue, $row, $this, true);
338348
}
339349

@@ -412,12 +422,8 @@ public function setRendererType($type, $className)
412422
*/
413423
protected function _getRendererByType()
414424
{
415-
$type = strtolower($this->getType());
416-
$rendererClass = isset(
417-
$this->_rendererTypes[$type]
418-
) ? $this->_rendererTypes[$type] : $this->_rendererTypes['default'];
419-
420-
return $rendererClass;
425+
$type = strtolower((string) $this->getType());
426+
return $this->_rendererTypes[$type] ?? $this->_rendererTypes['default'];
421427
}
422428

423429
/**
@@ -469,10 +475,8 @@ public function setFilterType($type, $className)
469475
*/
470476
protected function _getFilterByType()
471477
{
472-
$type = $this->getFilterType() ? strtolower($this->getFilterType()) : strtolower($this->getType());
473-
$filterClass = isset($this->_filterTypes[$type]) ? $this->_filterTypes[$type] : $this->_filterTypes['default'];
474-
475-
return $filterClass;
478+
$type = $this->getFilterType() ? strtolower($this->getFilterType()) : strtolower((string) $this->getType());
479+
return $this->_filterTypes[$type] ?? $this->_filterTypes['default'];
476480
}
477481

478482
/**

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ protected function _convertDate($date)
233233
\IntlDateFormatter::NONE,
234234
$adminTimeZone
235235
);
236-
$simpleRes = new \DateTime(null, $adminTimeZone);
236+
$simpleRes = new \DateTime('now', $adminTimeZone);
237237
$simpleRes->setTimestamp($formatter->parse($date));
238238
$simpleRes->setTime(0, 0, 0);
239239
$simpleRes->setTimezone(new \DateTimeZone('UTC'));

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Concat.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ public function render(\Magento\Framework\DataObject $row)
3030
&& is_callable([$row, $method])
3131
&& substr_compare('get', $method, 1, 3) !== 0
3232
) {
33+
//phpcs:ignore Magento2.Functions.DiscouragedFunction
3334
$data = call_user_func([$row, $method]);
3435
} else {
3536
$data = $row->getData($method);
3637
}
37-
if (strlen($data) > 0) {
38+
if (strlen((string) $data) > 0) {
3839
$dataArr[] = $data;
3940
}
4041
}

app/code/Magento/Bundle/Model/Option/Validator.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ public function __construct(NotEmptyFactory $notEmptyFactory)
2626
}
2727

2828
/**
29+
* This method check is valid value.
30+
*
2931
* @param \Magento\Bundle\Model\Option $value
32+
*
3033
* @return boolean
3134
* @throws Zend_Validate_Exception If validation of $value is impossible
3235
*/
@@ -38,10 +41,12 @@ public function isValid($value)
3841
}
3942

4043
/**
44+
* This method validate required fields.
45+
*
4146
* @param \Magento\Bundle\Model\Option $value
47+
*
4248
* @return void
43-
* @throws Zend_Validate_Exception
44-
* @throws \Exception
49+
* @throws \Exception|Zend_Validate_Exception
4550
*/
4651
protected function validateRequiredFields($value)
4752
{
@@ -51,7 +56,7 @@ protected function validateRequiredFields($value)
5156
'type' => $value->getType()
5257
];
5358
foreach ($requiredFields as $requiredField => $requiredValue) {
54-
if (!$this->notEmpty->isValid(trim($requiredValue))) {
59+
if (!$this->notEmpty->isValid(trim((string) $requiredValue))) {
5560
$messages[$requiredField] =
5661
__('"%fieldName" is required. Enter and try again.', ['fieldName' => $requiredField]);
5762
}

0 commit comments

Comments
 (0)