---
title: "format/imports"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

Namespaces and use imports. Also in [lint](/docs/rules/lint/imports) (1) and [analyse](/docs/rules/analyse/imports) (1).

**[blank-line-after](/docs/rules/format/imports/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](/docs/rules/format/imports/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](/docs/rules/format/imports/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](/docs/rules/format/imports/blank-lines-before-namespace)**

Controls blank lines before a namespace declaration.

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

**[clean-namespace](/docs/rules/format/imports/clean-namespace)**

Namespace must not contain spacing, comments or PHPDoc.

In the `format-laravel` preset. Safe fix.

**[fully-qualified-strict-types](/docs/rules/format/imports/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](/docs/rules/format/imports/global-namespace)**

Imports or fully qualifies global classes/functions/constants.

Not in any preset. Safe fix.

**[group](/docs/rules/format/imports/group)**

There MUST be group use for the same namespaces.

Not in any preset. Safe fix.

**[no-leading-namespace-whitespace](/docs/rules/format/imports/no-leading-namespace-whitespace)**

The namespace declaration line shouldn't contain leading whitespace.

In the `format-laravel` preset. Safe fix.

**[no-leading-slash](/docs/rules/format/imports/no-leading-slash)**

Remove leading slashes in `use` clauses.

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

**[no-unneeded-alias](/docs/rules/format/imports/no-unneeded-alias)**

Imports should not be aliased as the same name.

In the `format-laravel` preset. Safe fix.

**[ordered](/docs/rules/format/imports/ordered)**

Ordering `use` statements.

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

**[single-per-statement](/docs/rules/format/imports/single-per-statement)**

There MUST be one use keyword per declaration.

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