/**
  * Parse assertions which are a collection of others
  *
  * @param string $combinator How are they combinded? E.g. "||"
  * @param string $docString  The DocBlock piece to search in
  *
  * @throws \TechDivision\PBC\Exceptions\ParserException
  *
  * @return \TechDivision\PBC\Entities\Assertions\ChainedAssertion
  */
 protected function parseChainedAssertion($combinator, $docString)
 {
     // Get all the parts of the string
     $assertionArray = explode(' ', $docString);
     // Check all string parts for the | character
     $combinedPart = '';
     $combinedIndex = 0;
     foreach ($assertionArray as $key => $assertionPart) {
         // Check which part contains the | but does not only consist of it
         if ($this->filterOrCombinator($assertionPart) && trim($assertionPart) !== '|') {
             $combinedPart = trim($assertionPart);
             $combinedIndex = $key;
             break;
         }
     }
     // Check if we got anything of value
     if (empty($combinedPart)) {
         throw new ParserException('Error parsing what seems to be a |-combined assertion ' . $docString);
     }
     // Now we have to create all the separate assertions for each part of the $combinedPart string
     $assertionList = new AssertionList();
     foreach (explode('|', $combinedPart) as $partString) {
         // Rebuild the assertion string with one partial string of the combined part
         $tmp = $assertionArray;
         $tmp[$combinedIndex] = $partString;
         $assertion = $this->parseAssertion(implode(' ', $tmp));
         if (is_bool($assertion)) {
             continue;
         } else {
             $assertionList->add($assertion);
         }
         $assertion = false;
     }
     // We got everything. Create a ChainedAssertion instance
     return new ChainedAssertion($assertionList, '||');
 }