File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,16 @@ When the extractor is downloaded you may use it by doing the following:
17
17
18
18
.. code-block :: php
19
19
20
+ <?php
21
+
20
22
require "vendor/autoload.php";
21
23
22
24
use Translation\Extractor\Visitor\Php\Symfony as Visitor;
25
+ use Translation\Extractor\FileExtractor\PHPFileExtractor;
26
+ use Translation\Extractor\Extractor;
23
27
24
28
// Create extractor for PHP files
25
- $fileExtractor = new PHPFileExtractor()
29
+ $fileExtractor = new PHPFileExtractor();
26
30
27
31
// Add visitors
28
32
$fileExtractor->addVisitor(new Visitor\ContainerAwareTrans());
@@ -32,16 +36,17 @@ When the extractor is downloaded you may use it by doing the following:
32
36
33
37
// Add the file extractor to Extractor
34
38
$extractor = new Extractor();
35
- $extractor->addFileExtractor($this->getPHPFileExtractor() );
39
+ $extractor->addFileExtractor($fileExtractor );
36
40
37
- //Start extracting files
41
+ // Start extracting files
38
42
$sourceCollection = $extractor->extractFromDirectory('/foo/bar');
39
43
40
44
// Print the result
41
45
foreach ($sourceCollection as $source) {
42
- echo sprintf('Key "%s" found in %s at line %d', $source->getMessage(), $source->getPath(), $source->getLine());
46
+ echo sprintf('Key "%s" found in %s at line %d', $source->getMessage(), $source->getPath(), $source->getLine());
43
47
}
44
48
49
+
45
50
Architecture
46
51
------------
47
52
You can’t perform that action at this time.
0 commit comments