<?php
/**
 * Copyright © 2018 EaDesign by Eco Active S.R.L. All rights reserved.
 * See LICENSE for license details.
 */

namespace Eadesigndev\GLS\Model\Config\Source;

use Magento\Framework\Data\OptionSourceInterface;

/**
 * API Mode source model
 * Provides Test/Production mode options for GLS API
 */
class ApiMode implements OptionSourceInterface
{
    const MODE_TEST = 'test';
    const MODE_PRODUCTION = 'production';

    /**
     * Return array of options as value-label pairs
     *
     * @return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...)
     */
    public function toOptionArray()
    {
        return [
            ['value' => self::MODE_TEST, 'label' => __('Test')],
            ['value' => self::MODE_PRODUCTION, 'label' => __('Production')]
        ];
    }

    /**
     * Get options in "key-value" format
     *
     * @return array
     */
    public function toArray()
    {
        return [
            self::MODE_TEST => __('Test'),
            self::MODE_PRODUCTION => __('Production')
        ];
    }
}
