Inserts a node in the branch graph.

@param BranchGraphNode $branch
548723
public function insert(self $branch)
    {
        if (!\in_array($branch, $this->branches)) {
            $this->branches[] = $branch;
        }
    }
602301
function insert (builder, node) {
	finishPending (builder);

	appendNode (builder, spec.insertNode (node [1]));
}
548378
public function addOutEdge(DocumentGraphEdge $edge): void
    {
        $this->outEdges[$edge->getDestination()->className] = $edge;
    }
769979
void addBranches(int lineNumber, int numberOfBranches) {
    int lineIdx = lineNumber - 1;
    Integer currentValue = branchesInLine.get(Integer.valueOf(lineIdx));
    if (currentValue == null) {
      branchesInLine.put(lineIdx, numberOfBranches);
    } else {
      branchesInLine.put(lineIdx, currentValue + numberOfBranches);
    }
  }
758683
public function set_branch_on_install( $install ) {
		$this->set_repo_cache( 'current_branch', $install['github_updater_branch'], $install['repo'] );
		self::$options[ 'current_branch_' . $install['repo'] ] = $install['github_updater_branch'];
		update_site_option( 'github_updater', self::$options );
	}
1170908
public function setBranches($name, $branch, $add = false)
    {
        $this->arguments[] = 'set-branches';
        if ($add) {
            $this->arguments[] = '--add';
        }
        $this->arguments[] = $name;
        $this->arguments[] = $branch;
        return $this;
    }
1026574
def new_branch(self, branch, parent, parent_turn, parent_tick):
        
        return self.sql('branches_insert', branch, parent, parent_turn, parent_tick, parent_turn, parent_tick)
678244
public function publishBase($branch = null, $tag = null)
    {
        if (!$branch) {
            $branch = self::STABLE_BRANCH;
        }

        $this->say("Updating Codeception Base distribution");

        $tempBranch = "tmp".uniqid();

        $this->taskGitStack()
            ->checkout("-b $tempBranch")
            ->run();

        $this->taskReplaceInFile('composer.json')
            ->from('"codeception/codeception"')
            ->to('"codeception/base"')
            ->run();

        $this->taskReplaceInFile('composer.json')
            ->regex('~^\s+"facebook\/webdriver".*$~m')
            ->to('')
            ->run();

        $this->taskReplaceInFile('composer.json')
            ->regex('~^\s+"guzzlehttp\/guzzle".*$~m')
            ->to('')
            ->run();

        $this->taskComposerUpdate()->run();
        $this->taskGitStack()
            ->add('composer.json')
            ->commit('auto-update')
            ->exec("push -f base $tempBranch:$branch")
            ->run();

        if ($tag) {
            $this->taskGitStack()
                ->exec("tag -d $tag")
                ->exec("push base :refs/tags/$tag")
                ->exec("tag $tag")
                ->push('base', $tag)
                ->run();
        }

        $this->taskGitStack()
            ->checkout('-- composer.json')
            ->checkout($branch)
            ->exec("branch -D $tempBranch")
            ->run();
    }
603965
public function addChildAsLast(Node $node)
    {
        if(null === $this->children)
        {
            $this->children = array();
        }

        $this->children[] = $node;
    }
720221
public function connect(string $source, string $destination): void
    {
        $outNode = $this->nodes[$source];
        $inNode = $this->nodes[$destination];

        $edge = new DocumentGraphEdge($outNode, $inNode);

        $outNode->addOutEdge($edge);
        $inNode->addInEdge($edge);
    }
289028
public function push($remote = null, $branch = null)
    {
        $result = $this->command . ' push ' . $remote . ' ' . $branch;
        return $result;
    }
118990
public function addNode(Node $node): self
	{
		$id = $node->getId();

		if (isset($this->nodes[$id])) {
			throw new DuplicateNodeException(sprintf("Node \"%s\" already present in the graph.", $id));
		}

		// Add element
		$this->nodes[$id] = $node;

		// Update attr indexes
		$this->nodeAttrIndex->insertElement($node);

		return $this;
	}
1124311
public function add(NodeInterface $node)
    {
        if ($node instanceof BranchNodeInterface) {
            // this node is a branch
            $childFlow = $node->getPayload();
            $this->branchFlowCheck($childFlow);
            $childFlow->setParent($this);
        }

        $node->setCarrier($this);

        $this->flowMap->register($node, $this->nodeIdx);
        $this->nodes[$this->nodeIdx] = $node;

        ++$this->nodeIdx;

        return $this;
    }
1345553
private void populateGraph(final EntityGraph<?> graph, final Set<String> fetches)
	{
		Map<String, Subgraph<?>> created = new HashMap<>();

		for (String fetch : fetches)
		{
			final String[] parts = StringUtils.split(fetch, '.');

			// Starts of null (meaning parent is the root graph), updated as we go through path segments to refer to the last path segment
			Subgraph<?> parent = null;

			// Iterate over the path segments, adding attributes subgraphs
			for (int i = 0; i < parts.length; i++)
			{
				final String path = StringUtils.join(parts, '.', 0, i + 1);
				final boolean isLeaf = (i == parts.length - 1);

				final Subgraph<?> existing = created.get(path);

				if (existing == null)
				{
					if (parent == null)
					{
						try
						{
							// Relation under root
							graph.addAttributeNodes(parts[i]);

							// Only set up a subgraph if this is not a leaf node
							// This prevents us trying to add a Subgraph for a List of Embeddable
							if (!isLeaf)
								parent = graph.addSubgraph(parts[i]);
						}
						catch (IllegalArgumentException e)
						{
							throw new IllegalArgumentException("Error adding graph member " +
							                                   parts[i] +
							                                   " with isLeaf=" +
							                                   isLeaf +
							                                   " to root as part of " +
							                                   fetch, e);
						}
					}
					else
					{
						try
						{
							// Relation under parent
							parent.addAttributeNodes(parts[i]);

							// Only set up a subgraph if this is not a leaf node
							// This prevents us trying to add a Subgraph for a List of Embeddable
							if (!isLeaf)
								parent = parent.addSubgraph(parts[i]);
						}
						catch (IllegalArgumentException e)
						{
							throw new IllegalArgumentException("Error adding graph member " +
							                                   parts[i] +
							                                   " with isLeaf=" +
							                                   isLeaf +
							                                   " as part of " +
							                                   fetch +
							                                   " with parent.class=" +
							                                   parent.getClassType(), e);
						}
					}

					if (!isLeaf)
						created.put(path, parent);
				}
				else
				{
					// Already seen this graph node before
					parent = existing;
				}
			}
		}
	}
3934
public function addChild(TreeNodeInterface $node): void
    {
        $this->children[] = $node;
        $this->isLeaf = false;
    }
625410
public static function setup(/* mixed */ $obj): void
    {
        if($obj instanceof Graph\GraphInterface) {
            Hooks\Graph::setup($obj);
        }
        // . (on purpose)
        if($obj instanceof Graph\EdgeInterface) {
            Hooks\Edge::setup($obj);
        }
        elseif($obj instanceof Graph\NodeInterface) {
            Hooks\Node::setup($obj);
        }
        elseif($obj instanceof AbstractNotification) {
            Hooks\Notification::setup($obj);
        }
    }
1077566
private function addNode(NodeInterface $node)
    {
        $this->nodeIndex++;
        $this->graph['nodes'][] = $node->toArray();

        return $this->nodeIndex;
    }