PHPStorm 9在PHP中对齐分配 [英] PHPStorm 9 align assignments in PHP

查看:79
本文介绍了PHPStorm 9在PHP中对齐分配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过多次搜索,看来我没有选择在PHP中对齐变量的连续分配.我可以在数组中对齐键/值对,就是这样.

After many searches, it seems I don't have the option to align consecutive assignments of variables in PHP. I can align key/value pairs in arrays, but that's it.

似乎也有较旧的PHPStorm版本.

It also seems older PHPStorm versions have it.

PHPStorm 9中有可能吗?如果是这样,怎么办?如果不是,它真的比旧版本好得多吗?我刚开始使用它(来自Sublime).

Is that possible in PHPStorm 9 ? If so, how ? If not, is it really much better than older versions ? I just started using it (coming from Sublime).

这是未格式化代码的示例:

This is an example of non formatted code :

$sExample = 'Example !';
$sAnotherOneHere = 'Again ?';
$sAndTheLast = 'ENOUGH !';

这就是格式结果:

$sExample        = 'Example !';
$sAnotherOneHere = 'Again ?';
$sAndTheLast     = 'ENOUGH !';

推荐答案

该选项仍然存在,并且可以正常工作.

The option is still there and it works flawlessly.

在编辑器"->代码样式"->"PHP"->包装和花括号"->分配语句"下进行搜索.称为对齐连续分配".

Search for it under Editor -> Code Style -> PHP -> Wrapping and Braces -> Assignment Statement. It's called "Align consecutive assignments".

这篇关于PHPStorm 9在PHP中对齐分配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