1.2.721. Multiline Expressions

List of expressions that are spread across several lines. The default is 2.

Structures that commonly accept several lines, like match(), switch(), classes, functions, closures, constant definitions, etc. are omitted.

Multiline expressions, like complex expressions, tend to be less readable. Although, some multiline expressions are written to make them more readable, compared to a one-line complex expression.

<?php

// foo is not reported for the multiline expression
function foo() {
     // this echo is reported
     echo $a .
              $b .
              $c;
}


?>

Name

Default

Type

Description

min

2

integer

Minimal number of lines in an expression to report.

1.2.721.1. Suggestions

  • Reduce the size of the expression by moving it to a method

  • Reduce the size of the expression by splitting it into several ones

1.2.721.2. Specs

Short name

Structures/MultilineExpressions

Rulesets

All, Changed Behavior, Suggestions

Exakat since

2.6.1

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

High

Related rule

Too Complex Expression

Available in

Entreprise Edition, Exakat Cloud