Skip to content

Problems with grouping use declarations (PHP7) #919

Closed
@glen-84

Description

@glen-84

With code like this:

<?php

declare(strict_types = 1);

namespace ExpressiveExtensions;

use Psr\Http\Message\{ResponseInterface, ServerRequestInterface};
use Zend\Diactoros\Response\{HtmlResponse, JsonResponse, TextResponse};

I get:

 1 | ERROR | [ ] A file should declare new symbols (classes, functions,
   |       |     constants, etc.) and cause no other side effects, or it
   |       |     should execute logic with side effects, but should not do
   |       |     both. The first symbol is defined on line 11 and the first
   |       |     side effect is on line 7.
   |       |     (PSR1.Files.SideEffects.FoundWithSymbols)
 7 | ERROR | [x] There must be one USE keyword per declaration
   |       |     (PSR2.Namespaces.UseDeclaration.MultipleDeclarations)
 7 | ERROR | [x] Closing brace must be on a line by itself
   |       |     (Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore)
 8 | ERROR | [x] There must be one USE keyword per declaration
   |       |     (PSR2.Namespaces.UseDeclaration.MultipleDeclarations)
 8 | ERROR | [x] Closing brace must be on a line by itself
   |       |     (Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions