use <code>elseif</code> instead and use after <code>} </code>, see psr-2 coding style guide : https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md#51-if-elseif-else