Skip to content

Commit 6235266

Browse files
vinogcsmageprince
authored andcommitted
Removed use of Class ObjectManager in Construct
1 parent b14ad81 commit 6235266

File tree

1 file changed

+3
-7
lines changed
  • lib/internal/Magento/Framework/Serialize/Serializer

1 file changed

+3
-7
lines changed

lib/internal/Magento/Framework/Serialize/Serializer/Json.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
*/
1616
class Json implements SerializerInterface
1717
{
18-
private $appState = NULL;
19-
20-
public function __construct(){
21-
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
22-
$this->appState = $objectManager->get('Magento\Framework\App\State');
23-
}
2418
/**
2519
* {@inheritDoc}
2620
* @since 100.2.0
@@ -56,6 +50,8 @@ public function unserialize($string)
5650
}
5751

5852
private function isOnProduction(){
59-
return $this->appState === \Magento\Framework\App\State::MODE_PRODUCTION;
53+
$appState = \Magento\Framework\App\ObjectManager::getInstance()
54+
->get('Magento\Framework\App\State');
55+
return $appState === \Magento\Framework\App\State::MODE_PRODUCTION;
6056
}
6157
}

0 commit comments

Comments
 (0)