dimanche 10 avril 2022

PHP get params from function inside of Namespace

I'm trying to get the params (names) of a function that is stored within a namespace and class. I've tried ReflectionFunction, but I can only make that work without namespaces and classes. The function I'm trying to call is non-static, which doesn't make it much easier.

namespace app\http;

class Test {
   public function func(User $user, $id) {
     return $user;
   } 
}

I'm trying to get "user" and "id" from here. Does someone have a suggestion?





Aucun commentaire:

Enregistrer un commentaire