Skip to content

Commit 7d91c0e

Browse files
committed
docs: update PHPDocs
1 parent 406128f commit 7d91c0e

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

‎system/HTTP/URI.php‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,8 @@ public function __construct(?string $uri = null)
263263
* If $silent == true, then will not throw exceptions and will
264264
* attempt to continue gracefully.
265265
*
266+
* Note: Method not in PSR-7
267+
*
266268
* @return URI
267269
*/
268270
public function setSilent(bool $silent = true)
@@ -276,6 +278,8 @@ public function setSilent(bool $silent = true)
276278
* If $raw == true, then will use parseStr() method
277279
* instead of native parse_str() function.
278280
*
281+
* Note: Method not in PSR-7
282+
*
279283
* @return URI
280284
*/
281285
public function useRawQueryString(bool $raw = true)
@@ -291,6 +295,8 @@ public function useRawQueryString(bool $raw = true)
291295
* @return URI
292296
*
293297
* @throws HTTPException
298+
*
299+
* @deprecated This method will be private.
294300
*/
295301
public function setURI(?string $uri = null)
296302
{
@@ -408,6 +414,8 @@ public function getUserInfo()
408414
* Temporarily sets the URI to show a password in userInfo. Will
409415
* reset itself after the first call to authority().
410416
*
417+
* Note: Method not in PSR-7
418+
*
411419
* @return URI
412420
*/
413421
public function showPassword(bool $val = true)
@@ -567,6 +575,8 @@ public function getSegment(int $number, string $default = ''): string
567575
* Set the value of a specific segment of the URI path.
568576
* Allows to set only existing segments or add new one.
569577
*
578+
* Note: Method not in PSR-7
579+
*
570580
* @param int $number Segment number starting at 1
571581
* @param int|string $value
572582
*
@@ -598,6 +608,8 @@ public function setSegment(int $number, $value)
598608

599609
/**
600610
* Returns the total number of segments.
611+
*
612+
* Note: Method not in PSR-7
601613
*/
602614
public function getTotalSegments(): int
603615
{
@@ -665,6 +677,8 @@ private function changeSchemeAndPath(string $scheme, string $path): array
665677
/**
666678
* Parses the given string and saves the appropriate authority pieces.
667679
*
680+
* Note: Method not in PSR-7
681+
*
668682
* @return $this
669683
*/
670684
public function setAuthority(string $str)
@@ -694,6 +708,8 @@ public function setAuthority(string $str)
694708
* @see https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
695709
*
696710
* @return $this
711+
*
712+
* @TODO PSR-7: Should be `withScheme($scheme)`.
697713
*/
698714
public function setScheme(string $str)
699715
{
@@ -710,6 +726,8 @@ public function setScheme(string $str)
710726
* @param string $pass The user's password
711727
*
712728
* @return $this
729+
*
730+
* @TODO PSR-7: Should be `withUserInfo($user, $password = null)`.
713731
*/
714732
public function setUserInfo(string $user, string $pass)
715733
{
@@ -723,6 +741,8 @@ public function setUserInfo(string $user, string $pass)
723741
* Sets the host name to use.
724742
*
725743
* @return $this
744+
*
745+
* @TODO PSR-7: Should be `withHost($host)`.
726746
*/
727747
public function setHost(string $str)
728748
{
@@ -737,6 +757,8 @@ public function setHost(string $str)
737757
* @param int $port
738758
*
739759
* @return $this
760+
*
761+
* @TODO PSR-7: Should be `withPort($port)`.
740762
*/
741763
public function setPort(?int $port = null)
742764
{
@@ -761,6 +783,8 @@ public function setPort(?int $port = null)
761783
* Sets the path portion of the URI.
762784
*
763785
* @return $this
786+
*
787+
* @TODO PSR-7: Should be `withPath($port)`.
764788
*/
765789
public function setPath(string $path)
766790
{
@@ -824,6 +848,8 @@ public function refreshPath()
824848
* to clean the various parts of the query keys and values.
825849
*
826850
* @return $this
851+
*
852+
* @TODO PSR-7: Should be `withQuery($query)`.
827853
*/
828854
public function setQuery(string $query)
829855
{
@@ -854,6 +880,8 @@ public function setQuery(string $query)
854880
* portion of the URI.
855881
*
856882
* @return URI
883+
*
884+
* @TODO: PSR-7: Should be `withQueryParams(array $query)`
857885
*/
858886
public function setQueryArray(array $query)
859887
{
@@ -865,7 +893,9 @@ public function setQueryArray(array $query)
865893
/**
866894
* Adds a single new element to the query vars.
867895
*
868-
* @param int|string $value
896+
* Note: Method not in PSR-7
897+
*
898+
* @param int|string|null $value
869899
*
870900
* @return $this
871901
*/
@@ -879,6 +909,8 @@ public function addQuery(string $key, $value = null)
879909
/**
880910
* Removes one or more query vars from the URI.
881911
*
912+
* Note: Method not in PSR-7
913+
*
882914
* @param string ...$params
883915
*
884916
* @return $this
@@ -896,6 +928,8 @@ public function stripQuery(...$params)
896928
* Filters the query variables so that only the keys passed in
897929
* are kept. The rest are removed from the object.
898930
*
931+
* Note: Method not in PSR-7
932+
*
899933
* @param string ...$params
900934
*
901935
* @return $this
@@ -923,6 +957,8 @@ public function keepQuery(...$params)
923957
* @see https://tools.ietf.org/html/rfc3986#section-3.5
924958
*
925959
* @return $this
960+
*
961+
* @TODO PSR-7: Should be `withFragment($fragment)`.
926962
*/
927963
public function setFragment(string $string)
928964
{

0 commit comments

Comments
 (0)