示例#1
0
 /**
  * Tests ExpType::detectType
  */
 public function testDetectType()
 {
     foreach ($this->tokens as $token) {
         $this->assertEquals($token->type, ExpType::detectType($token->value));
     }
 }
示例#2
0
 private function evaluateFunction()
 {
     $FUNCTION_TRANS = array('osx:parseJson' => 'json_decode', 'osx:decodeBase64' => 'base64_decode', 'osx:urlEncode' => 'rawurlencode', 'osx:urlDecode' => 'rawurldecode');
     $params = array();
     foreach ($this->exp as $param) {
         array_push($params, $param->value);
     }
     $val = call_user_func_array($FUNCTION_TRANS[$this->reason->value], $params);
     return new Token(ExpType::detectType($val), $val);
 }