/** * Append some segments at the end of this path */ public function append($path) { if (!is_array($path) && !is_string($path) && !$path instanceof Path) { $path = [$path]; } $path = new Path($path); $this->path = array_merge($this->toArray(), $path->toArray()); return $this; }