Skip to content

Add Elvis/null coalescing operator rule #101

@CosmeValera

Description

@CosmeValera

This issue is a mention to this comment in the accepted PR of @JesusValera . I will quote:

I was thinking, maybe it makes sense to also add this rule for the Elvis/null coalescing operators?

// Not this
$foo = 'foo' ??
    'bar';

$foo = 'foo' ?:
    'bar';

// But this
$foo = 'foo'
    ?? 'bar';

$foo = 'foo'
    ?: 'bar';

I could add the modifications in this (or another PR), let me know what you think and if you have another suggestion 😄

Originally posted by @JesusValera in #93 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions