LiquidContext::resolve PHP Метод

resolve() публичный Метод

Test for empty has been moved to interpret condition, in LiquidDecisionBlock
public resolve ( string $key ) : mixed
$key string
Результат mixed
    public function resolve($key)
    {
        // this shouldn't happen
        if (is_array($key)) {
            throw new LiquidException("Cannot resolve arrays as key");
        }
        if (is_null($key) || $key == 'null') {
            return null;
        }
        if ($key == 'true') {
            return true;
        }
        if ($key == 'false') {
            return false;
        }
        if (preg_match('/^\'(.*)\'$/', $key, $matches)) {
            return $matches[1];
        }
        if (preg_match('/^"(.*)"$/', $key, $matches)) {
            return $matches[1];
        }
        if (preg_match('/^(\\d+)$/', $key, $matches)) {
            return $matches[1];
        }
        if (preg_match('/^(\\d[\\d\\.]+)$/', $key, $matches)) {
            return $matches[1];
        }
        return $this->variable($key);
    }