示例#1
0
 /**
  * {@inheritdoc}
  */
 public function __invoke(array $data)
 {
     if (!isset($this->ast)) {
         $tokens = ExpressionParser::lex($this->expr, $this->vars);
         $this->ast = ExpressionParser::parseExpression($tokens);
     }
     return $this->ast->__invoke($data);
 }
示例#2
0
文件: Infix.php 项目: jivoo/data
 /**
  * {@inheritdoc}
  */
 public function toString(Quoter $quoter)
 {
     if (!$this->left instanceof Atomic) {
         return '(' . $this->left->toString($quoter) . ') ' . $this->operator . ' ' . $this->right->toString($quoter);
     }
     return $this->left->toString($quoter) . ' ' . $this->operator . ' ' . $this->right->toString($quoter);
 }