Skip to content

Commit fd09194

Browse files
Merge remote-tracking branch '39516/fixed-returning-from-method-that-doesnt-return' into comprv1
2 parents 9c05217 + 40fcb35 commit fd09194

File tree

4 files changed

+43
-42
lines changed

4 files changed

+43
-42
lines changed

app/code/Magento/Downloadable/Model/Product/TypeHandler/Link.php

+18-22
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2015 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\Downloadable\Model\Product\TypeHandler;
77

@@ -10,7 +10,6 @@
1010
use Magento\Downloadable\Model\ComponentInterface;
1111

1212
/**
13-
* Class Link
1413
* @api
1514
* @since 100.0.2
1615
*/
@@ -22,7 +21,7 @@ class Link extends AbstractTypeHandler
2221
private $sampleItem = [];
2322

2423
/**
25-
* @var \Magento\Downloadable\Model\ComponentInterfaceFactory
24+
* @var \Magento\Downloadable\Model\LinkFactory
2625
*/
2726
private $linkFactory;
2827

@@ -49,54 +48,55 @@ public function __construct(
4948
}
5049

5150
/**
52-
* {@inheritdoc}
51+
* @inheritdoc
5352
*/
5453
public function getDataKey()
5554
{
5655
return 'link';
5756
}
5857

5958
/**
60-
* {@inheritdoc}
59+
* @inheritdoc
6160
*/
6261
public function getIdentifierKey()
6362
{
6463
return 'link_id';
6564
}
6665

6766
/**
68-
* {@inheritdoc}
67+
* @inheritdoc
6968
*/
7069
public function save(Product $product, array $data)
7170
{
7271
parent::save($product, $data);
72+
7373
if ($product->getLinksPurchasedSeparately()) {
7474
$product->setIsCustomOptionChanged();
7575
}
76+
77+
return $this;
7678
}
7779

7880
/**
79-
* {@inheritdoc}
81+
* @inheritdoc
8082
*/
8183
protected function clear()
8284
{
8385
$this->sampleItem = [];
84-
return parent::clear();
86+
87+
parent::clear();
8588
}
8689

8790
/**
88-
* @return ComponentInterface
91+
* @inheritdoc
8992
*/
9093
protected function createItem()
9194
{
9295
return $this->linkFactory->create();
9396
}
9497

