This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 169690

Summary: Surround with - for ->get and ->set methods
Product: php Reporter: danilchenko_anton <danilchenko_anton>
Component: CodeAssignee: issues@php <issues>
Status: NEW ---    
Severity: blocker CC: tmysik
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

Description danilchenko_anton 2009-08-02 14:46:40 UTC
Function "Surround with" wery usable for me.
I propose improve it: for "->get" insert "$var_name = " before; for "->set" method not insert anywhere.

Example code:
$controllerObj->setLayout();  // not show "Surround with" (see on "set" prefix)
$controllerObj->getLayout();  // show "Surround with" (see on "get" prefix) or automatically insert variable before
Comment 1 Filip Zamboj 2009-09-10 14:32:23 UTC
you probably mean assign variable hint that is already implemented already. Not remember in what release was this
introduced. Anyway, I'm sure it's in 6.8 development build, available on http://bertram.netbeans.org/hudson/job/PHP-build/, 

What about not offering "assign variable" on functions starting with set, this should be a subject of discussion. You're
right that it shouldn't be a function that returns something but well ... it still can return boolean function at least,
so you know if set is true or false. => reassigning to responsible developer. 
Comment 2 rmatous 2009-09-14 09:46:21 UTC
assign variable hint was implemented for 6.7 as a line warning (no selection needed). Just put cursor on the line like
this for example ("|" means cursor):
$controllerObj->get|Layout();

This approach I found sufficient for most of usecases and probably also faster for use, on the other hand there could be
also variant based on selection. 
Comment 3 Filip Zamboj 2010-09-15 12:29:33 UTC
batch reassigning