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 270114

Summary: Order of getters and setters
Product: php Reporter: lolka_bolka
Component: EditorAssignee: issues@php <issues>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description lolka_bolka 2017-03-18 11:35:33 UTC
This is a feature request, did not found where should I post it.

Generating getters and setters are great feature. I'd like an option, checkbox, where I can set the following when I want to insert getters and setters too: Join (clamp, whatever) functions.

I mean, first the getter, and then the setter, for next field the getter and then the setter, etc..

For example:

private $myField;

private $otherField;

when generating getter and setter and this option checked:

public function getMyField() {...}

public function setMyField($myField) {...}

public function getOtherField() {...}

public function setOtherField($otherField) {...}
Comment 1 Stawi 2017-03-20 00:51:18 UTC
I think in "Generate getters and setters" window it should be new combo box named ie. "order of methods" with three options:
- getter/setter in pairs
- first getters, then setters
- first setters, then getters

Now it works in second way, but many people, including me, prefer first option..
Comment 2 Dusan Balek 2017-09-15 14:16:08 UTC
There is the option 'Keep Getters And Setters Together' in Java. Reassigning to PHP.