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 255731 - New hint: Move string into constant
Summary: New hint: Move string into constant
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P4 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-06 12:22 UTC by fiala.premysl
Modified: 2015-10-06 12:22 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fiala.premysl 2015-10-06 12:22:18 UTC
Add option in alt+enter (hint menu) for move string as class constant.

Scenario:
1)
class A
{
... 
  /** @var SimpleXMLElement */
  $xml->addChild('xmltag'); // alt+enter here
...
} 

2)
class A
{
const TAG_A = 'xmltag';
....
}


The main usecase for this feature is:
While coding the programmer can use some non-defined strings. So he needs to create them or come back and create them later. With this feature he/she can create new constants on the fly.

(I do expect some simple dialog for constant name)
Bonus behaviour:
- create constant in parent class
- create constant in class, from which the programmer is already using contants