Skip to content

Commit 213392f

Browse files
Merge pull request #820 from magento-falcons/MAGETWO-64335
Task - MAGETWO-63764 [TD] Fix exceptions in Scope/Validator - MAGETWO-63216 [TD] Fix PHPDoc comments that was delivered in Sprint 4
2 parents 2e53cf0 + a75183f commit 213392f

File tree

36 files changed

+249
-72
lines changed

36 files changed

+249
-72
lines changed

app/code/Magento/Backend/Block/Template.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ public function getFormKey()
6363
}
6464

6565
/**
66-
* Check whether or not the module output is enabled
66+
* Check whether or not the module output is enabled.
6767
*
6868
* Because many module blocks belong to Backend module,
69-
* the feature "Disable module output" doesn't cover Admin area
69+
* the feature "Disable module output" doesn't cover Admin area.
7070
*
7171
* @param string $moduleName Full module name
7272
* @return boolean
73-
* @deprecated
73+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
7474
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
7575
*/
7676
public function isOutputEnabled($moduleName = null)

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<tab id="advanced" translate="label" sortOrder="999999">
1717
<label>Advanced</label>
1818
</tab>
19+
<!--
20+
@deprecated Magento does not support custom disabling/enabling modules output since 2.2.0 version.
21+
Section 'Advanced' was disabled. This section will be removed from code in one release.
22+
-->
1923
<section id="advanced" translate="label" type="text" sortOrder="910" showInDefault="0" showInWebsite="0" showInStore="0">
2024
<label>Advanced</label>
2125
<tab>advanced</tab>

app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Product/Options/AjaxTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ class AjaxTest extends \PHPUnit_Framework_TestCase
3131
/** @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject */
3232
protected $registry;
3333

34+
/**
35+
* @inheritdoc
36+
*/
3437
protected function setUp()
3538
{
3639
$this->context = $this->getMockBuilder(\Magento\Backend\Block\Context::class)

app/code/Magento/Catalog/Test/Unit/Block/Product/Widget/NewWidgetTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class NewWidgetTest extends \PHPUnit_Framework_TestCase
5252
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection|\PHPUnit_Framework_MockObject_MockObject */
5353
protected $productCollection;
5454

55+
/**
56+
* @inheritdoc
57+
*/
5558
protected function setUp()
5659
{
5760
$this->objectManager = new ObjectManagerHelper($this);
@@ -109,6 +112,9 @@ protected function setUp()
109112
);
110113
}
111114

115+
/**
116+
* @inheritdoc
117+
*/
112118
protected function tearDown()
113119
{
114120
$this->block = null;
@@ -168,6 +174,9 @@ public function testGetCurrentPage($pageNumber, $expectedResult)
168174
$this->assertEquals($expectedResult, $this->block->getCurrentPage());
169175
}
170176

