Skip to content

Commit

Permalink
Added fragment support to generated uri class
Browse files Browse the repository at this point in the history
  • Loading branch information
divineniiquaye committed May 29, 2022
1 parent c485774 commit 667b834
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Generator/GeneratedUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,16 @@ public function withQuery(array $queryParams = []): self

return $this;
}

/**
* Set the fragment component of the URI
*/
public function withFragment(string $fragment): self
{
if (!empty($fragment)) {
$this->pathInfo .= '#' . $fragment;
}

return $this;
}
}

0 comments on commit 667b834

Please sign in to comment.