Skip to content

Commit 70678fd

Browse files
authored
Fix #271: Fix examples in readme
1 parent 141ce47 commit 70678fd

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ $routes = [
8282

8383
// Add routes defined to route collector
8484
$collector = $container->get(RouteCollectorInterface::class);
85-
$collector->addRoute(Group::create(null)->routes($routes));
85+
$collector->addRoute(...$routes);
8686

8787
// Initialize URL matcher
8888
/** @var UrlMatcherInterface $urlMatcher */
@@ -216,12 +216,12 @@ $collector->addRoute(
216216
Group::create('/api')
217217
->middleware(ApiAuthentication::class)
218218
->host('https://example.com')
219-
->routes([
219+
->routes(
220220
Route::get('/comments'),
221-
Group::create('/posts')->routes([
221+
Group::create('/posts')->routes(
222222
Route::get('/list'),
223-
]),
224-
])
223+
),
224+
)
225225
);
226226
```
227227

@@ -252,10 +252,9 @@ use \Tuupola\Middleware\CorsMiddleware;
252252
return [
253253
Group::create('/api')
254254
->withCors(CorsMiddleware::class)
255-
->routes([
255+
->routes(
256256
// ...
257-
]
258-
);
257+
);
259258
];
260259
```
261260

0 commit comments

Comments
 (0)