Type: New Feature
Affects Version/s: 11.1
Fix Version/s: None
Component/s: php - Editor
I would like to propose an improvement for PHP editor. When one needs to have class method that set object properties, such as setter methods or constructors for dependency injection, method parameter names are often same as the object properties, so copy and pasting of the parameters names often occurs. However the variable names are being selected including the dollar sign prefix $ and after pasting it needs to be removed. If there are many parameters to set, this may become very routine work.
The idea is that when the paste containing a variable name occurs right after $this-> (or perhaps rather after object instance operator ->), then it will be pasted without the $ sign. I believe this would greatly improve the workflow.
So in order to achieve property assignment, one would need to type
$this->, ctrl+v, =, ctrl+v
instead of, for example:
$this->, ctrl+v, ctrl+back-arrow (multiple times), backspace, end, =, ctrl+v
Of course, there could be variable variables, but I believe these haven't been considered a good practice for a long time and in any case, are much much more rare than the use case above.
Do you see any possible drawbacks to this?
There could also be a suggestion to generate the assignment for even less keystrokes, but I figure it would be far more complex solution than this.