Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Interfaces.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
15 
20 {
24  private $outputMapper;
25 
29  public function __construct(OutputMapper $outputMapper)
30  {
31  $this->outputMapper = $outputMapper;
32  }
33 
37  public function format(TypeInterface $configElement, OutputTypeInterface $outputType) : array
38  {
39  $config = [];
40  if ($configElement instanceof Type && !empty($configElement->getInterfaces())) {
41  $interfaces = [];
42  foreach ($configElement->getInterfaces() as $interface) {
43  $interfaces[$interface['interface']] = $this->outputMapper->getOutputType($interface['interface']);
44  }
45  $config['interfaces'] = $interfaces;
46  }
47 
48  return $config;
49  }
50 }
$config
Definition: fraud_order.php:17
format(TypeInterface $configElement, OutputTypeInterface $outputType)
Definition: Interfaces.php:37