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.
Summary: | Fix uses in current namespace results in PHP Warnings | ||
---|---|---|---|
Product: | php | Reporter: | dagguh |
Component: | Editor | Assignee: | Ondrej Brejla <obrejla> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: | IDE log |
Description
dagguh
2012-09-18 09:49:54 UTC
Created attachment 124496 [details]
IDE log
If I run that code, no warning is shown (so it probably depends on a log level, or maybe PHP version?). That leading namespace separator for fixed use statements is handled by the option - Tools->Option->Editor->Formatting->PHP->Uses->Start Use Statements with a Namespace Separator. So you can choose what to use. Maybe we can add some new option, something like "Don't Use Types from Default Namespace"...or something like that, which will not import these types, or something better and different, but it's definitely enhancement for next release. Thanks for catching that! Our PHP version is 5.3.8 It is reproducible with error_reporting(E_ALL) If I check "Start Use Statements with a Namespace Separator", all uses start with it: <? use \some\package\Listener; use \legacy_package_Request; new legacy_package_Request(); ?> For some people this is the standard, for others it isn't. People who prefer use statements without the trailing backslash (like me), should only check "Prefer Fully Qualified Names over Use of Unqualified Names". It basically achieves my second suggestion from initial comment: (In reply to comment #0) > NetBeans should (...) not > import it at all (and leave all occurences unmodified). <? use some\package\Listener; new \legacy_package_Request(); ?> Thanks! |