public function __construct(string $name, int $from, int $to) { if ($from > $to) { list($to, $from) = [$from, $to]; } $this->name = $name; $this->from = $from; $this->to = $to; }