Skip to content

Commit

Permalink
Don't use void return value from method calls. Fixes errors phpstan f…
Browse files Browse the repository at this point in the history
…ound while scanning on level 0.
  • Loading branch information
hostep committed Dec 31, 2024
1 parent 4bca5df commit e0dc58b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public function save(Product $product, array $data)
protected function clear()
{
$this->sampleItem = [];
return parent::clear();

parent::clear();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function updateDefaultGroup($attributeSetId)
protected function saveNewObject(AbstractModel $object)
{
try {
return parent::saveNewObject($object);
parent::saveNewObject($object);
} catch (DuplicateException $e) {
throw new AttributeGroupAlreadyExistsException(
__(
Expand All @@ -178,7 +178,7 @@ protected function saveNewObject(AbstractModel $object)
protected function updateObject(AbstractModel $object)
{
try {
return parent::updateObject($object);
parent::updateObject($object);
} catch (DuplicateException $e) {
throw new AttributeGroupAlreadyExistsException(
__(
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/Store/Block/Store/Switcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ protected function _construct()
$this->_loadData();
$this->setStores([]);
$this->setLanguages([]);
return parent::_construct();

parent::_construct();
}

/**
Expand Down
6 changes: 2 additions & 4 deletions lib/internal/Magento/Framework/HTTP/Client/Socket.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,7 @@ protected function processResponse()

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

$crlf = "\r\n";
Expand Down

0 comments on commit e0dc58b

Please sign in to comment.