composer package updates
[openemr.git] / vendor / symfony / translation / Extractor / ChainExtractor.php
blob50e3c84579f2bcbcd1174cf9de019904e7c1d6fc
1 <?php
3 /*
4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Translation\Extractor;
14 use Symfony\Component\Translation\MessageCatalogue;
16 /**
17 * ChainExtractor extracts translation messages from template files.
19 * @author Michel Salib <michelsalib@hotmail.com>
21 class ChainExtractor implements ExtractorInterface
23 /**
24 * The extractors.
26 * @var ExtractorInterface[]
28 private $extractors = array();
30 /**
31 * Adds a loader to the translation extractor.
33 * @param string $format The format of the loader
34 * @param ExtractorInterface $extractor The loader
36 public function addExtractor($format, ExtractorInterface $extractor)
38 $this->extractors[$format] = $extractor;
41 /**
42 * {@inheritdoc}
44 public function setPrefix($prefix)
46 foreach ($this->extractors as $extractor) {
47 $extractor->setPrefix($prefix);
51 /**
52 * {@inheritdoc}
54 public function extract($directory, MessageCatalogue $catalogue)
56 foreach ($this->extractors as $extractor) {
57 $extractor->extract($directory, $catalogue);