node1 = $node1; $this->node2 = $node2; $this->directed = $directed; } public function getNodes() : array { return [$this->node1, $this->node2]; } public function isDirected() : bool { return $this->directed; } }