vendredi 8 novembre 2019

PHP get_declared_classes() doesn't returns all classes

I'm trying to do some reflection in my Laravel 5.8 app and I need to get my app's class names. So I checked get_declared_classes() and it returns a lot of classes but not all of them. I mean, I would like to have all files under app folder on that list, but some are missing.

Example: My model classes under App\Models are displayed, but my classes under App\Http\Controllers are not, like classes under App\ViewModels as well.

What I don't get is why some classes are shown and others are not? There is any particularity for classes to be returned in that function? It's wierd for me because classes under App\Models has nothing specifically different from the others.





Aucun commentaire:

Enregistrer un commentaire