Skip to content

PSR12.Files.ImportStatement.LeadingSlash sometimes have to insert a space to avoid broken code #2961

Description

@umherirrender

If you have the following code:

use\Import\SomeClass;
use const\Import\SomeConst;
use function\Import\SomeFunction;

PSR12.Files.ImportStatement.LeadingSlash would remove the slash and the new code is broken. In this case the sniff have to insert a space instead to keep the php file valid.

The class import may not broken when also have PSR2.Namespaces.UseDeclaration.SpaceAfterUse in use, but the const and function gets broken (see #2960 for an improvment of that sniff)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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