PhpStorm 2021.3.2 设置
我是 PhpStorm 的新手。之前我使用过 Visual Studio Code 和 Sublime Text 3/4,但是使用 PhpStorm,使用 PHP 更加方便,而且我对这个 IDE 很满意。
我根据我的需要和我正在使用的框架的约定定制了代码的样式。当清理和/或重新格式化代码时就会出现问题:发生这种情况时,受保护的方法和公共方法会混淆。我会尽力解释它。
例如:如果我有一个名为 getPath
的受保护方法,该方法在类开头的一个或多个公共方法中调用,按照惯例,该方法应与私有方法一起位于类的末尾。方法,但如果我设置另一个不使用 getPath 方法的公共方法,则 getPath 会放置在新公共方法的顶部。我知道!这似乎不是问题,但是当您遵循框架或个人约定的严格约定规则时,这最终变得非常重要。
就我而言,我的代码非常干净整洁,但我无法配置 IDE 以在类末尾保持方法私有和受保护。
我想知道是否有人可以帮助我配置 IDE 来解决问题,如果可能的话我想要一些神奇的方法 (__call
, __callStatic
, __sleep< /code>,
__get
) 保留在所有内容的末尾。
我使用的是 PhpStorm 2021.3.2。
I am new using PhpStorm. Previously I used Visual Studio Code and Sublime Text 3/4, however with PhpStorm it is much more convenient to work with PHP and I am happy with the IDE.
I have customized the style of the code according to my needs and the convention of the Framework I am working with. The problem arises when doing a cleanup and/or reformatting of the code: when this happens, the protected and public methods get mixed up. I will try to explain it as best as possible.
For example: if I have a protected method named getPath
that is called in one or more public methods at the beginning of the class, by convention this method should be at the end of the class along with the private methods, but then if I set another public method that does not use the getPath
method, getPath
is placed on top of the new public method. I KNOW! It doesn't seem to be a problem, but when you follow strict convention rules of a framework or a personal convention, this ends up being very important.
In my case, I'm extremely clean and tidy in my code, but I haven't been able to configure the IDE to keep methods private and protected at the end of the class.
I would like to know if someone can help me configure the IDE to solve the problem and if possible I would like the magic methods (__call
, __callStatic
, __sleep
, __get
) to be kept at the end of everything.
I am using PhpStorm 2021.3.2.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论