Skip to content

[5.3] Cleanup route:list command.#15802

Merged
taylorotwell merged 1 commit into
laravel:5.3from
garygreen:cleanup-route-list
Oct 7, 2016
Merged

[5.3] Cleanup route:list command.#15802
taylorotwell merged 1 commit into
laravel:5.3from
garygreen:cleanup-route-list

Conversation

@garygreen

@garygreen garygreen commented Oct 7, 2016

Copy link
Copy Markdown
Contributor

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
if ($middleware instanceof Closure) {
$middlewares[$i] = 'Closure';
}
}

Copy link
Copy Markdown
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
Copy Markdown
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