Behat/Behat — comment on commit b88dbfd36d9e63d9990a983d37033968798c48a8
File: src/Behat/Behat/Console/Input/InputDefinition.php line 38
By everzet:

@vicb nope, believe me, it's clearer with `elseif` in some cases. It's not so clear here, but just compare:

``` php
setDefault(false);

return $switch;
} elseif (parent::hasOption('[no-]'.$name)) {
$switch = parent::getOption('[no-]'.$name);
$switch->setDefault(true);

return $switch;
} else {
return parent::getOption($name);
}
```
VS
``` php
setDefault(false);

return $switch;
}

if (parent::hasOption('[no-]'.$name)) {
$switch = parent::getOption('[no-]'.$name);
$switch->setDefault(true);

return $switch;
}

return parent::getOption($name);
```

Second one is not only much cleaner, but much more correct to use. The rule is
to use `elseif` when you need to preserve execution flow. But in case, where
you have flow outputs (`throw`, `return`, `break`) they simply don't make sense.
And as any other instruction without sense, this creates readability (and maintainity) problems,
cuz every time i see `elseif` i suppose it's a flow-controll method and i can easily
surpass whole block `if ... elseif ... elseif` searching the code after it.

The point is - use language tools for the right job.