Skip to content

Commit 6e1822d

Browse files
committed
Static Test Fix
1 parent 60e77f0 commit 6e1822d

File tree

5 files changed

+107
-25
lines changed

5 files changed

+107
-25
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ protected function _toLinkHtml($action, \Magento\Framework\DataObject $row)
104104
$this->_transformActionData($action, $actionCaption, $row);
105105

106106
if (isset($action['confirm'])) {
107+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
107108
$action['onclick'] = 'return window.confirm(\'' . addslashes(
108109
$this->escapeHtml($action['confirm'])
109110
) . '\')';
@@ -144,7 +145,7 @@ protected function _transformActionData(&$action, &$actionCaption, \Magento\Fram
144145
if (is_array($action['url']) && isset($action['field'])) {
145146
$params = [$action['field'] => $this->_getValue($row)];
146147
if (isset($action['url']['params'])) {
147-
$params = array_merge($action['url']['params'], $params);
148+
$params[] = $action['url']['params'];
148149
}
149150
$action['href'] = $this->getUrl($action['url']['base'], $params);
150151
unset($action['field']);

app/code/Magento/Backend/Helper/Dashboard/AbstractDashboard.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/**
99
* Adminhtml abstract dashboard helper.
1010
*
11+
* phpcs:disable Magento2.Classes.AbstractApi
1112
* @api
1213
* @since 100.0.2
1314
*/
@@ -28,6 +29,8 @@ abstract class AbstractDashboard extends \Magento\Framework\App\Helper\AbstractH
2829
protected $_params = [];
2930

3031
/**
32+
* Return collections
33+
*
3134
* @return array|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
3235
*/
3336
public function getCollection()
@@ -39,6 +42,8 @@ public function getCollection()
3942
}
4043

4144
/**
45+
* Init collections
46+
*
4247
* @return void
4348
*/
4449
abstract protected function _initCollection();
@@ -54,6 +59,8 @@ public function getItems()
5459
}
5560

5661
/**
62+
* Return items count
63+
*
5764
* @return int
5865
*/
5966
public function getCount()
@@ -62,6 +69,8 @@ public function getCount()
6269
}
6370

6471
/**
72+
* Return column
73+
*
6574
* @param string $index
6675
* @return array
6776
*/
@@ -85,6 +94,8 @@ public function getColumn($index)
8594
}
8695

8796
/**
97+
* Set params with value
98+
*
8899
* @param string $name
89100
* @param mixed $value
90101
* @return void
@@ -95,6 +106,8 @@ public function setParam($name, $value)
95106
}
96107

97108
/**
109+
* Set params
110+
*
98111
* @param array $params
99112
* @return void
100113
*/
@@ -104,6 +117,8 @@ public function setParams(array $params)
104117
}
105118

106119
/**
120+
* Get params with name
121+
*
107122
* @param string $name
108123
* @return mixed
109124
*/
@@ -117,6 +132,8 @@ public function getParam($name)
117132
}
118133

119134
/**
135+
* Get params
136+
*
120137
* @return array
121138
*/
122139
public function getParams()

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,22 @@
1111
use Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend;
1212
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;
1313
use Magento\Eav\Model\Entity\Attribute\UniqueValidationInterface;
14+
use Magento\Eav\Model\ResourceModel\Attribute\DefaultEntityAttributes\ProviderInterface as DefaultAttributesProvider;
1415
use Magento\Framework\App\Config\Element;
16+
use Magento\Framework\App\ObjectManager;
1517
use Magento\Framework\DataObject;
1618
use Magento\Framework\DB\Adapter\DuplicateException;
1719
use Magento\Framework\Exception\AlreadyExistsException;
1820
use Magento\Framework\Exception\LocalizedException;
1921
use Magento\Framework\Model\AbstractModel;
22+
use Magento\Framework\Model\ResourceModel\AbstractResource;
2023
use Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor;
2124
use Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface;
22-
use Magento\Eav\Model\ResourceModel\Attribute\DefaultEntityAttributes\ProviderInterface as DefaultAttributesProvider;
23-
use Magento\Framework\Model\ResourceModel\AbstractResource;
24-
use Magento\Framework\App\ObjectManager;
2525

2626
/**
2727
* Entity/Attribute/Model - entity abstract
2828
*
29+
* phpcs:disable Magento2.Classes.AbstractApi
2930
* @api
3031
* @author Magento Core Team <core@magentocommerce.com>
3132
* @SuppressWarnings(PHPMD.TooManyFields)
@@ -266,6 +267,8 @@ public function setConnection($connection)
266267
/**
267268
* Resource initialization
268269
*
270+
* phpcs:disable Magento2.CodeAnalysis.EmptyBlock
271+
*
269272
* @return void
270273
*/
271274
protected function _construct()
@@ -687,6 +690,7 @@ public function walkAttributes($partMethod, array $args = [], $collectExceptionM
687690
}
688691

