Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Is this 2 statements or 1?
if ($a == "A" && $b == "B") { // do something }
How do I use two statements if I want to follow PSR standards? Should I use multiple if's? Like if inside an if?
它应该看起来像这样:
if ($a == "A" && $b == "B") { }
您不需要创建多个 if
如果你有更长的条件,你可以使用这样的语法:
<?php if ($a == "A" && $b == "B" ) { }
当代码样式设置为 PSR 时,它们都在 PhpStorm 中进行了测试