<?php
/**
 * Copyright 2018-2019 © Intelligent IT SRL. All rights reserved.
 */


namespace SmartBill\Integration\Model\Config;

use SmartBill\Integration\Helper\Data;
use SmartBill\Integration\Model\Config\BaseConfig;

use Magento\Framework\Data\OptionSourceInterface;

/**
 * Source model VatDetails
 */
class VatDetails extends BaseConfig
{
    public $taxes = null;

    public function __construct
    (
        private Data $helper
    )
    {
    }
    /**
     * Returns array to be used in options array
     *
     * @return array
     */
    public function toOptionArray()
    {
        $helper = $this->helper;
        
        if(is_null( $this->taxes )){
            $this->taxes = self::getAllTaxes($helper);
        }

        return  $this->taxes;

    }
    
}

