Skip to content

Commit 3ccc867

Browse files
Merge pull request #8 from magento/2.3-develop
update branch
2 parents 7320e1b + 310648c commit 3ccc867

File tree

172 files changed

+4293
-6617
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+4293
-6617
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
* the classes they were introduced for.
1818
*
1919
* @api
20+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2021
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
22+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2123
* @since 100.0.2
2224
*/
2325
class Context extends \Magento\Framework\View\Element\Template\Context
@@ -173,6 +175,8 @@ public function getAuthorization()
173175
}
174176

175177
/**
178+
* Get backend session instance.
179+
*
176180
* @return \Magento\Backend\Model\Session
177181
*/
178182
public function getBackendSession()
@@ -181,6 +185,8 @@ public function getBackendSession()
181185
}
182186

183187
/**
188+
* Get math random instance.
189+
*
184190
* @return \Magento\Framework\Math\Random
185191
*/
186192
public function getMathRandom()
@@ -189,6 +195,8 @@ public function getMathRandom()
189195
}
190196

191197
/**
198+
* Get form key instance.
199+
*
192200
* @return \Magento\Framework\Data\Form\FormKey
193201
*/
194202
public function getFormKey()
@@ -197,7 +205,9 @@ public function getFormKey()
197205
}
198206

199207
/**
200-
* @return \Magento\Framework\Data\Form\FormKey
208+
* Get name builder instance.
209+
*
210+
* @return \Magento\Framework\Code\NameBuilder
201211
*/
202212
public function getNameBuilder()
203213
{

app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/AbstractRenderer.php

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ abstract class AbstractRenderer extends \Magento\Backend\Block\AbstractBlock imp
2828
protected $_column;
2929

3030
/**
31+
* Set column for renderer.
32+
*
3133
* @param Column $column
3234
* @return $this
3335
*/
@@ -38,6 +40,8 @@ public function setColumn($column)
3840
}
3941

4042
/**
43+
* Returns row associated with the renderer.
44+
*
4145
* @return Column
4246
*/
4347
public function getColumn()
@@ -48,7 +52,7 @@ public function getColumn()
4852
/**
4953
* Renders grid column
5054
*
51-
* @param Object $row
55+
* @param DataObject $row
5256
* @return string
5357
*/
5458
public function render(DataObject $row)
@@ -66,7 +70,7 @@ public function render(DataObject $row)
6670
/**
6771
* Render column for export
6872
*
69-
* @param Object $row
73+
* @param DataObject $row
7074
* @return string
7175
*/
7276
public function renderExport(DataObject $row)
@@ -75,7 +79,9 @@ public function renderExport(DataObject $row)
7579
}
7680

7781
/**
78-
* @param Object $row
82+
* Returns value of the row.
83+
*
84+
* @param DataObject $row
7985
* @return mixed
8086
*/
8187
protected function _getValue(DataObject $row)
@@ -92,7 +98,9 @@ protected function _getValue(DataObject $row)
9298
}
9399

94100
/**
95-
* @param Object $row
101+
* Get pre-rendered input element.
102+
*
103+
* @param DataObject $row
96104
* @return string
97105
*/
98106
public function _getInputValueElement(DataObject $row)
@@ -108,7 +116,9 @@ public function _getInputValueElement(DataObject $row)
108116
}
109117

110118
/**
111-
* @param Object $row
119+
* Get input value by row.
120+
*
121+
* @param DataObject $row
112122
* @return mixed
113123
*/
114124
protected function _getInputValue(DataObject $row)
@@ -117,6 +127,8 @@ protected function _getInputValue(DataObject $row)
117127
}
118128

119129
/**
130+
* Renders header of the column,
131+
*
120132
* @return string
121133
*/
122134
public function renderHeader()
@@ -148,6 +160,8 @@ public function renderHeader()
148160
}
149161

150162
/**
163+
* Render HTML properties.
164+
*
151165
* @return string
152166
*/
153167
public function renderProperty()
@@ -172,6 +186,8 @@ public function renderProperty()
172186
}
173187

174188
/**
189+
* Returns HTML for CSS.
190+
*
175191
* @return string
176192
*/
177193
public function renderCss()

app/code/Magento/Backend/Controller/Adminhtml/Dashboard/ProductsViewed.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
88

