Closed srosato closed 9 years ago
In fact, I thought about it and your current config structure could very much help with other auto-completion use cases such as auto-completion on method names with string literals:
$dataProcessorMock = m::mock('Ez\Util\Data\Processor\DataProcessor');
$dataProcessorMock->shouldReceive('process')->once();
In this situation we would get auto-completion on shouldReceive('PRESS CTRL ENTER HERE');
Any update on this?
Wouldn't it be better just to stop using string literals for class names?
PHP have class name literals since PHP5.5. e.g. Ez\Util\Data\Processor\DataProcessor::class
Adding a feature that is only needed on versions of PHP that are in the end-of-support sequence seems....bad?
Oh wow. Ok I was unaware of that feature. I guess that is what happens when you are stuck on legacy systems.. I'm stuck on PHP5.3 and 5.4 on most of my projects for the production servers. I just tested with 5.5 and it really kills the need to implement such feature.
I am closing this issue, thanks for the advice and I will definitely be refactoring as soon as I am able to update.
Excellent, Thanks Dan :)
I wonder, would it be possible to use your same config structure in order to get fully qualified class names auto-completion on string literals?
Your plugin has already saved my life in order to stop type hinting when creating mocks, for example:
But I wonder if we could use the same configuration to provide autocompletion on the string literal, for example
Which would make it possible to autocomplete the fully qualified class name for mocks: