Scalr\Tests\Functional\Api\V2\TestData\ApiFixture::resolveProperty PHP Method

resolveProperty() protected method

If property has reference to the object, will return property or object
protected resolveProperty ( $value, $index ) : array
$value string property name
$index int property value
return array
    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;
    }