9-
class ProductsViewed extends AjaxBlock
9+
use Magento\Framework\App\Action\HttpGetActionInterface;
10+
11+
/**
12+
* Get most viewed products controller.
13+
*/
14+
class ProductsViewed extends AjaxBlock implements HttpGetActionInterface
1015
{
1116
/**
1217
* Gets most viewed products list
1318
*
14-
* @return \Magento\Backend\Model\View\Result\Page
19+
* @return \Magento\Framework\Controller\Result\Raw
1520
*/
1621
public function execute()
1722
{

app/code/Magento/Backup/Model/Backup.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* @method string getPath()
1515
* @method string getName()
1616
* @method string getTime()
17+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1718
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1819
* @api
1920
* @since 100.0.2
@@ -80,6 +81,7 @@ class Backup extends \Magento\Framework\DataObject implements \Magento\Framework
8081
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
8182
* @param \Magento\Framework\Filesystem $filesystem
8283
* @param array $data
84+
* @throws \Magento\Framework\Exception\FileSystemException
8385
*/
8486
public function __construct(
8587
\Magento\Backup\Helper\Data $helper,
@@ -242,7 +244,7 @@ public function setFile(&$content)
242244
/**
243245
* Return content of backup file
244246
*
245-
* @return string
247+
* @return array
246248
* @throws \Magento\Framework\Exception\LocalizedException
247249
*/
248250
public function &getFile()
@@ -275,8 +277,9 @@ public function deleteFile()
275277
*
276278
* @param bool $write
277279
* @return $this
278-
* @throws \Magento\Framework\Exception\InputException
279280
* @throws \Magento\Framework\Backup\Exception\NotEnoughPermissions
281+
* @throws \Magento\Framework\Exception\FileSystemException
282+
* @throws \Magento\Framework\Exception\InputException
280283
*/
281284
public function open($write = false)
282285
{
@@ -330,6 +333,7 @@ protected function _getStream()
330333
*
331334
* @param int $length
332335
* @return string
336+
* @throws \Magento\Framework\Exception\InputException
333337
*/
334338
public function read($length)
335339
{
@@ -340,6 +344,7 @@ public function read($length)
340344
* Check end of file.
341345
*
342346
* @return bool
347+
* @throws \Magento\Framework\Exception\InputException
343348
*/
344349
public function eof()
345350
{
@@ -370,6 +375,7 @@ public function write($string)
370375
* Close open backup file
371376
*
372377
* @return $this
378+
* @throws \Magento\Framework\Exception\InputException
373379
*/
374380
public function close()
375381
{
@@ -383,6 +389,8 @@ public function close()
383389
* Print output
384390
*
385391
* @return string
392+
* @return \Magento\Framework\Filesystem\Directory\ReadInterface|string|void
393+
* @throws \Magento\Framework\Exception\FileSystemException
386394
*/
387395
public function output()
388396
{
@@ -398,6 +406,8 @@ public function output()
398406
}
399407

400408
/**
409+
* Get Size
410+
*
401411
* @return int|mixed
402412
*/
403413
public function getSize()
@@ -419,6 +429,7 @@ public function getSize()
419429
*
420430
* @param string $password
421431
* @return bool
432+
* @throws \Exception
422433
*/
423434
public function validateUserPassword($password)
424435
{

app/code/Magento/Braintree/Test/Unit/Model/Report/BraintreeTransactionStub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __get($name)
4040
}
4141

4242
/**
43-
* Checks for the existance of a property stored in the private $_attributes property
43+
* Checks for the existence of a property stored in the private $_attributes property
4444
*
4545
* @ignore
4646
* @param string $name

app/code/Magento/CacheInvalidate/Model/PurgeCache.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ private function splitTags($tagsPattern)
118118
private function sendPurgeRequestToServers($socketAdapter, $servers, $formattedTagsChunk)
119119
{
120120
$headers = [self::HEADER_X_MAGENTO_TAGS_PATTERN => $formattedTagsChunk];
121+
$unresponsiveServerError = [];
121122
foreach ($servers as $server) {
122123
$headers['Host'] = $server->getHost();
123124
try {
@@ -131,10 +132,30 @@ private function sendPurgeRequestToServers($socketAdapter, $servers, $formattedT
131132
$socketAdapter->read();
132133
$socketAdapter->close();
133134
} catch (\Exception $e) {
134-
$this->logger->critical($e->getMessage(), compact('server', 'formattedTagsChunk'));
135+
$unresponsiveServerError[] = "Cache host: " . $server->getHost() . ":" . $server->getPort() .
136+
"resulted in error message: " . $e->getMessage();
137+
}
138+
}
139+
140+
$errorCount = count($unresponsiveServerError);
141+
142+
if ($errorCount > 0) {
143+
$loggerMessage = implode(" ", $unresponsiveServerError);
144+
145+
if ($errorCount == count($servers)) {
146+
$this->logger->critical(
147+
'No cache server(s) could be purged ' . $loggerMessage,
148+
compact('server', 'formattedTagsChunk')
149+
);
135150
return false;
136151
}
152+
153+
$this->logger->warning(
154+
'Unresponsive cache server(s) hit' . $loggerMessage,
155+
compact('server', 'formattedTagsChunk')
156+
);
137157
}
158+
138159
$this->logger->execute(compact('servers', 'formattedTagsChunk'));
139160
return true;
140161
}

app/code/Magento/Captcha/Observer/CheckUserLoginObserver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Captcha\Observer;
78

89
use Magento\Customer\Model\AuthenticationInterface;
@@ -11,7 +12,10 @@
1112
use Magento\Customer\Api\CustomerRepositoryInterface;
1213

1314
/**
15+
* Check captcha on user login page observer.
16+
*
1417
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1519
*/
1620
class CheckUserLoginObserver implements ObserverInterface
1721
{
@@ -140,7 +144,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
140144
$customer = $this->getCustomerRepository()->get($login);
141145
$this->getAuthentication()->processAuthenticationFailure($customer->getId());
142146
} catch (NoSuchEntityException $e) {
143-
//do nothing as customer existance is validated later in authenticate method
147+
//do nothing as customer existence is validated later in authenticate method
144148
}
145149
$this->messageManager->addError(__('Incorrect CAPTCHA'));
146150
$this->_actionFlag->set('', \Magento\Framework\App\Action\Action::FLAG_NO_DISPATCH, true);

app/code/Magento/Catalog/Block/Product/View/Options.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/**
8-
* Product options block
9-
*
10-
* @author Magento Core Team <core@magentocommerce.com>
11-
*/
127
namespace Magento\Catalog\Block\Product\View;
138

149
use Magento\Catalog\Model\Product;
10+
use Magento\Catalog\Model\Product\Option\Value;
1511

1612
/**
13+
* Product options block
14+
*
15+
* @author Magento Core Team <core@magentocommerce.com>
1716
* @api
1817
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1918
* @since 100.0.2
@@ -121,6 +120,8 @@ public function setProduct(Product $product = null)
121120
}
122121

123122
/**
123+
* Get group of option.
124+
*
124125
* @param string $type
125126
* @return string
126127
*/
@@ -142,6 +143,8 @@ public function getOptions()
142143
}
143144

144145
/**
146+
* Check if block has options.
147+
*
145148
* @return bool
146149
*/
147150
public function hasOptions()
@@ -160,7 +163,10 @@ public function hasOptions()
160163
*/
161164
protected function _getPriceConfiguration($option)
162165
{
163-
$optionPrice = $this->pricingHelper->currency($option->getPrice(true), false, false);
166+
$optionPrice = $option->getPrice(true);
167+
if ($option->getPriceType() !== Value::TYPE_PERCENT) {
168+
$optionPrice = $this->pricingHelper->currency($optionPrice, false, false);
169+
}
164170
$data = [
165171
'prices' => [
166172
'oldPrice' => [
@@ -195,7 +201,7 @@ protected function _getPriceConfiguration($option)
195201
],
196202
],
197203
'type' => $option->getPriceType(),
198-
'name' => $option->getTitle()
204+
'name' => $option->getTitle(),
199205
];
200206
return $data;
201207
}
@@ -231,7 +237,7 @@ public function getJsonConfig()
231237
//pass the return array encapsulated in an object for the other modules to be able to alter it eg: weee
232238
$this->_eventManager->dispatch('catalog_product_option_price_configuration_after', ['configObj' => $configObj]);
233239

234-
$config=$configObj->getConfig();
240+
$config = $configObj->getConfig();
235241

236242
return $this->_jsonEncoder->encode($config);
237243
}

0 commit comments

Comments
 (0)