9598
/**
96-
* @param ComponentInterface $model
97-
* @param array $data
98-
* @param Product $product
99-
* @return void
99+
* @inheritdoc
100100
*/
101101
protected function setDataToModel(ComponentInterface $model, array $data, Product $product)
102102
{
@@ -124,17 +124,15 @@ protected function setDataToModel(ComponentInterface $model, array $data, Produc
124124
}
125125

126126
/**
127-
* @param ComponentInterface $model
128-
* @param Product $product
129-
* @return void
127+
* @inheritdoc
130128
*/
131129
protected function linkToProduct(ComponentInterface $model, Product $product)
132130
{
133131
$product->setLastAddedLinkId($model->getId());
134132
}
135133

136134
/**
137-
* @return void
135+
* @inheritdoc
138136
*/
139137
protected function processDelete()
140138
{
@@ -144,7 +142,7 @@ protected function processDelete()
144142
}
145143

146144
/**
147-
* {@inheritdoc}
145+
* @inheritdoc
148146
*/
149147
protected function saveItem(Product $product, array $item)
150148
{
@@ -156,9 +154,7 @@ protected function saveItem(Product $product, array $item)
156154
}
157155

158156
/**
159-
* @param ComponentInterface $model
160-
* @param array $files
161-
* @return void
157+
* @inheritdoc
162158
*/
163159
protected function setFiles(ComponentInterface $model, array $files)
164160
{

app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Group.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2015 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\Eav\Model\ResourceModel\Entity\Attribute;
77

@@ -156,12 +156,12 @@ public function updateDefaultGroup($attributeSetId)
156156
}
157157

158158
/**
159-
* {@inheritdoc}
159+
* @inheritdoc
160160
*/
161161
protected function saveNewObject(AbstractModel $object)
162162
{
163163
try {
164-
return parent::saveNewObject($object);
164+
parent::saveNewObject($object);
165165
} catch (DuplicateException $e) {
166166
throw new AttributeGroupAlreadyExistsException(
167167
__(
@@ -173,12 +173,12 @@ protected function saveNewObject(AbstractModel $object)
173173
}
174174

175175
/**
176-
* {@inheritdoc}
176+
* @inheritdoc
177177
*/
178178
protected function updateObject(AbstractModel $object)
179179
{
180180
try {
181-
return parent::updateObject($object);
181+
parent::updateObject($object);
182182
} catch (DuplicateException $e) {
183183
throw new AttributeGroupAlreadyExistsException(
184184
__(

app/code/Magento/Store/Block/Store/Switcher.php

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66

77
/**
@@ -29,15 +29,11 @@ class Switcher extends \Magento\Framework\View\Element\Template
2929
protected $_loaded = false;
3030

3131
/**
32-
* Store factory
33-
*
3432
* @var \Magento\Store\Model\StoreFactory
3533
*/
3634
protected $_storeFactory;
3735

3836
/**
39-
* Store group factory
40-
*
4137
* @var \Magento\Store\Model\GroupFactory
4238
*/
4339
protected $_storeGroupFactory;
@@ -60,17 +56,20 @@ public function __construct(
6056
}
6157

6258
/**
63-
* @return void
59+
* @inheritdoc
6460
*/
6561
protected function _construct()
6662
{
6763
$this->_loadData();
6864
$this->setStores([]);
6965
$this->setLanguages([]);
70-
return parent::_construct();
66+
67+
parent::_construct();
7168
}
7269

7370
/**
71+
* Load data
72+
*
7473
* @return $this
7574
*/
7675
protected function _loadData()
@@ -104,6 +103,8 @@ protected function _loadData()
104103
}
105104

106105
/**
106+
* Sets stores and returns their count
107+
*
107108
* @return int
108109
*/
109110
public function getStoreCount()
@@ -134,6 +135,8 @@ public function getStoreCount()
134135
}
135136

136137
/**
138+
* Sets languages and returns their count
139+
*
137140
* @return int
138141
*/
139142
public function getLanguageCount()
@@ -148,6 +151,8 @@ public function getLanguageCount()
148151
}
149152

150153
/**
154+
* Returns current store id
155+
*
151156
* @return int
152157
*/
153158
public function getCurrentStoreId()
@@ -156,6 +161,8 @@ public function getCurrentStoreId()
156161
}
157162

158163
/**
164+
* Returns current store code
165+
*
159166
* @return string
160167
*/
161168
public function getCurrentStoreCode()

lib/internal/Magento/Framework/HTTP/Client/Socket.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66

77
/**
@@ -419,8 +419,7 @@ protected function processResponse()
419419

420420
$line = explode(" ", $responseLine, 3);
421421
if (count($line) != 3) {
422-
// phpstan:ignore "Result of method Magento\Framework\HTTP\Client\Socket::doError() (void) is used."
423-
return $this->doError("Invalid response line returned from server: " . $responseLine);
422+
$this->doError("Invalid response line returned from server: " . $responseLine);
424423
}
425424
$this->_responseStatus = (int)$line[1];
426425
$this->processResponseHeaders();
@@ -466,8 +465,7 @@ protected function makeRequest($method, $uri, $params = [])
466465
$errno = $errstr = '';
467466
$this->_sock = @fsockopen($this->_host, $this->_port, $errno, $errstr, $this->_timeout);
468467
if (!$this->_sock) {
469-
// phpstan:ignore "Result of method Magento\Framework\HTTP\Client\Socket::doError() (void) is used."
470-
return $this->doError(sprintf("[errno: %d] %s", $errno, $errstr));
468+
$this->doError(sprintf("[errno: %d] %s", $errno, $errstr));
471469
}
472470

473471
$crlf = "\r\n";

0 commit comments

Comments
 (0)