Skip to content

Undefined array index when a function is after a class #147

@villfa

Description

@villfa

Given Foo.php:

<?php

class Foo
{

}

function Foo
{

}

When I run the command vendor/bin/phpcs --standard=codor.xml Foo.php -spn, I got the following error:

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | An error occurred during processing; checking has been aborted. The error message was: Undefined array key 24 in /my-project/vendor/bmitch/codor/src/Codor/Sniffs/Syntax/LinesAfterMethodSniff.php on line 37
   |       | (Internal.Exception)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions