Skip to content

Commit c337f10

Browse files
committed
Don't use void return value from method calls. Fixes errors phpstan found while scanning on level 0.
1 parent b90bf99 commit c337f10

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public function save(Product $product, array $data)
8181
protected function clear()
8282
{
8383
$this->sampleItem = [];
84-
return parent::clear();
84+
85+
parent::clear();
8586
}
8687

8788
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function updateDefaultGroup($attributeSetId)
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
__(
@@ -178,7 +178,7 @@ protected function saveNewObject(AbstractModel $object)
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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ protected function _construct()
6767
$this->_loadData();
6868
$this->setStores([]);
6969
$this->setLanguages([]);
70-
return parent::_construct();
70+
71+
parent::_construct();
7172
}
7273

7374
/**

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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)