@@ -27,23 +27,13 @@ class Request
2727 private array $ _routeParameters = [];
2828 private array $ _errors = [];
2929 private DefaultIpResolver $ _ipResolver ;
30- private Cookie $ _cookie ;
31- private Get $ _get ;
32- private Post $ _post ;
33- private Server $ _server ;
34- private Session $ _session ;
3530
3631 /**
3732 * Request constructor.
3833 */
3934 public function __construct ()
4035 {
4136 $ this ->_ipResolver = new DefaultIpResolver ();
42- $ this ->_cookie = new Cookie ();
43- $ this ->_get = new Get ();
44- $ this ->_post = new Post ();
45- $ this ->_server = new Server ();
46- $ this ->_session = new Session ();
4737 }
4838
4939 /**
@@ -94,7 +84,7 @@ public function getClientIp(): string
9484 */
9585 public function get ( string $ key , mixed $ default = null ): mixed
9686 {
97- return $ this -> _get -> filterScalar ( $ key , $ default );
87+ return Get:: filterScalar ( $ key , $ default );
9888 }
9989
10090 /**
@@ -105,7 +95,7 @@ public function get( string $key, mixed $default = null ): mixed
10595 */
10696 public function post ( string $ key , mixed $ default = null ): mixed
10797 {
108- return $ this -> _post -> filterScalar ( $ key , $ default );
98+ return Post:: filterScalar ( $ key , $ default );
10999 }
110100
111101 /**
@@ -116,7 +106,7 @@ public function post( string $key, mixed $default = null ): mixed
116106 */
117107 public function server ( string $ key , mixed $ default = null ): mixed
118108 {
119- return $ this -> _server -> filterScalar ( $ key , $ default );
109+ return Server:: filterScalar ( $ key , $ default );
120110 }
121111
122112 /**
@@ -127,7 +117,7 @@ public function server( string $key, mixed $default = null ): mixed
127117 */
128118 public function session ( string $ key , mixed $ default = null ): mixed
129119 {
130- return $ this -> _session -> filterScalar ( $ key , $ default );
120+ return Session:: filterScalar ( $ key , $ default );
131121 }
132122
133123 /**
@@ -138,7 +128,7 @@ public function session( string $key, mixed $default = null ): mixed
138128 */
139129 public function cookie ( string $ key , mixed $ default = null ): mixed
140130 {
141- return $ this -> _cookie -> filterScalar ( $ key , $ default );
131+ return Cookie:: filterScalar ( $ key , $ default );
142132 }
143133
144134 /**
0 commit comments