Example #1
0
 /**
  * @param $key
  * @return bool
  */
 protected function evalKey($key)
 {
     if (!is_long($key)) {
         return false;
     }
     SplitApp::logger()->info('---> Evaluating EQUAL_TO');
     if (isset($this->unaryNumericMatcherData['value'])) {
         $logMsg = '---> KEY: ' . $key;
         $logMsg .= PHP_EOL . '---> VAL: ' . $this->unaryNumericMatcherData['value'];
         $logMsg .= PHP_EOL . '---> ATR: ' . $this->attribute;
         SplitApp::logger()->info($logMsg);
         if (isset($this->unaryNumericMatcherData['dataType']) && DataTypeEnum::isValid($this->unaryNumericMatcherData['dataType'])) {
             if (DataTypeEnum::DATETIME == $this->unaryNumericMatcherData['dataType']) {
                 $phpTimestamp = DateTime::millisecondToPHPTimestamp($this->unaryNumericMatcherData['value']);
                 return DateTime::zeroOutTime($phpTimestamp) == DateTime::zeroOutTime($key);
             }
         }
         return $key == $this->unaryNumericMatcherData['value'];
     }
     return false;
 }