Skip to content

Commit a903591

Browse files
author
Stanislav Idolov
committed
magento-engcom/magento2ce#2262: Code style fixes
1 parent db3a449 commit a903591

File tree

5 files changed

+32
-15
lines changed

5 files changed

+32
-15
lines changed

app/code/Magento/AdminNotification/Block/Window.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
namespace Magento\AdminNotification\Block;
99

1010
/**
11+
* Admin notification window block
12+
*
1113
* @api
1214
* @since 100.0.2
1315
*/

app/code/Magento/Braintree/Controller/Paypal/Review.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
use Magento\Braintree\Gateway\Config\PayPal\Config;
1313
use Magento\Braintree\Model\Paypal\Helper\QuoteUpdater;
1414
use Magento\Framework\Exception\LocalizedException;
15+
use Magento\Framework\App\Action\HttpPostActionInterface;
1516

1617
/**
1718
* Class Review
1819
*/
19-
class Review extends AbstractAction
20+
class Review extends AbstractAction implements HttpPostActionInterface
2021
{
2122
/**
2223
* @var QuoteUpdater
@@ -91,6 +92,8 @@ public function execute()
9192
}
9293

9394
/**
95+
* Validate request data
96+
*
9497
* @param array $requestData
9598
* @return boolean
9699
*/

lib/internal/Magento/Framework/App/Config/Value.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ public function getFieldsetDataValue($key)
113113
}
114114

115115
/**
116-
* {@inheritdoc}
116+
* @inheritdoc
117117
*
118-
* {@inheritdoc}. In addition, it sets status 'invalidate' for config caches
118+
* @inheritdoc. In addition, it sets status 'invalidate' for config caches
119119
*
120120
* @return $this
121121
*/
@@ -129,9 +129,9 @@ public function afterSave()
129129
}
130130

131131
/**
132-
* {@inheritdoc}
132+
* @inheritdoc
133133
*
134-
* {@inheritdoc}. In addition, it sets status 'invalidate' for config caches
134+
* @inheritdoc. In addition, it sets status 'invalidate' for config caches
135135
*
136136
* @return $this
137137
*/

lib/internal/Magento/Framework/App/Config/ValueInterface.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
/**
1111
* Interface \Magento\Framework\App\Config\ValueInterface
12-
*
13-
* This interface cannot be marked as API since doesn't fit developers' needs of extensibility. In 2.4 we are going
14-
* to introduce a new iterface which should cover all needs and deprecate the this one with the model
12+
*
13+
* This interface cannot be marked as API since doesn't fit developers' needs of extensibility. In 2.4 we are going
14+
* to introduce a new interface which should cover all needs and deprecate the this one with the model
1515
* {@see \Magento\Framework\App\Config\Value}
1616
*/
1717
interface ValueInterface
@@ -23,6 +23,7 @@ interface ValueInterface
2323

2424
/**
2525
* Check if config data value was changed
26+
*
2627
* @todo this method should be make as protected
2728
* @return bool
2829
*/

pub/errors/processor.php

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,7 @@ public function getHostUrl()
257257
/**
258258
* Define server http host
259259
*/
260-
if (!empty($_SERVER['HTTP_HOST'])) {
261-
$host = $_SERVER['HTTP_HOST'];
262-
} elseif (!empty($_SERVER['SERVER_NAME'])) {
263-
$host = $_SERVER['SERVER_NAME'];
264-
} else {
265-
$host = 'localhost';
266-
}
260+
$host = $this->resolveHostName();
267261

268262
$isSecure = (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off')
269263
|| isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https');
@@ -278,6 +272,23 @@ public function getHostUrl()
278272
return $url;
279273
}
280274

275+
/**
276+
* Resolve hostname
277+
*
278+
* @return string
279+
*/
280+
private function resolveHostName() : string
281+
{
282+
if (!empty($_SERVER['HTTP_HOST'])) {
283+
$host = $_SERVER['HTTP_HOST'];
284+
} elseif (!empty($_SERVER['SERVER_NAME'])) {
285+
$host = $_SERVER['SERVER_NAME'];
286+
} else {
287+
$host = 'localhost';
288+
}
289+
return $host;
290+
}
291+
281292
/**
282293
* Retrieve base URL
283294
*

0 commit comments

Comments
 (0)