src/Indexer/Indexer.php 1 location
|
@@ 45-52 (lines=8) @@
|
| 42 |
|
*/ |
| 43 |
|
protected $ast_visitors; |
| 44 |
|
|
| 45 |
|
public function __construct(Log $log, \PhpParser\Parser $parser, Insert $insert, array $ast_visitors) { |
| 46 |
|
$this->log = $log; |
| 47 |
|
$this->parser = $parser; |
| 48 |
|
$this->insert = $insert; |
| 49 |
|
$this->ast_visitors = array_map(function (ASTVisitor $v) { |
| 50 |
|
return $v; |
| 51 |
|
}, $ast_visitors); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
/** |
| 55 |
|
* Index a directory. |
src/Indexer/IndexerFactory.php 1 location
|
@@ 43-53 (lines=11) @@
|
| 40 |
|
/** |
| 41 |
|
* @param Schema[] $schemas |
| 42 |
|
*/ |
| 43 |
|
public function __construct(Log $log, \PhpParser\Parser $parser, array $schemas) { |
| 44 |
|
$this->log = $log; |
| 45 |
|
$this->parser = $parser; |
| 46 |
|
$this->ast_visitors = []; |
| 47 |
|
$this->schemas = array_map(function(Schema $s) { |
| 48 |
|
if ($s instanceof ASTVisitor) { |
| 49 |
|
$this->ast_visitors[] = $s; |
| 50 |
|
} |
| 51 |
|
return $s; |
| 52 |
|
}, $schemas); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
/** |
| 56 |
|
* @return Indexer |