Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Cleanup route:list command. #15802

Merged
merged 1 commit into from
Oct 7, 2016

Conversation

garygreen
Copy link
Contributor

@garygreen garygreen commented Oct 7, 2016

Sorry about last PR. Was an oversight on my behalf for the new closure-style middlewares. I've tested this with closures, single function controllers, all working.

With this PR you'll see Closure in the middleware list, so at least you know some kind of middleware is being registered in controllers, if applicable.

@GrahamCampbell GrahamCampbell changed the title Cleanup route:list command. [5.3] Cleanup route:list command. Oct 7, 2016
$results[] = Arr::get($middleware, $data['middleware'], $data['middleware']);
foreach ($middlewares as $i => $middleware) {
if ($middleware instanceof Closure) {
$middlewares[$i] = 'Closure';
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know what the standards are for Laravel, but I (personally) would rewrite this with references:

foreach ($middlewares as &$middleware) {
    if ($middleware instanceof Closure) {
        $middleware = 'Closure';
    }
}

@taylorotwell taylorotwell merged commit d978cbb into laravel:5.3 Oct 7, 2016
@taylorotwell
Copy link
Member

Nice, thanks. Changed over the loop to use a collection->map operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants