protected function resolveProperty($value, $index)
{
if (is_string($value) && preg_match(static::PROPERTY_REGEXP, $value, $matches)) {
$objectData = explode('.', array_pop($matches), 2);
$objectName = array_shift($objectData);
$propValue = array_pop($objectData);
$index = is_numeric($propIndex = array_pop($matches)) ? $propIndex : $index;
if (!isset($this->sets[$objectName][$index])) {
throw new InvalidArgumentException("{$objectName} with index {$index} don't exist in fixtures");
}
return $propValue ? $this->sets[$objectName][$index][$propValue] : $this->sets[$objectName][$index];
}
return $value;
}