protected function calculateColumnPosition(Node $node) {
    // Add tokens until have whitespace containing newline.
    $column_position = 1;
    $start_token = $node instanceof ParentNode ? $node->firstToken() : $node;
    $token = $start_token;
    while ($token = $token->previousToken()) {
      if ($token instanceof WhitespaceNode && $token->getNewlineCount() > 0) {
        $lines = explode($this->config['nl'], $token->getText());
        $last_line = end($lines);
        $column_position += strlen($last_line);
        break;
      }
      $column_position += strlen($token->getText());
    }
    return $column_position;
  }
protected function calculateColumnPosition(Node $node) {
    // Add tokens until have whitespace containing newline.
    $column_position = 1;
    $start_token = $node instanceof ParentNode ? $node->firstToken() : $node;
    $token = $start_token;
    while ($token = $token->previousToken()) {
      if ($token instanceof WhitespaceNode && $token->getNewlineCount() > 0) {
        $lines = explode($this->config['nl'], $token->getText());
        $last_line = end($lines);
        $column_position += strlen($last_line);
        break;
      }
      $column_position += strlen($token->getText());
    }
    return $column_position;
  }
protected function calculateColumnPosition ( Node $ node ) { // Add tokens until have whitespace containing newline. $ column_position = 1 ; $ start_token = $ node instanceof ParentNode ? $ node -> firstToken ( ) : $ node ; $ token = $ start_token ; while ( $ token = $ token -> previousToken ( ) ) { if ( $ token instanceof WhitespaceNode && $ token -> getNewlineCount ( ) > 0 ) { $ lines = explode ( $ this -> config [ 'nl' ] , $ token -> getText ( ) ) ; $ last_line = end ( $ lines ) ; $ column_position += strlen ( $ last_line ) ; break ; } $ column_position += strlen ( $ token -> getText ( ) ) ; } return $ column_position ; }
Calculate the column start position of the node.

@param Node $node
Node to calculate column position for.

@return int
Column position.
Calculate the column start position of the node .