1 | <?php |
||
23 | class ExtractorFactory implements ExtractorFactoryInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var array $extractorsMap |
||
27 | */ |
||
28 | protected $extractorsMap; |
||
29 | |||
30 | /** |
||
31 | * Constructor |
||
32 | * |
||
33 | * @param array $extractorsMap |
||
34 | */ |
||
35 | public function __construct($extractorsMap = array()) |
||
39 | |||
40 | /** |
||
41 | * {@inheritDoc} |
||
42 | */ |
||
43 | public function get(ServiceInterface $service) |
||
59 | |||
60 | /** |
||
61 | * Adds a new extractor to the extractorsMap |
||
62 | * |
||
63 | * @param string $serviceFullyQualifiedClass |
||
64 | * @param string $extractorClass |
||
65 | */ |
||
66 | public function addExtractorMapping($serviceFullyQualifiedClass, $extractorClass) |
||
70 | |||
71 | /** |
||
72 | * Search a mapping on the fly by inspecting the library code |
||
73 | * |
||
74 | * @param string $serviceFullyQualifiedClass |
||
75 | * @return null|string |
||
76 | */ |
||
77 | protected function searchExtractorClassInLib($serviceFullyQualifiedClass) |
||
89 | |||
90 | /** |
||
91 | * @param ServiceInterface $service |
||
92 | * @param string $extractorClass |
||
93 | * @return ExtractorInterface |
||
94 | * @throws Exception\InvalidExtractorException |
||
95 | */ |
||
96 | protected function buildExtractor(ServiceInterface $service, $extractorClass) |
||
108 | } |
||
109 |