diff --git a/app/code/Magento/Eav/Model/Entity/AttributeCache.php b/app/code/Magento/Eav/Model/Entity/AttributeCache.php index 2aca4aa58968352e983cbeeb7119b290027e1a4d..f4f52e154cdd1cb1970ff07913cd273b0a5c77b2 100644 --- a/app/code/Magento/Eav/Model/Entity/AttributeCache.php +++ b/app/code/Magento/Eav/Model/Entity/AttributeCache.php @@ -9,8 +9,6 @@ namespace Magento\Eav\Model\Entity; use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; use Magento\Framework\App\CacheInterface; use Magento\Framework\App\Cache\StateInterface; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\Serialize\Serializer\Serialize; use Magento\Framework\Serialize\SerializerInterface; /** @@ -46,11 +44,6 @@ class AttributeCache */ private $unsupportedTypes; - /** - * @var SerializerInterface - */ - private $serializer; - /** * AttributeCache constructor. * @param CacheInterface $cache @@ -97,7 +90,7 @@ class AttributeCache $cacheKey = self::ATTRIBUTES_CACHE_PREFIX . $entityType . $suffix; $attributesData = $this->cache->load($cacheKey); if ($attributesData) { - $attributes = $this->getSerializer()->unserialize($attributesData); + $attributes = unserialize($attributesData); $this->attributeInstances[$entityType . $suffix] = $attributes; return $attributes; } @@ -121,7 +114,7 @@ class AttributeCache $this->attributeInstances[$entityType . $suffix] = $attributes; if ($this->isAttributeCacheEnabled()) { $cacheKey = self::ATTRIBUTES_CACHE_PREFIX . $entityType . $suffix; - $attributesData = $this->getSerializer()->serialize($attributes); + $attributesData = serialize($attributes); $this->cache->save( $attributesData, $cacheKey, @@ -153,19 +146,4 @@ class AttributeCache } return true; } - - /** - * Retrieve handler which allows serialize/deserialize data - * - * @deprecated - * @return SerializerInterface - */ - private function getSerializer() - { - if (!$this->serializer) { - $this->serializer = ObjectManager::getInstance()->get(Serialize::class); - } - - return $this->serializer; - } } diff --git a/app/code/Magento/Theme/Model/Theme/ThemeProvider.php b/app/code/Magento/Theme/Model/Theme/ThemeProvider.php index 68e675387f90552d3370cccca6ed5e0bca3a7994..89d7bfc18d30c27026777f7864b562354277dfee 100644 --- a/app/code/Magento/Theme/Model/Theme/ThemeProvider.php +++ b/app/code/Magento/Theme/Model/Theme/ThemeProvider.php @@ -6,8 +6,6 @@ namespace Magento\Theme\Model\Theme; use Magento\Framework\App\ObjectManager; -use Magento\Framework\Serialize\Serializer\Serialize; -use Magento\Framework\Serialize\SerializerInterface; use Magento\Framework\View\Design\Theme\ListInterface; use Magento\Framework\App\DeploymentConfig; @@ -46,11 +44,6 @@ class ThemeProvider implements \Magento\Framework\View\Design\Theme\ThemeProvide */ private $deploymentConfig; - /** - * @var SerializerInterface - */ - private $serializer; - /** * ThemeProvider constructor. * @@ -84,13 +77,13 @@ class ThemeProvider implements \Magento\Framework\View\Design\Theme\ThemeProvide /** @var $themeCollection \Magento\Theme\Model\ResourceModel\Theme\Collection */ $theme = $this->cache->load('theme'. $fullPath); if ($theme) { - $this->themes[$fullPath] = $this->getSerializer()->unserialize($theme); + $this->themes[$fullPath] = unserialize($theme); return $this->themes[$fullPath]; } $themeCollection = $this->collectionFactory->create(); $item = $themeCollection->getThemeByFullPath($fullPath); if ($item->getId()) { - $themeData = $this->getSerializer()->serialize($item); + $themeData = serialize($item); $this->cache->save($themeData, 'theme' . $fullPath); $this->cache->save($themeData, 'theme-by-id-' . $item->getId()); $this->themes[$fullPath] = $item; @@ -122,14 +115,14 @@ class ThemeProvider implements \Magento\Framework\View\Design\Theme\ThemeProvide } $theme = $this->cache->load('theme-by-id-' . $themeId); if ($theme) { - $this->themes[$themeId] = $this->getSerializer()->unserialize($theme); + $this->themes[$themeId] = unserialize($theme); return $this->themes[$themeId]; } /** @var $themeModel \Magento\Framework\View\Design\ThemeInterface */ $themeModel = $this->themeFactory->create(); $themeModel->load($themeId); if ($themeModel->getId()) { - $this->cache->save($this->getSerializer()->serialize($themeModel), 'theme-by-id-' . $themeId); + $this->cache->save(serialize($themeModel), 'theme-by-id-' . $themeId); $this->themes[$themeId] = $themeModel; } return $themeModel; @@ -158,19 +151,4 @@ class ThemeProvider implements \Magento\Framework\View\Design\Theme\ThemeProvide } return $this->deploymentConfig; } - - /** - * Retrieve handler which allows serialize/deserialize data - * - * @deprecated - * @return SerializerInterface - */ - private function getSerializer() - { - if (!$this->serializer) { - $this->serializer = ObjectManager::getInstance()->get(Serialize::class); - } - - return $this->serializer; - } } diff --git a/app/code/Magento/User/Model/ResourceModel/User.php b/app/code/Magento/User/Model/ResourceModel/User.php index fee2a07b21c8adc74556a9d9e7636b830827eeb9..d3e228d44358136c748258c47da3f7f2b2bba76b 100644 --- a/app/code/Magento/User/Model/ResourceModel/User.php +++ b/app/code/Magento/User/Model/ResourceModel/User.php @@ -9,9 +9,6 @@ namespace Magento\User\Model\ResourceModel; use Magento\Authorization\Model\Acl\Role\Group as RoleGroup; use Magento\Authorization\Model\Acl\Role\User as RoleUser; use Magento\Authorization\Model\UserContextInterface; -use Magento\Framework\App\ObjectManager; -use Magento\Framework\Serialize\Serializer\Serialize; -use Magento\Framework\Serialize\SerializerInterface; use Magento\User\Model\User as ModelUser; /** @@ -37,11 +34,6 @@ class User extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb */ protected $dateTime; - /** - * @var SerializerInterface - */ - private $serializer; - /** * Construct * @@ -625,19 +617,4 @@ class User extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb [':user_id' => $userId] ); } - - /** - * Retrieve handler which allows serialize/deserialize data - * - * @deprecated - * @return SerializerInterface - */ - private function getSerializer() - { - if (!$this->serializer) { - $this->serializer = ObjectManager::getInstance()->get(Serialize::class); - } - - return $this->serializer; - } }