Skip to content

Commit b3ebb03

Browse files
committed
Adhere to coding standard
1 parent 52982e8 commit b3ebb03

File tree

5 files changed

+42
-10
lines changed

5 files changed

+42
-10
lines changed

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

Lines changed: 8 additions & 0 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\Form\Element;
79

810
use Magento\Framework\Escaper;
@@ -30,6 +32,8 @@ public function __construct(
3032
}
3133

3234
/**
35+
* Get HTML attributes
36+
*
3337
* @return string[]
3438
*/
3539
public function getHtmlAttributes()
@@ -51,6 +55,8 @@ public function getHtmlAttributes()
5155
}
5256

5357
/**
58+
* Get Element HTML
59+
*
5460
* @return string
5561
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
5662
*/
@@ -61,13 +67,15 @@ public function getElementHtml()
6167
} else {
6268
$this->unsetData('checked');
6369
}
70+
6471
return parent::getElementHtml();
6572
}
6673

6774
/**
6875
* Set check status of checkbox
6976
*
7077
* @param bool $value
78+
*
7179
* @return Checkbox
7280
*/
7381
public function setIsChecked($value = false)

lib/internal/Magento/Framework/Data/Form/Element/Editablemultiselect.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.
@@ -68,7 +69,7 @@ public function __construct(
6869
*
6970
* This class must define init() method and receive configuration in the constructor
7071
*/
71-
const DEFAULT_ELEMENT_JS_CLASS = 'EditableMultiselect';
72+
public const DEFAULT_ELEMENT_JS_CLASS = 'EditableMultiselect';
7273

7374
/**
7475
* Retrieve HTML markup of the element
@@ -140,11 +141,12 @@ function check( tries, delay ){
140141
*
141142
* @param array $option
142143
* @param string[] $selected
144+
*
143145
* @return string
144146
*/
145147
protected function _optionToHtml($option, $selected)
146148
{
147-
$optionId = 'optId' .$this->random->getRandomString(8);
149+
$optionId = 'optId' . $this->random->getRandomString(8);
148150
$html = '<option value="' . $this->_escape($option['value']) . '" id="' . $optionId . '" ';
149151
$html .= isset($option['title']) ? 'title="' . $this->_escape($option['title']) . '"' : '';
150152
if (in_array((string)$option['value'], $selected)) {

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

Lines changed: 7 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 hidden element
9-
*/
108
namespace Magento\Framework\Data\Form\Element;
119

1210
use Magento\Framework\Escaper;
1311

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

3334
/**
35+
* Get default HTML
36+
*
3437
* @return mixed
3538
*/
3639
public function getDefaultHtml()
@@ -39,6 +42,7 @@ public function getDefaultHtml()
3942
if ($html === null) {
4043
$html = $this->getElementHtml();
4144
}
45+
4246
return $html;
4347
}
4448
}

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

Lines changed: 17 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.
@@ -31,6 +32,8 @@ public function __construct(
3132
}
3233

3334
/**
35+
* Get HTML attributes
36+
*
3437
* @return string[]
3538
*/
3639
public function getHtmlAttributes()
@@ -51,13 +54,17 @@ public function getHtmlAttributes()
5154
}
5255

5356
/**
57+
* Get label HTML
58+
*
5459
* @param int $suffix
5560
* @param string $scopeLabel
61+
*
5662
* @return string
5763
*/
5864
public function getLabelHtml($suffix = 0, $scopeLabel = '')
5965
{
60-
return parent::getLabelHtml($suffix, $scopeLabel);
66+
$html = parent::getLabelHtml($suffix, $scopeLabel);
67+
return $html;
6168
}
6269

6370
/**
@@ -76,6 +83,7 @@ public function getElementHtml()
7683
} else {
7784
$this->setClass('input-text admin__control-text');
7885
}
86+
7987
$html .= '<div class="multi-input admin__field-control"><input id="' .
8088
$this->getHtmlId() .
8189
$i .
@@ -95,12 +103,16 @@ public function getElementHtml()
95103
if ($i == 0) {
96104
$html .= $this->getAfterElementHtml();
97105
}
106+
98107
$html .= '</div>';
99108
}
109+
100110
return $html;
101111
}
102112

103113
/**
114+
* Get default HTML
115+
*
104116
* @return mixed
105117
* @SuppressWarnings(PHPMD.NPathComplexity)
106118
*/
@@ -127,6 +139,7 @@ public function getDefaultHtml()
127139
$this->setClass('input-text');
128140
$html .= '<label>&nbsp;</label>' . "\n";
129141
}
142+
130143
$html .= '<input id="' .
131144
$this->getHtmlId() .
132145
$i .
@@ -144,13 +157,15 @@ public function getDefaultHtml()
144157
if ($i == 0) {
145158
$html .= $this->getAfterElementHtml();
146159
}
160+
147161
$html .= $this->getNoSpan() === true ? '' : '</span>' . "\n";
148162
}
163+
149164
return $html;
150165
}
151166

152167
/**
153-
* {@inheritdoc}
168+
* @inheritDoc
154169
*/
155170
public function getEscapedValue($index = null)
156171
{

lib/internal/Magento/Framework/Data/Form/Element/Note.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 note element
9-
*/
108
namespace Magento\Framework\Data\Form\Element;
119

1210
use Magento\Framework\Escaper;
1311

12+
/**
13+
* Form note element
14+
*/
1415
class Note extends AbstractElement
1516
{
1617
/**
@@ -30,6 +31,8 @@ public function __construct(
3031
}
3132

3233
/**
34+
* Get element HTML
35+
*
3336
* @return string
3437
*/
3538
public function getElementHtml()

0 commit comments

Comments
 (0)