Skip to content

Add Fixer method to remove a line #517

@andrewnicols

Description

@andrewnicols

Is your feature request related to a problem?

When writing some sniff fixes, it's necessary to remove an entire line. Currently there is no helper for this.
This is particularly helpful when writing sniffs for phpdocs.

Describe the solution you'd like

$phpcsFile->fixer->beginChangeset();
$phpcsFile->fixer->removeLineAtPointer($stackPtr);
$phpcsFile->fixer->endChangeset();

Additional context (optional)

  • I intend to create a pull request to implement this feature.

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