Skip to content

Commit 742b817

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-95928: Remove RequestAwareBlockMethod
1 parent cf69967 commit 742b817

File tree

4 files changed

+0
-87
lines changed

4 files changed

+0
-87
lines changed

app/code/Magento/Widget/Block/Adminhtml/Widget.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ class Widget extends \Magento\Backend\Block\Widget\Form\Container
1616
{
1717
/**
1818
* @inheritdoc
19-
*
20-
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
2119
*/
2220
protected function _construct()
2321
{

dev/tests/static/framework/Magento/CodeMessDetector/Rule/Design/RequestAwareBlockMethod.php

Lines changed: 0 additions & 53 deletions
This file was deleted.

dev/tests/static/framework/Magento/CodeMessDetector/resources/rulesets/design.xml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,37 +54,6 @@ class PostOrder implements ActionInterface
5454
...
5555
return $response;
5656
}
57-
}
58-
]]>
59-
</example>
60-
</rule>
61-
<rule name="RequestAwareBlockMethod"
62-
class="Magento\CodeMessDetector\Rule\Design\RequestAwareBlockMethod"
63-
message="{0} uses request object directly. Add user input validation and suppress this warning.">
64-
<description>
65-
<![CDATA[
66-
Blocks must not depend on being used with certain controllers.
67-
If you use request object in a block directly you must validate all user input inside the block.
68-
]]>
69-
</description>
70-
<priority>2</priority>
71-
<properties />
72-
<example>
73-
<![CDATA[
74-
class MyOrder extends AbstractBlock
75-
{
76-
77-
.......
78-
79-
public function getOrder()
80-
{
81-
$orderId = $this->getRequest()->getParam('order_id');
82-
//Validate customer having such order.
83-
if (!$this->hasOrder($this->getCustomerId(), $orderId)) {
84-
...deny access...
85-
}
86-
.....
87-
}
8857
}
8958
]]>
9059
</example>

dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,5 @@
4848
<!-- Magento Specific Rules -->
4949
<rule ref="Magento/CodeMessDetector/resources/rulesets/design.xml/FinalImplementation" />
5050
<rule ref="Magento/CodeMessDetector/resources/rulesets/design.xml/AllPurposeAction" />
51-
<rule ref="Magento/CodeMessDetector/resources/rulesets/design.xml/RequestAwareBlockMethod" />
5251

5352
</ruleset>

0 commit comments

Comments
 (0)