<?php
/**
 * Copyright © 2018.
 */

namespace Sibs\Sibs\Model\Config\Source\Pbl;

use Magento\Framework\Option\ArrayInterface;

class PblExpirationDateTime implements ArrayInterface
{
    const UNDEFINED_OPTION = '';

    const MINUTE_OPTION = 'minute';

    const HOUR_OPTION = 'hour';

    const DAY_OPTION = 'day';

    const MONTH_OPTION = 'month';

    /**
     * @var string[]
     */
    protected $_payRefExpiration = [
        self::MINUTE_OPTION  => 'Minute',
        self::HOUR_OPTION    => 'Hour',
        self::DAY_OPTION     => 'Day',
        self::MONTH_OPTION   => 'Month',
    ];

    /**
     * @return array
     */
    public function toOptionArray()
    {
        $options = [
            [
                'value' => self::UNDEFINED_OPTION,
                'label' => __('-- Please Select --'),
            ],
        ];

        foreach ($this->_payRefExpiration as $code => $label) {
            $options[] = [
                'value' => $code,
                'label' => __($label),
            ];
        }

        return $options;
    }
}
