Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FormatterComposite.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
12 
17 {
21  private $formatters;
22 
26  public function __construct(array $formatters)
27  {
28  $this->formatters = $formatters;
29  }
30 
34  public function format(TypeInterface $configElement, OutputTypeInterface $outputType) : array
35  {
36  $config = [
37  'name' => $configElement->getName(),
38  'description' => $configElement->getDescription()
39  ];
40  foreach ($this->formatters as $formatter) {
41  $config = array_merge($config, $formatter->format($configElement, $outputType));
42  }
43 
44  return $config;
45  }
46 }
$config
Definition: fraud_order.php:17
format(TypeInterface $configElement, OutputTypeInterface $outputType)