Skip to content

Commit 2cb115a

Browse files
committed
Fix static test failures
1 parent 47fd4c7 commit 2cb115a

File tree

18 files changed

+89
-41
lines changed

18 files changed

+89
-41
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Category/Helper/Image.php

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

3939
/**
40+
* Return the URL
41+
*
4042
* @return bool|string
4143
*/
4244
protected function _getUrl()

app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
class Product extends \Magento\Backend\Block\Widget\Grid\Extended
2020
{
2121
/**
22-
* Core registry
23-
*
2422
* @var \Magento\Framework\Registry
2523
*/
2624
protected $_coreRegistry = null;
@@ -66,6 +64,8 @@ public function __construct(
6664
}
6765

6866
/**
67+
* Initialise the block
68+
*
6969
* @return void
7070
*/
7171
protected function _construct()
@@ -77,6 +77,8 @@ protected function _construct()
7777
}
7878

7979
/**
80+
* Return the category from the core registry
81+
*
8082
* @return array|null
8183
*/
8284
public function getCategory()
@@ -85,6 +87,8 @@ public function getCategory()
8587
}
8688

8789
/**
90+
* Add a column filter to the collection
91+
*
8892
* @param Column $column
8993
* @return $this
9094
*/
@@ -108,13 +112,16 @@ protected function _addColumnFilterToCollection($column)
108112
}
109113

110114
/**
115+
* Prepare the collection
116+
*
111117
* @return Grid
112118
*/
113119
protected function _prepareCollection()
114120
{
115121
if ($this->getCategory()->getId()) {
116122
$this->setDefaultFilter(['in_category' => 1]);
117123
}
124+
118125
$collection = $this->_productFactory->create()->getCollection()->addAttributeToSelect(
119126
'name'
120127
)->addAttributeToSelect(
@@ -137,20 +144,24 @@ protected function _prepareCollection()
137144
if ($storeId > 0) {
138145
$collection->addStoreFilter($storeId);
139146
}
147+
140148
$this->setCollection($collection);
141149

142150
if ($this->getCategory()->getProductsReadonly()) {
143151
$productIds = $this->_getSelectedProducts();
144152
if (empty($productIds)) {
145153
$productIds = 0;
146154
}
155+
147156
$this->getCollection()->addFieldToFilter('entity_id', ['in' => $productIds]);
148157
}
149158

150159
return parent::_prepareCollection();
151160
}
152161

153162
/**
163+
* Prepare the columns
164+
*
154165
* @return Extended
155166
*/
156167
protected function _prepareColumns()
@@ -168,6 +179,7 @@ protected function _prepareColumns()
168179
]
169180
);
170181
}
182+
171183
$this->addColumn(
172184
'entity_id',
173185
[
@@ -228,6 +240,8 @@ protected function _prepareColumns()
228240
}
229241

230242
/**
243+
* Return the grid URL
244+
*
231245
* @return string
232246
*/
233247
public function getGridUrl()
@@ -236,6 +250,8 @@ public function getGridUrl()
236250
}
237251

238252
/**
253+
* Return the selected products
254+
*
239255
* @return array
240256
*/
241257
protected function _getSelectedProducts()
@@ -245,6 +261,7 @@ protected function _getSelectedProducts()
245261
$products = $this->getCategory()->getProductsPosition();
246262
return array_keys($products);
247263
}
264+
248265
return $products;
249266
}
250267
}

app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class Chooser extends \Magento\Catalog\Block\Adminhtml\Category\Tree
2525
protected $_template = 'Magento_Catalog::catalog/category/widget/tree.phtml';
2626

2727
/**
28+
* Initialise the block
29+
*
2830
* @return void
2931
*/
3032
protected function _construct()

app/code/Magento/Catalog/Block/Adminhtml/Form.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/**
8-
* Base block for rendering category and product forms
9-
*/
107
namespace Magento\Catalog\Block\Adminhtml;
118

129
use Magento\Backend\Block\Widget\Form\Generic;
1310

11+
/**
12+
* Base block for rendering category and product forms
13+
*/
1414
class Form extends Generic
1515
{
1616
/**
17+
* Prepare the layout
18+
*
1719
* @return void
1820
*/
1921
protected function _prepareLayout()

app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Config/DateFieldsOrder.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/**
8-
* Catalog Custom Options Config Renderer
9-
*/
107
namespace Magento\Catalog\Block\Adminhtml\Form\Renderer\Config;
118

129
use Magento\Config\Block\System\Config\Form\Field;
1310
use Magento\Framework\Data\Form\Element\AbstractElement;
1411

12+
/**
13+
* Catalog Custom Options Config Renderer
14+
*/
1515
class DateFieldsOrder extends Field
1616
{
1717
/**
18+
* Return the HTML for this element
19+
*
1820
* @param AbstractElement $element
1921
* @return string
2022
* @SuppressWarnings(PHPMD.NPathComplexity)

app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Config/YearRange.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/**
8-
* Catalog Custom Options Config Renderer
9-
*/
107
namespace Magento\Catalog\Block\Adminhtml\Form\Renderer\Config;
118

129
use Magento\Config\Block\System\Config\Form\Field;
1310
use Magento\Framework\Data\Form\Element\AbstractElement;
1411

12+
/**
13+
* Catalog Custom Options Config Renderer
14+
*/
1515
class YearRange extends Field
1616
{
1717
/**
18+
* Return the HTML for this element
19+
*
1820
* @param AbstractElement $element
1921
* @return string
2022
*/

app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Fieldset/Element.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class Element extends \Magento\Backend\Block\Widget\Form\Renderer\Fieldset\Element
1313
{
1414
/**
15-
* Initialize block template
15+
* @var string
1616
*/
1717
protected $_template = 'Magento_Catalog::catalog/form/renderer/fieldset/element.phtml';
1818

app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/**
8-
* Textarea attribute WYSIWYG content
9-
*/
107
namespace Magento\Catalog\Block\Adminhtml\Helper\Form\Wysiwyg;
118

129
use Magento\Backend\Block\Widget\Form;
1310
use Magento\Backend\Block\Widget\Form\Generic;
1411

1512
/**
16-
* Class Content
13+
* Textarea attribute WYSIWYG content
1714
*
1815
* @deprecated 101.0.8
1916
* @see \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav
@@ -44,7 +41,8 @@ public function __construct(
4441
}
4542

4643
/**
47-
* Prepare form.
44+
* Prepare the form
45+
*
4846
* Adding editor field to render
4947
*
5048
* @return Form

app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
class Attribute extends \Magento\Backend\Block\Widget\Grid\Container
1212
{
1313
/**
14+
* Initialise the block
15+
*
1416
* @return void
1517
*/
1618
protected function _construct()

app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Form.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/**
8-
* Product attribute add/edit form block
9-
*/
107
namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit;
118

129
use Magento\Backend\Block\Widget\Form\Generic;
1310
use Magento\Framework\Data\Form as DataForm;
1411

12+
/**
13+
* Product attribute add/edit form block
14+
*/
1515
class Form extends Generic
1616
{
1717
/**
18+
* Prepare the form
19+
*
1820
* @return $this
1921
*/
2022
protected function _prepareForm()

0 commit comments

Comments
 (0)