Skip to content

Commit 322047d

Browse files
committed
Conform to coding standard
1 parent ace89c0 commit 322047d

File tree

10 files changed

+209
-65
lines changed

10 files changed

+209
-65
lines changed

lib/internal/Magento/Framework/Data/Form/Element/Submit.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<?php
2+
23
/**
34
* Copyright © Magento, Inc. All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67

7-
/**
8-
* Form submit element
9-
*/
108
namespace Magento\Framework\Data\Form\Element;
119

1210
use Magento\Framework\Escaper;
1311

12+
/**
13+
* Form submit element
14+
*/
1415
class Submit extends AbstractElement
1516
{
1617
/**
@@ -31,6 +32,8 @@ public function __construct(
3132
}
3233

3334
/**
35+
* Get HTML
36+
*
3437
* @return mixed
3538
*/
3639
public function getHtml()

lib/internal/Magento/Framework/Data/Form/Element/Textarea.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Copyright © Magento, Inc. All rights reserved.
45
* See COPYING.txt for license details.
@@ -16,12 +17,12 @@ class Textarea extends AbstractElement
1617
/**
1718
* Default number of rows
1819
*/
19-
const DEFAULT_ROWS = 2;
20+
public const DEFAULT_ROWS = 2;
2021

2122
/**
2223
* Default number of columns
2324
*/
24-
const DEFAULT_COLS = 15;
25+
public const DEFAULT_COLS = 15;
2526

2627
/**
2728
* @param Factory $factoryElement
@@ -41,6 +42,7 @@ public function __construct(
4142
if (!$this->getRows()) {
4243
$this->setRows(self::DEFAULT_ROWS);
4344
}
45+
4446
if (!$this->getCols()) {
4547
$this->setCols(self::DEFAULT_COLS);
4648
}

lib/internal/Magento/Framework/Data/Helper/PostHelper.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<?php
2+
23
/**
3-
* Helper to obtain post data for postData widget
4-
*
54
* Copyright © Magento, Inc. All rights reserved.
65
* See COPYING.txt for license details.
76
*/
7+
88
namespace Magento\Framework\Data\Helper;
99

1010
use Magento\Framework\App\Helper\Context;
1111
use Magento\Framework\Url\Helper\Data as UrlHelper;
1212

13+
/**
14+
* Helper to obtain post data for postData widget
15+
*/
1316
class PostHelper extends \Magento\Framework\App\Helper\AbstractHelper
1417
{
1518
/**
@@ -30,17 +33,19 @@ public function __construct(
3033
}
3134

3235
/**
33-
* get data for post by javascript in format acceptable to $.mage.dataPost widget
36+
* Get data for post by javascript in format acceptable to $.mage.dataPost widget
3437
*
3538
* @param string $url
3639
* @param array $data
40+
*
3741
* @return string
3842
*/
3943
public function getPostData($url, array $data = [])
4044
{
4145
if (!isset($data[\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED])) {
4246
$data[\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED] = $this->urlHelper->getEncodedUrl();
4347
}
48+
4449
return json_encode(['action' => $url, 'data' => $data]);
4550
}
4651
}

lib/internal/Magento/Framework/Data/Tree.php

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
2+
23
/**
34
* Copyright © Magento, Inc. All rights reserved.
45
* See COPYING.txt for license details.
56
*/
7+
68
namespace Magento\Framework\Data;
79

810
use Magento\Framework\Data\Tree\Node;
@@ -13,6 +15,7 @@
1315
*
1416
* @api
1517
* @since 100.0.2
18+
* phpcs:disable Magento2.CodeAnalysis.EmptyBlock
1619
*/
1720
class Tree
1821
{
@@ -23,10 +26,6 @@ class Tree
2326
*/
2427
protected $_nodes;
2528

26-
/**
27-
* Enter description here...
28-
*
29-
*/
3029
public function __construct()
3130
{
3231
$this->_nodes = new NodeCollection($this);
@@ -46,6 +45,7 @@ public function getTree()
4645
* Enter description here...
4746
*
4847
* @param Node $parentNode
48+
*
4949
* @return void
5050
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
5151
*/
@@ -57,6 +57,7 @@ public function load($parentNode = null)
5757
* Enter description here...
5858
*
5959
* @param int|string $nodeId
60+
*
6061
* @return void
6162
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
6263
*/
@@ -70,6 +71,7 @@ public function loadNode($nodeId)
7071
* @param array|Node $data
7172
* @param Node $parentNode
7273
* @param Node $prevNode
74+
*
7375
* @return Node
7476
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
7577
*/
@@ -80,6 +82,7 @@ public function appendChild($data, $parentNode, $prevNode = null)
8082
} elseif ($data instanceof Node) {
8183
$node = $this->addNode($data, $parentNode);
8284
}
85+
8386
return $node;
8487
}
8588

@@ -88,6 +91,7 @@ public function appendChild($data, $parentNode, $prevNode = null)
8891
*
8992
* @param Node $node
9093
* @param Node $parent
94+
*
9195
* @return Node
9296
*/
9397
public function addNode($node, $parent = null)
@@ -97,6 +101,7 @@ public function addNode($node, $parent = null)
97101
if ($parent !== null && $parent instanceof Node) {
98102
$parent->addChild($node);
99103
}
104+
100105
return $node;
101106
}
102107

@@ -106,6 +111,7 @@ public function addNode($node, $parent = null)
106111
* @param Node $node
107112
* @param Node $parentNode
108113
* @param Node $prevNode
114+
*
109115
* @return void
110116
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
111117
*/
@@ -119,6 +125,7 @@ public function moveNodeTo($node, $parentNode, $prevNode = null)
119125
* @param Node $node
120126
* @param Node $parentNode
121127
* @param Node $prevNode
128+
*
122129
* @return void
123130
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
124131
*/
@@ -130,6 +137,7 @@ public function copyNodeTo($node, $parentNode, $prevNode = null)
130137
* Remove node
131138
*
132139
* @param Node $node
140+
*
133141
* @return $this
134142
*/
135143
public function removeNode($node)
@@ -138,6 +146,7 @@ public function removeNode($node)
138146
if ($node->getParent()) {
139147
$node->getParent()->removeChild($node);
140148
}
149+
141150
unset($node);
142151
return $this;
143152
}
@@ -147,6 +156,7 @@ public function removeNode($node)
147156
*
148157
* @param Node $parentNode
149158
* @param Node $prevNode
159+
*
150160
* @return void
151161
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
152162
*/
@@ -158,6 +168,7 @@ public function createNode($parentNode, $prevNode = null)
158168
* Get child
159169
*
160170
* @param Node $node
171+
*
161172
* @return void
162173
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
163174
*/
@@ -169,6 +180,7 @@ public function getChild($node)
169180
* Get children
170181
*
171182
* @param Node $node
183+
*
172184
* @return void
173185
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
174186
*/
@@ -190,6 +202,7 @@ public function getNodes()
190202
* Enter description here...
191203
*
192204
* @param Node $nodeId
205+
*
193206
* @return Node
194207
*/
195208
public function getNodeById($nodeId)
@@ -201,6 +214,7 @@ public function getNodeById($nodeId)
201214
* Get path
202215
*
203216
* @param Node $node
217+
*
204218
* @return array
205219
*/
206220
public function getPath($node)
@@ -211,6 +225,7 @@ public function getPath($node)
211225
return $_node->getPath();
212226
}
213227
}
228+
214229
return [];
215230
}
216231
}

0 commit comments

Comments
 (0)