public function setPotential($potential, VertexInterface $from) { $potential = (int) $potential; if (!$this->getPotential() || $potential < $this->getPotential()) { $this->potential = $potential; $this->potentialFrom = $from; return true; } return false; }