Skip to content

Route controller declaration using array syntax #892

Description

@jlambe
  • 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions