Skip to content
Advertisement

Lint dynamic return types in PHP

I would like to be able to autocomplete when using my following code. I have looked for a solution, but just can’t seem to find anything.

This is about what my models look like. In the following example I would like to be able to tab example and test

JavaScript

My function to retrieve a model:

JavaScript

This is how I call a model:

JavaScript

I am looking forward to your ideas. I am very excited to hear your ideas for this problem! I am also open to suggestions regarding the getModel function itself of course.

Advertisement

Answer

Although I would still like to know how to achieve this without changing the process itself, but I have solved this problem by simply using static classes and namespaces. The linting is great like that.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement