Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ArgumentsSerialization.php
Go to the documentation of this file.
1 <?php
8 
13 
21 {
27  private $serializer;
28 
34  public function __construct(SerializerInterface $serializer = null)
35  {
36  $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
37  }
38 
45  public function modify(array $config)
46  {
47  if (!isset($config['arguments'])) {
48  return $config;
49  }
50 
51  foreach ($config['arguments'] as $key => $value) {
52  if ($value !== null) {
53  $config['arguments'][$key] = $this->serializer->serialize($value);
54  }
55  }
56 
57  return $config;
58  }
59 }
$config
Definition: fraud_order.php:17
$value
Definition: gender.phtml:16