Skip to content

Latest commit

 

History

History
64 lines (43 loc) · 1.25 KB

at-else-if-parentheses-space-before.md

File metadata and controls

64 lines (43 loc) · 1.25 KB

Pattern: Malformed space before @else if parentheses

Issue: -

Description

Require or disallow a space before @else if parentheses.

@else if ($condition) { }
/**      ↑
 * The space before this parenthesis */

Examples

string: "always"|"never"

"always"

There must always be exactly one space between the @else if and the condition opening parenthesis.

Note: This rule does not enforce parentheses to be present.

The following patterns are considered warnings:

@else if($condition) { }
@else if  ($condition) { }

The following patterns are not considered warnings:

@else if ($condition) { }
@else if $condition { }

"never"

There must never be whitespace between the @else if and the condition opening parenthesis.

The following patterns are considered warnings:

@else if ($condition) { }

The following patterns are not considered warnings:

@else if($condition) { }
@else if $condition { }

Further Reading