689692
try {
693+
// phpcs:disable Magento2.Functions.DiscouragedFunction
690694
$results[$attrCode] = call_user_func_array([$instance, $method], $args);
691695
} catch (\Magento\Eav\Model\Entity\Attribute\Exception $e) {
692696
if ($collectExceptionMessages) {
@@ -826,9 +830,9 @@ public function getValueTablePrefix()
826830
$prefix = (string) $this->getEntityType()->getValueTablePrefix();
827831
if (!empty($prefix)) {
828832
$this->_valueTablePrefix = $prefix;
829-
/**
830-
* entity type prefix include DB table name prefix
831-
*/
833+
/**
834+
* entity type prefix include DB table name prefix
835+
*/
832836
//$this->_resource->getTableName($prefix);
833837
} else {
834838
$this->_valueTablePrefix = $this->getEntityTable();
@@ -991,9 +995,9 @@ public function getDefaultAttributeSourceModel()
991995
/**
992996
* Load entity's attributes into the object
993997
*
994-
* @param AbstractModel $object
995-
* @param int $entityId
996-
* @param array|null $attributes
998+
* @param AbstractModel $object
999+
* @param int $entityId
1000+
* @param array|null $attributes
9971001
* @return $this
9981002
*/
9991003
public function load($object, $entityId, $attributes = [])
@@ -1131,8 +1135,8 @@ protected function _getLoadAttributesSelect($object, $table)
11311135
/**
11321136
* Initialize attribute value for object
11331137
*
1134-
* @param DataObject $object
1135-
* @param array $valueRow
1138+
* @param DataObject $object
1139+
* @param array $valueRow
11361140
* @return $this
11371141
*/
11381142
protected function _setAttributeValue($object, $valueRow)
@@ -1237,7 +1241,7 @@ protected function _getOrigObject($object)
12371241
/**
12381242
* Aggregate Data for attributes that will be deleted
12391243
*
1240-
* @param array &$delete
1244+
* @param &array $delete
12411245
* @param AbstractAttribute $attribute
12421246
* @param AbstractEntity $object
12431247
* @return void
@@ -1248,6 +1252,7 @@ private function _aggregateDeleteData(&$delete, $attribute, $object)
12481252
if (!isset($delete[$tableName])) {
12491253
$delete[$tableName] = [];
12501254
}
1255+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
12511256
$delete[$tableName] = array_merge((array)$delete[$tableName], $valuesData);
12521257
}
12531258
}
@@ -1422,7 +1427,7 @@ protected function _prepareStaticValue($key, $value)
14221427
/**
14231428
* Save object collected data
14241429
*
1425-
* @param array $saveData array('newObject', 'entityRow', 'insert', 'update', 'delete')
1430+
* @param array $saveData array('newObject', 'entityRow', 'insert', 'update', 'delete')
14261431
* @return $this
14271432
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
14281433
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -1517,9 +1522,9 @@ protected function _processSaveData($saveData)
15171522
/**
15181523
* Insert entity attribute value
15191524
*
1520-
* @param DataObject $object
1521-
* @param AbstractAttribute $attribute
1522-
* @param mixed $value
1525+
* @param DataObject $object
1526+
* @param AbstractAttribute $attribute
1527+
* @param mixed $value
15231528
* @return $this
15241529
*/
15251530
protected function _insertAttribute($object, $attribute, $value)
@@ -1530,10 +1535,10 @@ protected function _insertAttribute($object, $attribute, $value)
15301535
/**
15311536
* Update entity attribute value
15321537
*
1533-
* @param DataObject $object
1534-
* @param AbstractAttribute $attribute
1535-
* @param mixed $valueId
1536-
* @param mixed $value
1538+
* @param DataObject $object
1539+
* @param AbstractAttribute $attribute
1540+
* @param mixed $valueId
1541+
* @param mixed $value
15371542
* @return $this
15381543
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
15391544
*/
@@ -1892,10 +1897,12 @@ protected function _getDefaultAttributes()
18921897
*/
18931898
public function getDefaultAttributes()
18941899
{
1895-
return array_unique(array_merge(
1896-
$this->_getDefaultAttributes(),
1897-
[$this->getEntityIdField(), $this->getLinkField()]
1898-
));
1900+
return array_unique(
1901+
array_merge(
1902+
$this->_getDefaultAttributes(),
1903+
[$this->getEntityIdField(), $this->getLinkField()]
1904+
)
1905+
);
18991906
}
19001907

19011908
/**

app/code/Magento/Rule/Model/Action/Collection.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Rule\Model\Action;
78

89
/**
10+
* Collections
11+
*
912
* @api
1013
* @since 100.0.2
1114
*/
@@ -61,6 +64,8 @@ public function asArray(array $arrAttributes = [])
6164
}
6265

6366
/**
67+
* Load array
68+
*
6469
* @param array $arr
6570
* @return $this
6671
*/
@@ -80,6 +85,8 @@ public function loadArray(array $arr)
8085
}
8186

8287
/**
88+
* Add actions
89+
*
8390
* @param ActionInterface $action
8491
* @return $this
8592
*/
@@ -99,6 +106,8 @@ public function addAction(ActionInterface $action)
99106
}
100107

101108
/**
109+
* As html
110+
*
102111
* @return string
103112
*/
104113
public function asHtml()
@@ -111,6 +120,8 @@ public function asHtml()
111120
}
112121

113122
/**
123+
* Return new child element
124+
*
114125
* @return $this
115126
*/
116127
public function getNewChildElement()
@@ -129,6 +140,8 @@ public function getNewChildElement()
129140
}
130141

131142
/**
143+
* Return as html recursive
144+
*
132145
* @return string
133146
*/
134147
public function asHtmlRecursive()
@@ -142,6 +155,8 @@ public function asHtmlRecursive()
142155
}
143156

144157
/**
158+
* Add string
159+
*
145160
* @param string $format
146161
* @return string
147162
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
@@ -153,6 +168,8 @@ public function asString($format = '')
153168
}
154169

155170
/**
171+
* Return string as recursive
172+
*
156173
* @param int $level
157174
* @return string
158175
*/
@@ -166,6 +183,8 @@ public function asStringRecursive($level = 0)
166183
}
167184

168185
/**
186+
* Process
187+
*
169188
* @return $this
170189
*/
171190
public function process()

0 commit comments

Comments
 (0)