V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zhangwei1996
V2EX  ›  问与答

PHPstorm 9.0.2 在哪设置 HereDoc 的格式?

  •  
  •   zhangwei1996 · 2015-11-09 14:03:14 +08:00 · 1220 次点击
    这是一个创建于 3109 天前的主题,其中的信息可能已经有所发展或是发生改变。

    格式化的时候想这样:

    $heredoc = <<< HEREDOC_ID
    some $contents
    HEREDOC_ID;
    

    但是现在格式化以后是这样:

    $heredoc 
         = <<< HEREDOC_ID
    some $contents
    HEREDOC_ID;
    

    请问在哪里设置呢? Editor->Code&style->PHP 找了很久都没有找到呢!

    5 条回复    2015-11-09 16:26:44 +08:00
    zhangwei1996
        1
    zhangwei1996  
    OP
       2015-11-09 14:06:19 +08:00
    where setting "heredoc format style" in phpstorm 9.0.2

    I hope like this :

    ```
    $heredoc = <<< HEREDOC_ID
    some $contents
    HEREDOC_ID;
    ```


    but now , After formatting like this :

    ```
    $heredoc
    = <<< HEREDOC_ID
    some $contents
    HEREDOC_ID;
    ```


    Where can I set it? `Editor->Code&style->PHP` for a long time did not find
    zhangwei1996
        2
    zhangwei1996  
    OP
       2015-11-09 14:07:24 +08:00
    linauror
        3
    linauror  
       2015-11-09 16:11:44 +08:00
    File-Settings
    搜索框直接输入 heredoc 回车
    Colors & Fonts - PHP
    点进去就是
    zhangwei1996
        4
    zhangwei1996  
    OP
       2015-11-09 16:20:19 +08:00
    @linauror 搜,只有 color 设置
    cxbig
        5
    cxbig  
       2015-11-09 16:26:44 +08:00
    HereDoc 从第二行开始必须顶格写。 reformat 是对的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1057 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 20:03 · PVG 04:03 · LAX 13:03 · JFK 16:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.