Skip to content

BUG: UnnecessaryNamespaceUsageSniff failing with php-error if no "use" and "namespace" is present #78

@SebTM

Description

@SebTM

Example file:

<?php

class Shopware_Controllers_Api_Motif extends Shopware_Controllers_Api_Rest
{
    /**
     * @return void
     */
    public function indexAction(): void
    {
        $this->View()->assign([
            'success' => true,
            'data'    => $this->get('xxx_service')->getList(),
        ]);
    }
}

Result:

1 | ERROR | An error occurred during processing; checking has been aborted. The error message was: strpos(): Empty needle in
| | mayflower/mo4-coding-standard/MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php on line 367

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions