예제 #1
0
 /**
  * @param SplitPosition $entry
  * @return string
  */
 public function createSpanStart(SplitPosition &$entry)
 {
     $depth = $entry->getLevel();
     $highlight = $entry->getHighlight();
     $type = $highlight ? $highlight->getType() : Highlight::UNDEFINED;
     $wrappendElement = "";
     if ($highlight) {
         $htmlElement = $highlight->getHtmlElement();
         if ($htmlElement) {
             $wrappendElement = $htmlElement->getOpeningText();
         }
     }
     return $this->createStyleWithPadding($type, $highlight->getInfoText(), $depth) . $wrappendElement;
 }
예제 #2
0
 private function splitPositionEntrySorter(SplitPosition $a, SplitPosition $b)
 {
     $leftAction = $a->getAction();
     $rightAction = $b->getAction();
     $leftAction = $leftAction == SplitPosition::ATOM ? SplitPosition::START : $leftAction;
     $rightAction = $rightAction == SplitPosition::ATOM ? SplitPosition::START : $rightAction;
     if ($leftAction != $rightAction) {
         return strcasecmp($leftAction, $rightAction);
     } else {
         return ($leftAction == SplitPosition::START ? 1 : -1) * $this->compare($a->getLevel(), $b->getLevel());
     }
 }