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

Classname/Method Callable Arrays #3069

Merged
merged 3 commits into from Apr 19, 2021
Merged

Conversation

ddrv
Copy link
Contributor

@ddrv ddrv commented Apr 17, 2021

These changes will allow the route handler to be specified as an array. This allows you to open the handler method in PhPStorm in ctrl + click, and also allows you to avoid the "unused method" type of bindings.

For example:

<?php

$app->get('/', [App\Controllers\PageController::class, 'home'])->setName('home');

@coveralls
Copy link

coveralls commented Apr 17, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling 2b8774e on ddrv-fork:array-routes into 090498e on slimphp:4.x.

Copy link
Member

@l0gicgate l0gicgate left a comment

Choose a reason for hiding this comment

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

Great work, I like this. We're going to have to add documentation for this as well.

Slim/CallableResolver.php Outdated Show resolved Hide resolved
tests/CallableResolverTest.php Outdated Show resolved Hide resolved
ddrv added a commit to ddrv-fork/slimframework.com that referenced this pull request Apr 18, 2021
@ddrv
Copy link
Contributor Author

ddrv commented Apr 18, 2021

We're going to have to add documentation for this as well.

@ddrv ddrv requested a review from l0gicgate April 19, 2021 05:15
@l0gicgate l0gicgate added this to the 4.8.0 milestone Apr 19, 2021
@l0gicgate l0gicgate changed the title Array routes Classname/Method Callable Arrays Apr 19, 2021
@l0gicgate l0gicgate merged commit 8294d20 into slimphp:4.x Apr 19, 2021
@l0gicgate
Copy link
Member

@ddrv great work, thank you for your contribution

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.

None yet

3 participants