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.
The PSR-1 Basic Coding Standard (https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-1-basic.md) says the following with regard to method naming: "4.3. Methods Method names MUST be declared in camelCase()." However, it also says the following: "4.2. Properties This guide intentionally avoids any recommendation regarding the use of $StudlyCaps, $camelCase, or $under_score property names." More specifically, what I'm trying to ask for is this: Given the flexibility of property naming conventions, could the Generate Getters and Setters function have an option to generate the following getter and setter from a property called $my_property: public function getMyProperty() {...} public function setMyProperty($value) {...} Obviously this could be avoided if one were to name class properties with camelCase formatting, but PSR-1 allows for the use of underscores in property names, and there can be good stylistic reasons for doing so. However, that renders the Generate Getters and Setters function in Netbeans less valuable, because you then have to go through and change functions from getMy_property and setMy_property to getMyProperty and setMyProperty, respectively. Alternately, the ability to customize the templates that Generate Getters and Setters functions use would be useful, as it's kind of a drag to go through and add "return $this;" to every generated setter.
Created attachment 131475 [details] The Generate Getters and Setters dialog actually says "Remove underscore: ..." but it doesn't remove the score. The Generate Getters and Setters dialog actually says "Remove underscore: ..." but it doesn't remove the score.
Tested on Netbeans 7.3 stable Method naming style: Remove Underscore Result: underscores where not removed ex.: public function getStarted_at() Expected result: public function getStartedAt()
Please, don't change version. It's the first version, when an issue occured.
"Remove Underscore" works fust for leading underscore (many years ago someone used it for "private/protected" fields...). To don't generate get_foo(); from $_foo; It never worked for underscored inside a field name. So it's definitely an enhancement. But I understand you and I'll try to rewrite it to remove all underscores. Thanks.
I need this new enhancement, always i use underscore into my vars . Thanks.
I'm using Netbeans 8.2 fully updated and just right now I'm manually modifying every generated getter/setter, removing extra underscores :(