/**
* Gets all the fixture IDs suitable for the given value.
*
* @param FixtureMatchReferenceValue $value
* @param ResolvedFixtureSet $fixtureSet
*
* @return string[]
*/
private function getSuitableIds(FixtureMatchReferenceValue $value, ResolvedFixtureSet $fixtureSet) : array
{
if (array_key_exists($pattern = $value->getValue(), $this->idsByPattern)) {
return $this->idsByPattern[$pattern];
}
$fixtureKeys = array_flip(preg_grep($pattern, array_keys($fixtureSet->getFixtures()->toArray())));
$objectKeys = array_flip(preg_grep($pattern, array_keys($fixtureSet->getObjects()->toArray())));
$this->idsByPattern[$pattern] = array_keys($fixtureKeys + $objectKeys);
return $this->idsByPattern[$pattern];
}