1 | <?php |
||
34 | class ConfigurationParserFactory implements ConfigurationParserFactoryInterface |
||
35 | { |
||
36 | |||
37 | /** |
||
38 | * The container instance. |
||
39 | * |
||
40 | * @var \Symfony\Component\DependencyInjection\ContainerInterface |
||
41 | */ |
||
42 | protected $container; |
||
43 | |||
44 | /** |
||
45 | * The format => parser mappings. |
||
46 | * |
||
47 | * @var array |
||
48 | */ |
||
49 | protected $parserMappings; |
||
50 | |||
51 | /** |
||
52 | * Initializes the configuration parser factory. |
||
53 | * |
||
54 | * @param \Symfony\Component\DependencyInjection\ContainerInterface $container The container instance |
||
55 | * @param array $parserMappings The parser mappings |
||
56 | */ |
||
57 | public function __construct(ContainerInterface $container, array $parserMappings) |
||
62 | |||
63 | /** |
||
64 | * Factory implementation to create a new configuration parser instance for the passed file format. |
||
65 | * |
||
66 | * @param string $format The format of the configuration file to create a configuration parser for (either one of json, yaml or xml) |
||
67 | * |
||
68 | * @return \TechDivision\Import\Configuration\Jms\ConfigurationParserInterface The configuration parser instance |
||
69 | * @throws \Exception Is thrown if NO configuration parser mapping for the passed format has been specified |
||
70 | */ |
||
71 | public function factory($format = 'json') |
||
82 | } |
||
83 |