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: | php autoformat "echo <<<EOT " should not indent | ||
---|---|---|---|
Product: | php | Reporter: | roger_roger <roger_roger> |
Component: | Formatting & Indentation | Assignee: | Tomasz Slota <tslota> |
Status: | REOPENED --- | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
roger_roger
2009-06-29 12:04:08 UTC
The heredoc and nowdoc (PHP 5.3) shouldn't be formatted by php code. The biggest problem as is mentioned that the end of heredoc or nowdoc doesn't have to be recognized and all file then is thread as a string. Example of nowdoc: <?php $str = <<<'EOD' Example of string spanning multiple lines using nowdoc syntax. EOD; /* More complex example, with variables. */ class foo { public $foo; public $bar; function foo() { $this->foo = 'Foo'; $this->bar = array('Bar1', 'Bar2', 'Bar3'); } } $foo = new foo(); $name = 'MyName'; echo <<<'EOT' My name is "$name". I am printing some $foo->foo. Now, I am printing some {$foo->bar[1]}. This should not print a capital 'A': \x41 EOT; ?> fixed & unit tested: http://hg.netbeans.org/web-main/rev/4c1e01e54386 verified Product Version: NetBeans IDE Dev (Build 091119-840bbe3ddcb3) Java: 1.5.0_17-ea; Java HotSpot(TM) 64-Bit Server VM 1.5.0_17-ea-b01 When selecting text containing a complete HEREDOC block and pressing TAB or Shift + TAB, the HEREDOC block (the content) shouldn't be indented because it will break the code. When selecting only the HEREDOC content (without the start and end tags), it's ok to indent the content. Tested in v8.1 |