original_string: public function get_logic_flags($not) {
          // Work out which type of logic to use for the group.
          switch($this->op) {
              case self::OP_AND:
              case self::OP_OR:
                  $negative = false;
                  break;
              case self::OP_NOT_AND:
              case self::OP_NOT_OR:
                  $negative = true;
                  break;
              default:
                  throw new \coding_exception('Unknown operator');
          }
          switch($this->op) {
              case self::OP_AND:
              case self::OP_NOT_AND:
                  $andoperator = true;
                  break;
              case self::OP_OR:
              case self::OP_NOT_OR:
                  $andoperator = false;
                  break;
              default:
                  throw new \coding_exception('Unknown operator');
          }
  
          // Select NOT (or not) for children. It flips if this is a 'not' group.
          $innernot = $negative ? !$not : $not;
  
          // Select operator to use for this group. If flips for negative, because:
          // NOT (a AND b) = (NOT a) OR (NOT b)
          // NOT (a OR b) = (NOT a) AND (NOT b).
          if ($innernot) {
              $andoperator = !$andoperator;
          }
          return array($innernot, $andoperator);
      }
code: public function get_logic_flags($not) {
          // Work out which type of logic to use for the group.
          switch($this->op) {
              case self::OP_AND:
              case self::OP_OR:
                  $negative = false;
                  break;
              case self::OP_NOT_AND:
              case self::OP_NOT_OR:
                  $negative = true;
                  break;
              default:
                  throw new \coding_exception('Unknown operator');
          }
          switch($this->op) {
              case self::OP_AND:
              case self::OP_NOT_AND:
                  $andoperator = true;
                  break;
              case self::OP_OR:
              case self::OP_NOT_OR:
                  $andoperator = false;
                  break;
              default:
                  throw new \coding_exception('Unknown operator');
          }
  
          // Select NOT (or not) for children. It flips if this is a 'not' group.
          $innernot = $negative ? !$not : $not;
  
          // Select operator to use for this group. If flips for negative, because:
          // NOT (a AND b) = (NOT a) OR (NOT b)
          // NOT (a OR b) = (NOT a) AND (NOT b).
          if ($innernot) {
              $andoperator = !$andoperator;
          }
          return array($innernot, $andoperator);
      }
code_tokens: public function get_logic_flags ( $ not ) { // Work out which type of logic to use for the group. switch ( $ this -> op ) { case self :: OP_AND : case self :: OP_OR : $ negative = false ; break ; case self :: OP_NOT_AND : case self :: OP_NOT_OR : $ negative = true ; break ; default : throw new \ coding_exception ( 'Unknown operator' ) ; } switch ( $ this -> op ) { case self :: OP_AND : case self :: OP_NOT_AND : $ andoperator = true ; break ; case self :: OP_OR : case self :: OP_NOT_OR : $ andoperator = false ; break ; default : throw new \ coding_exception ( 'Unknown operator' ) ; } // Select NOT (or not) for children. It flips if this is a 'not' group. $ innernot = $ negative ? ! $ not : $ not ; // Select operator to use for this group. If flips for negative, because: // NOT (a AND b) = (NOT a) OR (NOT b) // NOT (a OR b) = (NOT a) AND (NOT b). if ( $ innernot ) { $ andoperator = ! $ andoperator ; } return array ( $ innernot , $ andoperator ) ; }
docstring: Converts the operator for the tree into two flags used for computing
  the result.
  
  The 2 flags are $innernot (whether to set $not when calling for children)
  and $andoperator (whether to use AND or OR operator to combine children).
  
  @param bool $not Not flag passed to this tree
  @return array Array of the 2 flags ($innernot, $andoperator)
docstring_tokens: Converts the operator for the tree into two flags used for computing the result .