pbyrne84 / DynamicReturnTypePlugin

135 stars 7 forks source link

How can I manually specify expected arguments? #55

Open amcsi opened 8 years ago

amcsi commented 8 years ago

I want $this->getServiceLocator()->get('doctrine.documentmanager.odm_default') to return \Doctrine\Common\Persistence\ObjectManager. Currently there seems to be no way to do this.

If there was some kind of filtering property in JSON, I could just go for a static \Doctrine\Common\Persistence\ObjectManager as the mask

pbyrne84 commented 8 years ago

You should in theory be able to use javascript to do the mappings as exampled in https://github.com/pbyrne84/DynamicReturnTypePlugin/issues/56

And under the https://github.com/pbyrne84/DynamicReturnTypePlugin (2.Script engine calls)

I cleaned up some stuff in 56 that may be useful.

Trying to fit everything into the json started to get complicated.

amcsi commented 8 years ago

I would prefer the simplicity of JSON files when possible. Could you possibly add just a regex matching property to restrict an entry to only be executed if the regex matches? Although that should allow multiple definitions per class.