<?php
declare(strict_types=1);

namespace AuxCF\Entities\Settings\Enum;

use AuxCF\Entities\Settings\Traits\SettingEnumTraits;

/**
 * Enum of comparison operators supported by ACF
 * @since 1.0.0
 */
enum OperatorEnum: string
{
  use SettingEnumTraits;

  case NOT_EMPTY = '!=empty';
  case EMPTY = '==empty';
  case CONTAINS = '==contains';
  case PATTERN = '==pattern';
  case EQUALS = '==';
  case NOT_EQUALS = '!=';
  case GREATER_THAN = '>';
  case LESS_THAN = '<';


  public const SETTING_LABEL = 'operator';

  public function label(): string
  {
    return match($this) {
      self::NOT_EMPTY => 'not empty',
      self::EMPTY => 'empty',
      self::CONTAINS => 'contains',
      self::PATTERN => 'pattern',
      self::EQUALS => 'equal to',
      self::NOT_EQUALS => 'not equal to',
      self::GREATER_THAN => 'greater than',
      self::LESS_THAN => 'less than',
    };
  }
}
