Skip to content

Commit 0934250

Browse files
committed
Fixes for static tests
1 parent eab0925 commit 0934250

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

lib/internal/Magento/Framework/Data/Collection.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Magento\Framework\App\ObjectManager;
1010
use Magento\Framework\Data\Collection\EntityFactoryInterface;
1111
use Magento\Framework\DataObject;
12-
use Magento\Framework\Exception\AlreadyExistsException;
1312
use Magento\Framework\Option\ArrayInterface;
1413

1514
/**
@@ -913,7 +912,9 @@ public function __sleep()
913912
*/
914913
public function __wakeup()
915914
{
916-
$objectManager = ObjectManager::getInstance();
917-
$this->_entityFactory = $objectManager->get(EntityFactoryInterface::class);
915+
// phpcs:ignore Magento2.PHP.AutogeneratedClassNotInConstructor
916+
$this->_entityFactory = ObjectManager::getInstance()->get(
917+
EntityFactoryInterface::class
918+
);
918919
}
919920
}

lib/internal/Magento/Framework/MessageQueue/Consumer.php

Lines changed: 15 additions & 11 deletions
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\Framework\MessageQueue;
78

89
use Exception;
@@ -93,8 +94,7 @@ class Consumer implements ConsumerInterface
9394
* @param MessageController|null $messageController
9495
* @param MessageValidator|null $messageValidator
9596
* @param EnvelopeFactory|null $envelopeFactory
96-
*
97-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
97+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
9898
*/
9999
public function __construct(
100100
CallbackInvokerInterface $invoker,
@@ -247,19 +247,23 @@ private function getTransactionCallback(QueueInterface $queue)
247247
$queue->acknowledge($message);
248248
} catch (MessageLockException $exception) {
249249
$queue->acknowledge($message);
250-
} catch (ConnectionLostException $e) {
250+
} catch (ConnectionLostException $exception) {
251251
if ($lock) {
252-
$this->resource->getConnection()
253-
->delete($this->resource->getTableName('queue_lock'), ['id = ?' => $lock->getId()]);
252+
$this->resource->getConnection()->delete(
253+
$this->resource->getTableName('queue_lock'),
254+
['id = ?' => $lock->getId()]
255+
);
254256
}
255-
} catch (NotFoundException $e) {
257+
} catch (NotFoundException $exception) {
256258
$queue->acknowledge($message);
257-
$this->logger->warning($e->getMessage());
258-
} catch (Exception $e) {
259-
$queue->reject($message, false, $e->getMessage());
259+
$this->logger->warning($exception->getMessage());
260+
} catch (Exception $exception) {
261+
$queue->reject($message, false, $exception->getMessage());
260262
if ($lock) {
261-
$this->resource->getConnection()
262-
->delete($this->resource->getTableName('queue_lock'), ['id = ?' => $lock->getId()]);
263+
$this->resource->getConnection()->delete(
264+
$this->resource->getTableName('queue_lock'),
265+
['id = ?' => $lock->getId()]
266+
);
263267
}
264268
}
265269
};

0 commit comments

Comments
 (0)