Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit d62fb80

Browse files
committed
Incorporates feedback from pull request
- Adds a few typehints that were missing
1 parent 5acb323 commit d62fb80

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/Application.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function __construct(
109109
* @param callable|string $middleware Middleware (or middleware service name) to associate with route.
110110
* @param null|string $name The name of the route.
111111
*/
112-
public function get($path, $middleware, string $name = null) : Router\Route
112+
public function get(string $path, $middleware, string $name = null) : Router\Route
113113
{
114114
return $this->route($path, $middleware, ['GET'], $name);
115115
}
@@ -118,7 +118,7 @@ public function get($path, $middleware, string $name = null) : Router\Route
118118
* @param callable|string $middleware Middleware (or middleware service name) to associate with route.
119119
* @param null|string $name The name of the route.
120120
*/
121-
public function post($path, $middleware, $name = null) : Router\Route
121+
public function post(string $path, $middleware, $name = null) : Router\Route
122122
{
123123
return $this->route($path, $middleware, ['POST'], $name);
124124
}
@@ -127,7 +127,7 @@ public function post($path, $middleware, $name = null) : Router\Route
127127
* @param callable|string $middleware Middleware (or middleware service name) to associate with route.
128128
* @param null|string $name The name of the route.
129129
*/
130-
public function put($path, $middleware, string $name = null) : Router\Route
130+
public function put(string $path, $middleware, string $name = null) : Router\Route
131131
{
132132
return $this->route($path, $middleware, ['PUT'], $name);
133133
}
@@ -136,7 +136,7 @@ public function put($path, $middleware, string $name = null) : Router\Route
136136
* @param callable|string $middleware Middleware (or middleware service name) to associate with route.
137137
* @param null|string $name The name of the route.
138138
*/
139-
public function patch($path, $middleware, string $name = null) : Router\Route
139+
public function patch(string $path, $middleware, string $name = null) : Router\Route
140140
{
141141
return $this->route($path, $middleware, ['PATCH'], $name);
142142
}
@@ -145,7 +145,7 @@ public function patch($path, $middleware, string $name = null) : Router\Route
145145
* @param callable|string $middleware Middleware (or middleware service name) to associate with route.
146146
* @param null|string $name The name of the route.
147147
*/
148-
public function delete($path, $middleware, string $name = null) : Router\Route
148+
public function delete(string $path, $middleware, string $name = null) : Router\Route
149149
{
150150
return $this->route($path, $middleware, ['DELETE'], $name);
151151
}
@@ -154,7 +154,7 @@ public function delete($path, $middleware, string $name = null) : Router\Route
154154
* @param callable|string $middleware Middleware (or middleware service name) to associate with route.
155155
* @param null|string $name The name of the route.
156156
*/
157-
public function any($path, $middleware, string $name = null) : Router\Route
157+
public function any(string $path, $middleware, string $name = null) : Router\Route
158158
{
159159
return $this->route($path, $middleware, null, $name);
160160
}
@@ -191,6 +191,7 @@ public function any($path, $middleware, string $name = null) : Router\Route
191191
*
192192
* @param string|array|callable $path Either a URI path prefix, or middleware.
193193
* @param null|string|array|callable $middleware Middleware
194+
* @return $this
194195
*/
195196
public function pipe($path, $middleware = null) : parent
196197
{
@@ -297,7 +298,7 @@ public function route(string $path, $middleware, array $methods = null, string $
297298
*
298299
* @return Router\Route[]
299300
*/
300-
public function getRoutes() : iterable
301+
public function getRoutes() : array
301302
{
302303
return $this->routes;
303304
}

src/ApplicationConfigInjectionTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ private function createCollectionMapper() : callable
238238
* The function is useful to reduce an array of pipeline middleware to a
239239
* priority queue.
240240
*/
241-
private function createPriorityQueueReducer()
241+
private function createPriorityQueueReducer() : callable
242242
{
243243
// $serial is used to ensure that items of the same priority are enqueued
244244
// in the order in which they are inserted.

0 commit comments

Comments
 (0)