Skip to content

Commit e16fdfd

Browse files
committed
Changed locator class name for ObjectManager
Changed the locator class name for the object manager to \Magento\Framework\App\ObjectManager which extends \Magento\Framework\ObjectManager\ObjectManager. In the constructor of \Magento\Framework\App\ObjectManager the object manager is already set into the static variable of the class, so there is no need to call it seperately. If this pull request is denied, then the constructor function of \Magento\Framework\App\ObjectManager should be removed since it will not be called anywhere in the application.
1 parent bd1655b commit e16fdfd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/internal/Magento/Framework/App/ObjectManagerFactory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ObjectManagerFactory
4141
*
4242
* @var string
4343
*/
44-
protected $_locatorClassName = \Magento\Framework\ObjectManager\ObjectManager::class;
44+
protected $_locatorClassName = \Magento\Framework\App\ObjectManager::class;
4545

4646
/**
4747
* Config class name
@@ -180,7 +180,6 @@ public function create(array $arguments)
180180
$objectManager = new $this->_locatorClassName($this->factory, $diConfig, $sharedInstances);
181181

182182
$this->factory->setObjectManager($objectManager);
183-
ObjectManager::setInstance($objectManager);
184183

185184
$generatorParams = $diConfig->getArguments(\Magento\Framework\Code\Generator::class);
186185
/** Arguments are stored in different format when DI config is compiled, thus require custom processing */

0 commit comments

Comments
 (0)