我想弄清楚我是否遗漏(或误用)了配置设置。
在这段代码上使用自动格式:
<?php
class foo {
public function test() {
$x = $this->foobar(
1,
2
);
}
}
产生:
<?php
class foo {
public function test() {
$x = $this->foobar(
1,
2
);
}
}
我希望 netbeans 停止这样做,因为除此之外,自动格式化工作得很好。
只有在函数调用行上有赋值时才会发生。
最佳答案
您将获得 2 个连续缩进,一个用于赋值,一个用于参数列表。
如果在赋值和 $this->foobar
之间插入一个中断,它会变得更加明显:
class foo {
public function test() {
$x =
$this->foobar(
1,
2
);
}
}
所以,这就是它的“原因”。不幸的是,NB 公开了很少的用于格式化 php.ini 的控件。似乎没有办法改变这种行为。
关于php - 方法参数缩进的 Netbeans 自动格式问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5144973/