Scopes in which plugins can be used.
So reading the docs on plugins it says "Limitations: You cannot use plug-ins for: Non-public methods". However in my testing I was able to create a Plugin for a protected method without an issue, should this read private methods?
@bluk Can you answer? Thanks
@JamesAnelay Can you share what protected method you wrote the plugin for? On the latest code, I don't think you can use plugins around protected methods. I tried it out with a couple around/after just to see as well and the Interceptor didn't generate the intercepting method, so I'm not sure how it worked for you.
Personally, I would strongly discourage writing a plugin around a protected method and would instead try to find a suitable public method. From a pure internals safety and stability standpoint, plugins are more suitable for public methods.
Ok, I now see what was going wrong, so this was on my own code and as I was developing and testing a plugin on.
I thought "Does this need to be public to use a plugin on", changed it to protected and it still worked and there was the reason why because the Interceptor class had already been generated so changing the scope had no effect.
Thanks for clearing that up for me @bluk!