File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed
Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,6 @@ class Request extends Message implements MessageInterface, RequestInterface
4343 */
4444 protected $ uri ;
4545
46- //--------------------------------------------------------------------
47-
4846 /**
4947 * Constructor.
5048 *
@@ -68,8 +66,6 @@ public function __construct($config = null)
6866 }
6967 }
7068
71- //--------------------------------------------------------------------
72-
7369 /**
7470 * Validate an IP address
7571 *
@@ -85,8 +81,6 @@ public function isValidIP(string $ip = null, string $which = null): bool
8581 return (new FormatRules ())->valid_ip ($ ip , $ which );
8682 }
8783
88- //--------------------------------------------------------------------
89-
9084 /**
9185 * Get the request method.
9286 *
@@ -101,8 +95,6 @@ public function getMethod(bool $upper = false): string
10195 return ($ upper ) ? strtoupper ($ this ->method ) : strtolower ($ this ->method );
10296 }
10397
104- //--------------------------------------------------------------------
105-
10698 /**
10799 * Sets the request method. Used when spoofing the request.
108100 *
@@ -124,16 +116,16 @@ public function setMethod(string $method)
124116 *
125117 * @param string $method
126118 *
127- * @return self
119+ * @return static
128120 */
129121 public function withMethod ($ method )
130122 {
131- $ clone = clone $ this ;
123+ $ request = clone $ this ;
132124
133- return $ clone ->setMethod ($ method );
134- }
125+ $ request ->method = $ method ;
135126
136- //--------------------------------------------------------------------
127+ return $ request ;
128+ }
137129
138130 /**
139131 * Retrieves the URI instance.
You can’t perform that action at this time.
0 commit comments