Route controller declaration using array syntax
jlambe opened this issue · comments
- 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.