Skip to content

Guzzle calls function in specific namespace, call not rewritten #88

@coenjacobs

Description

@coenjacobs

As reported by @Spreeuw in #76 comments:

Guzzle still doesn't work though, throwing: Uncaught Error: Call to undefined function MyNamespace\GuzzleHttp\Psr7\stream_for()

I have a feeling that this stream_for() function is a function in the \GuzzleHttp\Psr7 namespace originally and is then called from that same namespace without using the full FQN of the function, since it's in the same namespace. Currently, Mozart does not replace these function calls, since it is unable to distinguish a global function with a function from a namespace that is then prefixed.

What is odd though, is that the original namespace of the file calling the stream_for() function isn't transformed into your prefixed namespace (which would resolve the function being undefined, since they are in the same namespace).

@Spreeuw Can you elaborate on the error message, from where this is being called and from what package this originates? I have a feeling that this is coming from excluding a package (and thus not being processed) that is then calling a namespaced function inside a package that is actually processed by Mozart and thus have an FQN mismatch.

Could you also share your full (redact sensitive parts) composer.json file so we can experiment with it and hopefully bring this issue to a proper solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions