Skip to content

[Bug] MethodAnnotationStructureSniff causes error when there is no doc comments in the file #38

Closed
@lenaorobei

Description

@lenaorobei

Steps to reproduce

Run phpcs against following code:

<?php

class ClassWithNoAnnotation
{
    protected function methodWithNoAnnotation(){
        //code here
    }
}

Expected result

Warning about missing annotation is displayed.

Actual result

ERROR | An error occurred during processing; checking has been aborted. The error message was: Undefined index: comment_closer in magento-coding-standard/Magento/Sniffs/Annotation/MethodAnnotationStructureSniff.php on line 48 (Internal.Exception)

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedNew rule is acceptedbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions