回答:
Magento/Store/Model/Informationクラスを使用し、getStoreInformationObject()そのためのメソッドを呼び出す必要があります。
ただし、テンプレートで使用するには、このクラスをカスタムブロックに挿入する必要があります。
protected $_storeInfo;
public function __construct(
    ....
    \Magento\Store\Model\Information $storeInfo,
    ....
) {
    ...
    $this->_storeInfo = $storeInfo;
    ....
}次に、電話番号を取得するカスタムメソッドを作成します。
public function getPhoneNumber()
{
    return $this->_storeInfo->getStoreInformationObject(Store $store)->getPhone();
}したがって、テンプレートでは次を呼び出すことができます。
$block->getPhoneNumber();オブジェクトマネージャを直接使用しないでください(Magento 2:ObjectManagerを直接使用するかどうかを参照してください)。
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeInformation = $objectManager->create('Magento/Store/Model/Information');
$storeInfo = $storeInformation->getStoreInformationObject($store);次に、電話をかけることで電話をかけることができます。
$phone = $storeInfo->getPhone();$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeInformation = $objectManager->create('Magento\Store\Model\Information');
$store = $objectManager->create('Magento\Store\Model\Store');
$storeInfo = $storeInformation->getStoreInformationObject($store);
$phone = $storeInfo->getPhone();のインスタンスを\Magento\Framework\App\Config\ScopeConfigInterfaceブロックに挿入する必要があります。
$protected $scopeConfig;
public function __construct(
    ....
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    ....
) {
    ...
    $this->scopeConfig = $scopeConfig;
    ....
}次に、メソッドを作成します getStorePhone()
public function getStorePhone()
{
    return $this->scopeConfig->getValue(
        'general/store_information/phone',
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE
    );
}そしてテンプレートを呼び出します echo $block->getStorePhone()
上記の方法はうまくいきませんでしたので、次の方法で試しましたが、うまくいきました...
namespace Vendor\Module\Block;
class Contact extends \Magento\Framework\View\Element\Template
{
    protected $_storeInfo;
    protected $_storeManagerInterface;
    public function __construct( 
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Store\Model\Information $storeInfo,
        \Magento\Store\Model\StoreManagerInterface $storeManagerInterface,
        array $data = []
    )
    {
        parent::__construct($context, $data); 
        $this->_storeInfo = $storeInfo;
        $this->_storeManagerInterface = $storeManagerInterface;
    }
    public function getPhoneNumber()
    {
        return $this->_storeInfo->getStoreInformationObject($this->_storeManagerInterface->getStore(null))->getPhone();
    }
}そして、私が呼び出したテンプレートファイルで
echo $block->getPhoneNumber();上記のコードは私のために働いていません。動作する次のコードを試しました。
class Sociallinks extends \Magento\Framework\View\Element\Template
{
   protected $socialLinksHelper;
   protected $objMgr;
   protected $storeInfo;
   protected $scopeConfig;
   public function __construct(
      \Magento\Framework\View\Element\Template\Context $context,
      \Addpeople\Websettings\Helper\Data $myModuleHelper,
      array $data = []
    ) {
    parent::__construct($context, $data);
    $this->_socialLinksHelper = $myModuleHelper;
    $this->_objMgr =  \Magento\Framework\App\ObjectManager::getInstance();
    $storeInformation = $this->_objMgr->create('Magento\Store\Model\Information');
    $store = $this->_objMgr->create('Magento\Store\Model\Store');
    $this->_storeInfo = $storeInformation->getStoreInformationObject($store);
}
public function getPhoneNumber()
{
    return $this->_storeInfo->getPhone();
}
}テンプレートファイル
<?php echo $block->getPhoneNumber();?>
以下も使用できます。
$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();        
$storePhone = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('general/store_information/phone');