original_string: public function hasChild($one, $two = null)
  	{
  		$hasChild = false;
  		
  		// if the first argument is an Element or an index
  		$isOneElement = $one instanceof Element;
  		$isOneIndex   = is_numeric($one) && is_int(+$one);
  		if ($isOneElement || $isOneIndex) {
  			// if the second argument is null, an Element, or an Index
  			$isTwoNull    = $two === null;
  			$isTwoElement = $two instanceof Element;
  			$isTwoIndex   = is_numeric($two) && is_int(+$two);
  			if ($isTwoNull || $isTwoElement || $isTwoIndex) {
  				// decide what to do
  				if ($isOneElement && $isTwoNull) {
  					// return true if *the* element exists at *any* index
  					$hasChild = $this->getChildIndex($one) !== false;
  				} elseif ($isOneElement && $isTwoIndex) {
  					// return true if *the* element exists at *the* index
  					$hasChild = $this->getChildIndex($one) === $two;
  				} elseif ($isOneIndex && $isTwoNull) {
  					// return true if *any* element exists at *the* index
  					$hasChild = array_key_exists($one, $this->children) 
  						&& ! empty($this->children[$one]);
  				} elseif ($isOneIndex && $isTwoElement) {
  					// return true if *the* element exists at *the* index
  					$hasChild = $this->getChildIndex($two) === $one;
  				} else {
  					throw new \BadMethodCallException(
  						__METHOD__."() expects one or two parameters: an element, an index, or both "
  							. "(in any order)"
  					);
  				}
  			} else {
  				throw new \InvalidArgumentException(
  					__METHOD__."() expects parameter two to be null, Element, or integer"
  				);
  			}
  		} else {
  			throw new \InvalidArgumentException(
  				__METHOD__."() expects parameter one to be an Element or integer"
  			);
  		}
  		
  		return $hasChild;
  	}
code: public function hasChild($one, $two = null)
  	{
  		$hasChild = false;
  		
  		// if the first argument is an Element or an index
  		$isOneElement = $one instanceof Element;
  		$isOneIndex   = is_numeric($one) && is_int(+$one);
  		if ($isOneElement || $isOneIndex) {
  			// if the second argument is null, an Element, or an Index
  			$isTwoNull    = $two === null;
  			$isTwoElement = $two instanceof Element;
  			$isTwoIndex   = is_numeric($two) && is_int(+$two);
  			if ($isTwoNull || $isTwoElement || $isTwoIndex) {
  				// decide what to do
  				if ($isOneElement && $isTwoNull) {
  					// return true if *the* element exists at *any* index
  					$hasChild = $this->getChildIndex($one) !== false;
  				} elseif ($isOneElement && $isTwoIndex) {
  					// return true if *the* element exists at *the* index
  					$hasChild = $this->getChildIndex($one) === $two;
  				} elseif ($isOneIndex && $isTwoNull) {
  					// return true if *any* element exists at *the* index
  					$hasChild = array_key_exists($one, $this->children) 
  						&& ! empty($this->children[$one]);
  				} elseif ($isOneIndex && $isTwoElement) {
  					// return true if *the* element exists at *the* index
  					$hasChild = $this->getChildIndex($two) === $one;
  				} else {
  					throw new \BadMethodCallException(
  						__METHOD__."() expects one or two parameters: an element, an index, or both "
  							. "(in any order)"
  					);
  				}
  			} else {
  				throw new \InvalidArgumentException(
  					__METHOD__."() expects parameter two to be null, Element, or integer"
  				);
  			}
  		} else {
  			throw new \InvalidArgumentException(
  				__METHOD__."() expects parameter one to be an Element or integer"
  			);
  		}
  		
  		return $hasChild;
  	}
code_tokens: public function hasChild ( $ one , $ two = null ) { $ hasChild = false ; // if the first argument is an Element or an index $ isOneElement = $ one instanceof Element ; $ isOneIndex = is_numeric ( $ one ) && is_int ( + $ one ) ; if ( $ isOneElement || $ isOneIndex ) { // if the second argument is null, an Element, or an Index $ isTwoNull = $ two === null ; $ isTwoElement = $ two instanceof Element ; $ isTwoIndex = is_numeric ( $ two ) && is_int ( + $ two ) ; if ( $ isTwoNull || $ isTwoElement || $ isTwoIndex ) { // decide what to do if ( $ isOneElement && $ isTwoNull ) { // return true if *the* element exists at *any* index $ hasChild = $ this -> getChildIndex ( $ one ) !== false ; } elseif ( $ isOneElement && $ isTwoIndex ) { // return true if *the* element exists at *the* index $ hasChild = $ this -> getChildIndex ( $ one ) === $ two ; } elseif ( $ isOneIndex && $ isTwoNull ) { // return true if *any* element exists at *the* index $ hasChild = array_key_exists ( $ one , $ this -> children ) && ! empty ( $ this -> children [ $ one ] ) ; } elseif ( $ isOneIndex && $ isTwoElement ) { // return true if *the* element exists at *the* index $ hasChild = $ this -> getChildIndex ( $ two ) === $ one ; } else { throw new \ BadMethodCallException ( __METHOD__ . "() expects one or two parameters: an element, an index, or both " . "(in any order)" ) ; } } else { throw new \ InvalidArgumentException ( __METHOD__ . "() expects parameter two to be null, Element, or integer" ) ; } } else { throw new \ InvalidArgumentException ( __METHOD__ . "() expects parameter one to be an Element or integer" ) ; } return $ hasChild ; }
docstring: Returns true if the group has the child
  
  I'll accept one or two arguments: if both an element and an index are given
  (in any order), I'll return true if *the* element exists at the index; if
  only an element is given, I'll return true if the element exists at *any*
  index; and, finally, if only an index is given, I'll return true if *any*
  element exists at the index.
  
  @param  Jstewmc\Rtf\Element|integer  $one  the element or index to test
  @param  Jstewmc\Rtf\Element|integer|null  $two  the element or index to test
  (optional; if omitted, defaults to null)
  @return  bool
  @throws  InvalidArgumentException  if $one is not an element or integer
  @throws  InvalidArgumentException  if $two is not null, an element, or an
  integer
  @throws  BadMethodCallException    if an element, and element or both are not
  given
  @since  0.1.0
docstring_tokens: Returns true if the group has the child