original_string: protected function addNode(BaseGraph $graph, $nodeId, array $components, Node $parentNode = null)
      {
          $absNodeId = (($parentNode instanceof Node) ? $parentNode->getId() : '/').$nodeId;
          $graph->node(
              $absNodeId,
              [
                  'label' => $nodeId,
                  'shape' => 'none',
                  'style' => 'none',
              ]
          );
  
          if ($parentNode instanceof Node) {
              $graph->edge(
                  [$parentNode->getId(), $absNodeId], ['arrowhead' => 'none', 'color' => 'darkgrey', 'penwidth' => .5]
              );
          }
  
          return $this->addComponents($graph, $components, $graph->get($absNodeId));
      }
code: protected function addNode(BaseGraph $graph, $nodeId, array $components, Node $parentNode = null)
      {
          $absNodeId = (($parentNode instanceof Node) ? $parentNode->getId() : '/').$nodeId;
          $graph->node(
              $absNodeId,
              [
                  'label' => $nodeId,
                  'shape' => 'none',
                  'style' => 'none',
              ]
          );
  
          if ($parentNode instanceof Node) {
              $graph->edge(
                  [$parentNode->getId(), $absNodeId], ['arrowhead' => 'none', 'color' => 'darkgrey', 'penwidth' => .5]
              );
          }
  
          return $this->addComponents($graph, $components, $graph->get($absNodeId));
      }
code_tokens: protected function addNode ( BaseGraph $ graph , $ nodeId , array $ components , Node $ parentNode = null ) { $ absNodeId = ( ( $ parentNode instanceof Node ) ? $ parentNode -> getId ( ) : '/' ) . $ nodeId ; $ graph -> node ( $ absNodeId , [ 'label' => $ nodeId , 'shape' => 'none' , 'style' => 'none' , ] ) ; if ( $ parentNode instanceof Node ) { $ graph -> edge ( [ $ parentNode -> getId ( ) , $ absNodeId ] , [ 'arrowhead' => 'none' , 'color' => 'darkgrey' , 'penwidth' => .5 ] ) ; } return $ this -> addComponents ( $ graph , $ components , $ graph -> get ( $ absNodeId ) ) ; }
docstring: Add a node to a graph
  
  @param BaseGraph $graph  Graph
  @param string $nodeId    Node ID
  @param array $components Component list
  @param Node $parentNode  Parent node
  
  @return BaseGraph Graph
docstring_tokens: Add a node to a graph