Skip to content

Commit 3003208

Browse files
committed
MAGETWO-66100: Remove usages of unserialize in module Magento/Setup
1 parent 8c4b159 commit 3003208

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

setup/src/Magento/Setup/Model/AdminAccount.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
use Magento\Authorization\Model\UserContextInterface;
1212
use Magento\Framework\Encryption\EncryptorInterface;
1313
use Magento\Setup\Module\Setup;
14-
use Magento\Framework\Serialize\Serializer\Json;
15-
use Magento\Framework\App\ObjectManager;
1614

1715
class AdminAccount
1816
{
@@ -45,31 +43,21 @@ class AdminAccount
4543
*/
4644
private $encryptor;
4745

48-
/**
49-
* Used for serialize/unserialize data.
50-
*
51-
* @var Json
52-
*/
53-
private $serializer;
54-
5546
/**
5647
* Default Constructor
5748
*
5849
* @param Setup $setup
5950
* @param EncryptorInterface $encryptor
6051
* @param array $data
61-
* @param Json|null $serializer
6252
*/
6353
public function __construct(
6454
Setup $setup,
6555
EncryptorInterface $encryptor,
66-
array $data,
67-
Json $serializer = null
56+
array $data
6857
) {
6958
$this->setup = $setup;
7059
$this->encryptor = $encryptor;
7160
$this->data = $data;
72-
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
7361
}
7462

7563
/**
@@ -131,7 +119,6 @@ private function saveAdminUser()
131119
// User does not exist, create it
132120
$adminData['username'] = $this->data[self::KEY_USER];
133121
$adminData['email'] = $this->data[self::KEY_EMAIL];
134-
$adminData['extra'] = $this->serializer->serialize(null);
135122
$this->setup->getConnection()->insert(
136123
$this->setup->getTable('admin_user'),
137124
$adminData

setup/src/Magento/Setup/Model/AdminAccountFactory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public function create(Setup $setup, $data)
3535
return new AdminAccount(
3636
$setup,
3737
$this->serviceLocator->get(\Magento\Framework\Encryption\Encryptor::class),
38-
$data,
39-
new Json()
38+
$data
4039
);
4140
}
4241
}

setup/src/Magento/Setup/Module/Di/Compiler/Config/Chain/ArgumentsSerialization.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
use Magento\Setup\Module\Di\Compiler\Config\ModificationInterface;
1010
use Magento\Framework\Serialize\SerializerInterface;
1111
use Magento\Framework\App\ObjectManager;
12+
use Magento\Framework\Serialize\Serializer\Json;
1213

1314
/**
1415
* Used for argument's array serialization and store to the DI configuration.
1516
*
16-
* @deprecated We don't need anymore serialize arguments, this class will be removed in the next
17-
* backward incompatible release.
17+
* @deprecated Di arguments are now stored in raw php format and could be cached by OPcache,
18+
* this class will be removed in the next backward incompatible release.
1819
*/
1920
class ArgumentsSerialization implements ModificationInterface
2021
{

0 commit comments

Comments
 (0)