File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
src/WaterPipe/HTTP/Request Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 3737class RequestUri implements \ArrayAccess
3838{
3939 /**
40- * @type string
40+ * @var string
4141 */
42- private const URI_PARAM_PATTERN = "# :(\w+)# " ;
42+ private const URI_PARAM_PATTERN = "/ :(\w+)/ " ;
4343
4444 /**
4545 * @var string
@@ -61,6 +61,18 @@ class RequestUri implements \ArrayAccess
6161 */
6262 private $ _built = false ;
6363
64+ /**
65+ * Checks if the this URI is equal tu the given one.
66+ *
67+ * @param string $uri The URI to compare with this instance.
68+ *
69+ * @return bool
70+ */
71+ public function is (string $ uri ): bool
72+ {
73+ return strtolower (trim ($ this ->_uri , "/ " )) === strtolower (trim ($ uri , "/ " ));
74+ }
75+
6476 /**
6577 * @param string $pattern
6678 *
@@ -266,4 +278,4 @@ public function offsetUnset($offset)
266278 unset($ this ->_params [$ offset ]);
267279 }
268280 }
269- }
281+ }
You can’t perform that action at this time.
0 commit comments