original_string: public function addComparison($varComparison)
      {
          $objComparison = null;
  
          if (is_array($varComparison)) {
              $varArguments = array_keys($varComparison);
              if (isset($varComparison["subject"])) {
                  // Apparently, this is an associative array
                  $varArguments = array_values($varComparison);
              }
  
              try {
                  // @todo Replace Reflection with call_user_func_array()
                  $objReflection = new \ReflectionClass("Comparison");
                  $objComparison = $objReflection->newInstanceArgs($varArguments);
              } catch (\Exception $e) {
                  throw new \Exception("Failed to add Comparison: " . $e->getMessage(), 1);
              }
  
              if (is_object($objComparison)) {
                  array_push($this->__comparisons, $objComparison);
              } else {
                  throw new \InvalidArgumentException("No valid comparison data supplied in addComparison() method.", 1);
              }
          } elseif (is_object($varComparison) && get_class($varComparison) === "ValidFormBuilder\\Comparison") {
              array_push($this->__comparisons, $varComparison);
          } else {
              throw new \InvalidArgumentException("No valid comparison data supplied in addComparison() method.", 1);
          }
      }
code: public function addComparison($varComparison)
      {
          $objComparison = null;
  
          if (is_array($varComparison)) {
              $varArguments = array_keys($varComparison);
              if (isset($varComparison["subject"])) {
                  // Apparently, this is an associative array
                  $varArguments = array_values($varComparison);
              }
  
              try {
                  // @todo Replace Reflection with call_user_func_array()
                  $objReflection = new \ReflectionClass("Comparison");
                  $objComparison = $objReflection->newInstanceArgs($varArguments);
              } catch (\Exception $e) {
                  throw new \Exception("Failed to add Comparison: " . $e->getMessage(), 1);
              }
  
              if (is_object($objComparison)) {
                  array_push($this->__comparisons, $objComparison);
              } else {
                  throw new \InvalidArgumentException("No valid comparison data supplied in addComparison() method.", 1);
              }
          } elseif (is_object($varComparison) && get_class($varComparison) === "ValidFormBuilder\\Comparison") {
              array_push($this->__comparisons, $varComparison);
          } else {
              throw new \InvalidArgumentException("No valid comparison data supplied in addComparison() method.", 1);
          }
      }
code_tokens: public function addComparison ( $ varComparison ) { $ objComparison = null ; if ( is_array ( $ varComparison ) ) { $ varArguments = array_keys ( $ varComparison ) ; if ( isset ( $ varComparison [ "subject" ] ) ) { // Apparently, this is an associative array $ varArguments = array_values ( $ varComparison ) ; } try { // @todo Replace Reflection with call_user_func_array() $ objReflection = new \ ReflectionClass ( "Comparison" ) ; $ objComparison = $ objReflection -> newInstanceArgs ( $ varArguments ) ; } catch ( \ Exception $ e ) { throw new \ Exception ( "Failed to add Comparison: " . $ e -> getMessage ( ) , 1 ) ; } if ( is_object ( $ objComparison ) ) { array_push ( $ this -> __comparisons , $ objComparison ) ; } else { throw new \ InvalidArgumentException ( "No valid comparison data supplied in addComparison() method." , 1 ) ; } } elseif ( is_object ( $ varComparison ) && get_class ( $ varComparison ) === "ValidFormBuilder\\Comparison" ) { array_push ( $ this -> __comparisons , $ varComparison ) ; } else { throw new \ InvalidArgumentException ( "No valid comparison data supplied in addComparison() method." , 1 ) ; } }
docstring: Add new comparison to Condition
  
  @param Comparison|array $varComparison Comparison array or Comparison object
  @throws \Exception if Reflection couldn't initialize new Comparison object
  @throws \InvalidArgumentException if no valid Comparison data is supplied
docstring_tokens: Add new comparison to Condition