themosis / framework

The Themosis framework core.
https://framework.themosis.com/
GNU General Public License v2.0
671 stars 121 forks source link

Route controller declaration using array syntax #892

Open jlambe opened 1 year ago

jlambe commented 1 year ago

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.