@@ -60,36 +60,71 @@ public function listen(ServerInterface $socket, callable $callback = null, Strat
60
60
$ httpServer ->listen ($ socket );
61
61
}
62
62
63
+ /**
64
+ * Add a callback to the to be added path for the GET method
65
+ * @param string $path
66
+ * @param callable $callable
67
+ */
63
68
public function get (string $ path , callable $ callable )
64
69
{
65
70
$ this ->functions ['get ' ][$ path ] = $ callable ;
66
71
}
67
72
73
+ /**
74
+ * Add a callback to the to be added path for the POST method
75
+ * @param string $path
76
+ * @param callable $callable
77
+ */
68
78
public function post (string $ path , callable $ callable )
69
79
{
70
80
$ this ->functions ['post ' ][$ path ] = $ callable ;
71
81
}
72
82
83
+ /**
84
+ * Add a callback to the to be added path for the PUT method
85
+ * @param string $path
86
+ * @param callable $callable
87
+ */
73
88
public function put (string $ path , callable $ callable )
74
89
{
75
90
$ this ->functions ['put ' ][$ path ] = $ callable ;
76
91
}
77
92
93
+ /**
94
+ * Add a callback to the to be added path for the DELETE method
95
+ * @param string $path
96
+ * @param callable $callable
97
+ */
78
98
public function delete (string $ path , callable $ callable )
79
99
{
80
100
$ this ->functions ['delete ' ][$ path ] = $ callable ;
81
101
}
82
102
103
+ /**
104
+ * Add a callback to the to be added path for the HEAD method
105
+ * @param string $path
106
+ * @param callable $callable
107
+ */
83
108
public function head (string $ path , callable $ callable )
84
109
{
85
110
$ this ->functions ['head ' ][$ path ] = $ callable ;
86
111
}
87
112
113
+ /**
114
+ * Add a callback to the to be added path for the OPTIONS method
115
+ * @param string $path
116
+ * @param callable $callable
117
+ */
88
118
public function options (string $ path , callable $ callable )
89
119
{
90
120
$ this ->functions ['options ' ][$ path ] = $ callable ;
91
121
}
92
122
123
+ /**
124
+ * Add a callback to the to be added path for the TRACE method
125
+ * @param string $path
126
+ * @param callable $callable
127
+ */
93
128
public function trace (string $ path , callable $ callable )
94
129
{
95
130
$ this ->functions ['trace ' ][$ path ] = $ callable ;
0 commit comments