Skip to content

Files

Latest commit

 

History

History
16 lines (9 loc) · 789 Bytes

SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition.md

File metadata and controls

16 lines (9 loc) · 789 Bytes

Pattern: Missing use of single-line condition

Issue: -

Description

Enforces conditions of if, elseif, while and do-while to be on a single line.

Rule provides the following settings:

  • maxLineLength: specifies max allowed line length. If condition (and the rest of the line) would fit on it, it's enforced. Use 0 value to enforce for all conditions, regardless of length.
  • alwaysForSimpleConditions: allows to enforce single line for all simple conditions (i.e no &&, || or xor), regardless of length.

Further Reading