<?php
namespace Autogedal\AutogedalHelper\Block\Widget;

use Magento\Framework\View\Element\Template;
use Magento\Widget\Block\BlockInterface;

class FooterStaticInfo extends Template implements BlockInterface
{
    protected $_template = "widget/footer-static-info.phtml";
    protected $_objectManager;
    protected $_scopeConfigInterface;

    private static $pathVars = [
        "vatNumber" => "general/store_information/merchant_vat_number",
        "regNumber" => "general/store_information/postcode",
        "address" => "general/store_information/street_line1",
    ];

    public function __construct(
        Template\Context $context,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
        array $data = []
    )
    {
        parent::__construct($context, $data);
        $this->_scopeConfigInterface = $scopeConfigInterface;
    }

    public function getStoreInfo($varName)
    {
        if (empty(self::$pathVars[$varName])) {
            return '';
        }

        return $this->_scopeConfigInterface->getValue(
            self::$pathVars[$varName],
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }
}