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

Route controller declaration using array syntax #892

Open
jlambe opened this issue Feb 14, 2023 · 0 comments
Open

Route controller declaration using array syntax #892

jlambe opened this issue Feb 14, 2023 · 0 comments
Assignees
Milestone

Comments

@jlambe
Copy link
Contributor

jlambe commented Feb 14, 2023

  • Themosis Version: 3.0.0
  • WordPress Version: 6.1.1
  • PHP Version: 8.1

Description

ReflectionFunction::construct(): Argument 1 ($function) must be of type Closure|string, array given {"userId":null,"email":null,"exception":"[object] (TypeError(code: 0): ReflectionFunction::construct(): Argument 1 ($function) must be of type Closure|string, array given at C:...\vendor\illuminate\routing\RouteSignatureParameters.php:27)

Steps to reproduce

Define a post-type archive / WordPress route using this syntax:

Route::any('post-type-archive', ['news', 'uses' => [NewsController::class, 'index']]);

Expected behavior

Being able to reach the defined endpoint without triggering any exceptions.

@jlambe jlambe self-assigned this Feb 14, 2023
@jlambe jlambe added this to the 3.1 milestone Feb 14, 2023
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

No branches or pull requests

1 participant