Reputation: 65
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?
Upvotes: 2
Views: 581
Reputation: 111829
It simply should look like this:
if ($a == "A" && $b == "B") {
}
You don't need to create multiple ifs
If you have longer conditions you could use such syntax:
<?php
if ($a == "A"
&& $b == "B"
) {
}
Both of them were tested in PhpStorm when code style is set to PSR
Upvotes: 1