177+
/**
178+
* @return array
179+
*/
171180
public function getCurrentPageDataProvider()
172181
{
173182
return [
@@ -184,6 +193,9 @@ public function testGetProductsCount()
184193
$this->assertEquals(2, $this->block->getProductsCount());
185194
}
186195

196+
/**
197+
* @return void
198+
*/
187199
protected function generalGetProductCollection()
188200
{
189201
$this->eventManager->expects($this->exactly(2))->method('dispatch')
@@ -327,6 +339,9 @@ public function testGetProductAllCollection($pagerEnable, $productsCount, $produ
327339
);
328340
}
329341

342+
/**
343+
* @return array
344+
*/
330345
public function getProductCollectionDataProvider()
331346
{
332347
return [

app/code/Magento/Checkout/Test/Unit/Block/Cart/Item/Renderer/ActionsTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class ActionsTest extends \PHPUnit_Framework_TestCase
2626
*/
2727
protected $layoutMock;
2828

29+
/**
30+
* @inheritdoc
31+
*/
2932
protected function setUp()
3033
{
3134
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);

app/code/Magento/Config/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,38 @@
33
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
/**
8-
* @method \Magento\Config\Block\System\Config\Form getForm()
9-
*/
106
namespace Magento\Config\Block\System\Config\Form\Fieldset\Modules;
117

128
/**
13-
* @deprecated
9+
* Displays a list of <select> tags with names of the modules on tab Stores > Configuration > Advanced / Advanced
10+
* on the store settings page.
11+
*
12+
* @method \Magento\Config\Block\System\Config\Form getForm()
13+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
1414
*/
1515
class DisableOutput extends \Magento\Config\Block\System\Config\Form\Fieldset
1616
{
1717
/**
1818
* @var \Magento\Framework\DataObject
19+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
1920
*/
2021
protected $_dummyElement;
2122

2223
/**
2324
* @var \Magento\Config\Block\System\Config\Form\Field
25+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
2426
*/
2527
protected $_fieldRenderer;
2628

2729
/**
2830
* @var array
31+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
2932
*/
3033
protected $_values;
3134

3235
/**
3336
* @var \Magento\Framework\Module\ModuleListInterface
37+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
3438
*/
3539
protected $_moduleList;
3640

@@ -53,8 +57,8 @@ public function __construct(
5357
}
5458

5559
/**
56-
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
57-
* @return string
60+
* {@inheritdoc}
61+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
5862
*/
5963
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
6064
{
@@ -83,6 +87,7 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele
8387
}
8488

8589
/**
90+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
8691
* @return \Magento\Framework\DataObject
8792
*/
8893
protected function _getDummyElement()
@@ -94,6 +99,7 @@ protected function _getDummyElement()
9499
}
95100

96101
/**
102+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
97103
* @return \Magento\Config\Block\System\Config\Form\Field
98104
*/
99105
protected function _getFieldRenderer()
@@ -107,6 +113,7 @@ protected function _getFieldRenderer()
107113
}
108114

109115
/**
116+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
110117
* @return array
111118
*/
112119
protected function _getValues()
@@ -123,6 +130,7 @@ protected function _getValues()
123130
/**
124131
* @param \Magento\Framework\Data\Form\Element\Fieldset $fieldset
125132
* @param string $moduleName
133+
* @deprecated Magento does not support custom disabling/enabling module output since 2.2.0 version
126134
* @return mixed
127135
*/
128136
protected function _getFieldHtml($fieldset, $moduleName)

app/code/Magento/Config/Model/Config/Parser/Comment.php

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
use Magento\Framework\Filesystem;
1515

1616
/**
17-
* Class Comment. It is used to parse config paths from comment section.
17+
* Config file parser
18+
*
19+
* It is used to parse config paths from
20+
* comment section in provided configuration file.
1821
*/
1922
class Comment implements CommentParserInterface
2023
{
@@ -41,17 +44,43 @@ public function __construct(
4144
}
4245

4346
/**
44-
* Retrieves config paths from comment section of the file.
45-
* Example of comment:
46-
* * CONFIG__DEFAULT__SOME__CONF__PATH_ONE
47-
* * CONFIG__DEFAULT__SOME__CONF__PATH_TWO
48-
* This method will return:
49-
* array(
50-
* 'CONFIG__DEFAULT__SOME__CONF__PATH_ONE' => 'some/conf/path_one',
51-
* 'CONFIG__DEFAULT__SOME__CONF__PATH_TWO' => 'some/conf/path_two'
52-
* );
47+
* Retrieves config array paths from comment section of the config file
5348
*
54-
* @param string $fileName
49+
* Example:
50+
* some.file.config.php file is located in the directory /<root_app_dir>/app/etc/
51+
* File Content some.file.config.php
52+
* ```php
53+
* return [
54+
* 'scopes' => [
55+
* //...
56+
* ],
57+
* // ...
58+
* // The configuration file doesn't contain sensitive data for security reasons.
59+
* // Sensitive data can be stored in the following environment variables:
60+
* // CONFIG__DEFAULT__SOME__CONF__PATH_ONE for some/conf/path_one
61+
* 'system' => [],
62+
* // ...
63+
* // CONFIG__DEFAULT__SOME__CONF__PATH_TWO for some/conf/path_two
64+
* // ...
65+
* ];
66+
* ```
67+
* Usage:
68+
* ```php
69+
* // ...
70+
* // $commentParser variable contains an object of type \Magento\Config\Model\Config\Parser\Comment
71+
* $fileName = 'some.file.config.php';
72+
* $result = $commentParser->execute($fileName);
73+
* // ...
74+
* ```
75+
* The variable $result will be set to
76+
* ```php
77+
* array(
78+
* 'CONFIG__DEFAULT__SOME__CONF__PATH_ONE' => 'some/conf/path_one',
79+
* 'CONFIG__DEFAULT__SOME__CONF__PATH_TWO' => 'some/conf/path_two'
80+
* );
81+
* ```
82+
*
83+
* @param string $fileName the basename of file
5584
* @return array
5685
* @throws FileSystemException
5786
*/

app/code/Magento/Config/Test/Unit/Block/System/Config/Form/Fieldset/Modules/DisableOutputTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
/**
99
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
10-
* @deprecated
10+
* @deprecated because \Magento\Config\Block\System\Config\Form\Fieldset\Modules\DisableOutput is deprecated
1111
*/
1212
class DisableOutputTest extends \PHPUnit_Framework_TestCase
1313
{

app/code/Magento/Config/Test/Unit/Model/Config/Parser/CommentTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class CommentTest extends \PHPUnit_Framework_TestCase
2929
*/
3030
private $model;
3131

32+
/**
33+
* @inheritdoc
34+
*/
3235
protected function setUp()
3336
{
3437
$this->placeholderMock = $this->getMockBuilder(PlaceholderInterface::class)

app/code/Magento/Deploy/Console/Command/App/SensitiveConfigSet/CollectorFactory.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class CollectorFactory
3232

3333
/**
3434
* @param ObjectManagerInterface $objectManager
35-
* @param array $types
35+
* @param array $types list of collector class names this factory can create.
36+
* Every class should implement \Magento\Deploy\Console\Command\App\SensitiveConfigSet\CollectorInterface
3637
*/
3738
public function __construct(
3839
ObjectManagerInterface $objectManager,
@@ -43,7 +44,12 @@ public function __construct(
4344
}
4445

4546
/**
46-
* Create instance of CollectorInterface by given type.
47+
* Creates instance of CollectorInterface by given type.
48+
*
49+
* The value of the $type associated with the name of the class of collector object to create
50+
* There are several types of collectors
51+
* @see \Magento\Deploy\Console\Command\App\SensitiveConfigSet\InteractiveCollector
52+
* @see \Magento\Deploy\Console\Command\App\SensitiveConfigSet\SimpleCollector
4753
*
4854
* @param string $type
4955
* @return CollectorInterface

0 commit comments

Comments
 (0)