2016-12-13 00:51:02 +00:00
|
|
|
<?php
|
2018-11-27 16:51:40 +00:00
|
|
|
declare(strict_types=1);
|
2016-12-13 00:51:02 +00:00
|
|
|
|
|
|
|
namespace LanguageServer\Index;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Aggregates definitions of the project and stubs
|
|
|
|
*/
|
|
|
|
class GlobalIndex extends AbstractAggregateIndex
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var Index
|
|
|
|
*/
|
|
|
|
private $stubsIndex;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var ProjectIndex
|
|
|
|
*/
|
|
|
|
private $projectIndex;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param StubsIndex $stubsIndex
|
|
|
|
* @param ProjectIndex $projectIndex
|
|
|
|
*/
|
|
|
|
public function __construct(StubsIndex $stubsIndex, ProjectIndex $projectIndex)
|
|
|
|
{
|
|
|
|
$this->stubsIndex = $stubsIndex;
|
|
|
|
$this->projectIndex = $projectIndex;
|
2017-01-25 00:38:11 +00:00
|
|
|
parent::__construct();
|
2016-12-13 00:51:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return ReadableIndex[]
|
|
|
|
*/
|
|
|
|
protected function getIndexes(): array
|
|
|
|
{
|
|
|
|
return [$this->stubsIndex, $this->projectIndex];
|
|
|
|
}
|
|
|
|
}
|