Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

format/imports

Namespaces and use imports. Also in lint (1) and analyse (1).

blank-line-after

Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block.

In the format-laravel and format-psr12 presets. Safe fix.

blank-line-after-namespace

There MUST be one blank line after the namespace declaration.

In the format-laravel and format-psr12 presets. Safe fix.

blank-line-between-groups

Putting blank lines between use statement groups.

In the format-laravel and format-psr12 presets. Safe fix.

blank-lines-before-namespace

Controls blank lines before a namespace declaration.

In the format-laravel and format-psr12 presets. Safe fix.

clean-namespace

Namespace must not contain spacing, comments or PHPDoc.

In the format-laravel preset. Safe fix.

fully-qualified-strict-types

Removes the leading part of fully qualified symbol references if a given symbol is imported or belongs to the current namespace.

In the format-laravel preset. Safe fix.

global-namespace

Imports or fully qualifies global classes/functions/constants.

Not in any preset. Safe fix.

group

There MUST be group use for the same namespaces.

Not in any preset. Safe fix.

no-leading-namespace-whitespace

The namespace declaration line shouldn’t contain leading whitespace.

In the format-laravel preset. Safe fix.

no-leading-slash

Remove leading slashes in use clauses.

In the format-laravel and format-psr12 presets. Safe fix.

no-unneeded-alias

Imports should not be aliased as the same name.

In the format-laravel preset. Safe fix.

ordered

Ordering use statements.

In the format-laravel and format-psr12 presets. Safe fix.

single-per-statement

There MUST be one use keyword per declaration.

In the format-laravel and format-psr12 presets. Safe fix.

Last updated on

Was this page helpful?