Skip to content

Formatting ternary operators #28

@mancunianez

Description

@mancunianez

As it was decided on Developers Chat (Feb 20, 2023) we need create new PHPCS rule for ternary operators.

Expected Behavior

Split long condition onto several lines, keeping the question mark and the colon at the front

$b = $condition3 && $condition4
    ? $foo_man_this_is_too_long_what_should_i_do
    : $bar;

Current Behavior

There is currently no rule for formatting.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions