Skip to content

Commit 6e0efb0

Browse files
committed
ACPT-1666: Fix race conditions in _resetState methods
1 parent 3ae55bc commit 6e0efb0

File tree

1 file changed

+5
-4
lines changed
  • lib/internal/Magento/Framework/ObjectManager/Resetter

1 file changed

+5
-4
lines changed

lib/internal/Magento/Framework/ObjectManager/Resetter/Resetter.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919
class Resetter implements ResetterInterface
2020
{
21+
22+
public const RESET_PATH = '/app/etc/reset.php';
23+
2124
/** @var WeakMap instances to be reset after request */
2225
private WeakMap $resetAfterWeakMap;
2326

@@ -50,7 +53,7 @@ class Resetter implements ResetterInterface
5053
*/
5154
public function __construct()
5255
{
53-
if (\file_exists(BP . '/app/etc/reset.php')) {
56+
if (\file_exists(BP . self::RESET_PATH)) {
5457
// phpcs:ignore Magento2.Security.IncludeFile.FoundIncludeFile
5558
$this->classList = array_replace($this->classList, (require BP . '/app/etc/reset.php'));
5659
}
@@ -65,9 +68,7 @@ public function __construct()
6568
*/
6669
public function addInstance(object $instance) : void
6770
{
68-
if ($instance instanceof ResetAfterRequestInterface
69-
|| isset($this->classList[\get_class($instance)])
70-
) {
71+
if ($instance instanceof ResetAfterRequestInterface || isset($this->classList[\get_class($instance)])) {
7172
$this->resetAfterWeakMap[$instance] = true;
7273
}
7374
}

0 commit comments

Comments
 (0)