PHPackages                             kep/cs-fixer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kep/cs-fixer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kep/cs-fixer
============

Customized php cs fixer

02PHP

Since Dec 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/KefirchickTod/customized-cs-fixer)[ Packagist](https://packagist.org/packages/kep/cs-fixer)[ RSS](/packages/kep-cs-fixer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

OrderedImportsGroupFixer (Modified Version)
===========================================

[](#orderedimportsgroupfixer-modified-version)

This fixer is a modified version of `OrderedImportsGroupFixer` for PHP CS Fixer. It not only orders imports according to specified rules but also allows you to insert blank lines between import groups and set namespace priorities.

Features
--------

[](#features)

- **Sorting imports** by:

    - Alphabetical order (`alpha`)
    - Length (`length`)
    - None (`none`)
    - With predefined namespace priorities (`namespace_priority`)
- **Grouping imports** by type:

    - Classes (`class`)
    - Constants (`const`)
    - Functions (`function`)
- **Inserting blank lines between import groups**:

    - Groups are determined by the first segment of the namespace. For example, imports from `Doctrine\...` form the "Doctrine" group, while `Monolog\...` form the "Monolog" group, and a blank line will be inserted between these groups.

Requirements
------------

[](#requirements)

- PHP CS Fixer
- PHP 8.3 or higher

Installation
------------

[](#installation)

1. Add the modified `OrderedImportsGroupFixer` class to your project (e.g., in the `CustomFixer` directory):

```
   mkdir -p src/CustomFixer
```

**copy OrderedImportsGroupFixer.php to src/CustomFixer/ (or another dir)**(do not forget to configure yor composer autoload if you need it)

##### OR

[](#or)

2. run, with dev-master (WIP)

```
   composer require --dev kep/cs-fixer
```

Examples
--------

[](#examples)

**Config file**

```
