======================== Rule ``ordered_imports`` ======================== Ordering ``use`` statements. Configuration ------------- ``sort_algorithm`` ~~~~~~~~~~~~~~~~~~ Whether the statements should be sorted alphabetically or by length, or not sorted. Allowed values: ``'alpha'``, ``'length'`` and ``'none'`` Default value: ``'alpha'`` ``imports_order`` ~~~~~~~~~~~~~~~~~ Defines the order of import types. Allowed types: ``array`` and ``null`` Default value: ``null`` ``case_sensitive`` ~~~~~~~~~~~~~~~~~~ Whether the sorting should be case sensitive. Allowed types: ``bool`` Default value: ``false`` Examples -------- Example #1 ~~~~~~~~~~ *Default* configuration. .. code-block:: diff --- Original +++ New true]``. .. code-block:: diff --- Original +++ New 'length']``. .. code-block:: diff --- Original +++ New 'length', 'imports_order' => ['const', 'class', 'function']]``. .. code-block:: diff --- Original +++ New 'alpha', 'imports_order' => ['const', 'class', 'function']]``. .. code-block:: diff --- Original +++ New 'none', 'imports_order' => ['const', 'class', 'function']]``. .. code-block:: diff --- Original +++ New `_ with config: ``['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'none']`` - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_ with config: ``['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'none']`` - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_ with config: ``['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'none']`` - `@PSR12 <./../../ruleSets/PSR12.rst>`_ with config: ``['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'none']`` - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ with config: ``['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha']`` - `@Symfony <./../../ruleSets/Symfony.rst>`_ with config: ``['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha']``