I have inherited some code that I have to refactor intensely. Curious if the referencing is somehow explicitly mappable or "tellable." I know using phpDoc comments helped tremendously, but I have some code that calls ONE master function with a text string parameter that it takes in, and that string determines which method inside the class will run.

So for example, $this->authorHtml("catalogMaker", $paramsObj); will call the method in $this class named "catalogMaker($paramsObj)" and the devsense does not sniff that out as a reference of course.

I am not BLAMING it by any stretch of the imagination!! Just curious if there was a way to explicitly "teach it" or make a json somehow that would map all the authorHtml("parameters") to references somehow?

    JimNayzium Thank you for posting the question. That is an interesting use case.

    Currently, we don't have any way of telling the reference counter that

    $this->authorHtml(STRING ... has to be treated as
    $this->$STRING().

    We can add an attribute - something like #[DynamicCall("$this->%parameter0%(...%parameter1%)")],
    but it's a very specific case. I would most likely recommend using the full-text search.

      Write a Reply...