PHPackages                             dragon-code/codestyler - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. dragon-code/codestyler

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

dragon-code/codestyler
======================

A tool to automatically fix Coding Style Standards issues by The Dragon Code.

6.7.1(2mo ago)291.8M—3.2%10MITPHPPHP ^8.2CI passing

Since Feb 10Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/TheDragonCode/codestyler)[ Packagist](https://packagist.org/packages/dragon-code/codestyler)[ Fund](https://boosty.to/dragon-code)[ Fund](https://yoomoney.ru/to/410012608840929)[ RSS](/packages/dragon-code-codestyler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (172)Used By (10)

The Dragon Code Styler
======================

[](#the-dragon-code-styler)

  ![Codestyler](https://camo.githubusercontent.com/1c82b26f9b888675fe4dc5f0fa37f81091f37b41c0da9453b4dd94b3b9ab6b3a/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f436f64657374796c65722e706e673f7061747465726e3d746f706f677261706879267374796c653d7374796c655f3226666f6e7453697a653d3130307078266d643d312673686f7757617465726d61726b3d31267468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f7365722b72657175697265267061636b6167654e616d653d647261676f6e2d636f6465253246636f64657374796c6572266465736372697074696f6e3d412b746f6f6c2b746f2b6175746f6d61746963616c6c792b6669782b436f64696e672b5374796c652b5374616e64617264732b6973737565732b62792b5468652b447261676f6e2b436f64652e26696d616765733d68747470732533412532462532466c61726176656c2e636f6d253246696d672532466c6f676f6d61726b2e6d696e2e737667)[![Stable Version](https://camo.githubusercontent.com/e20c961ba3c8010fed9e75431957ed83e69fbb4f4c3bdefe18808da524fd0d4a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f546865447261676f6e436f64652f636f64657374796c65723f6c6162656c3d737461626c65267374796c653d666c61742d737175617265)](https://github.com/TheDragonCode/codestyler)[![Total Downloads](https://camo.githubusercontent.com/1c72a1d2926380de23a021329ec1d28e7e9e1583d8299da5344cf4710c0c48c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f647261676f6e2d636f64652f636f64657374796c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dragon-code/codestyler)[![License](https://camo.githubusercontent.com/422db9fd40f5831c765cf6530b6750c081b696bd18d904cf89554df98c676277/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)](LICENSE)

Note

`Codestyler 5` is the last version that runs on its own code and includes a mechanism for publishing files via command parameters. It is also the last version installed globally via Composer.

Starting with `Codestyler 6`, the project will contain `pint.json` and `.editorconfig` files, and adding them to the project will be done by calling a console command.

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

[](#installation)

You can install the package using [Composer](https://getcomposer.org):

```
composer require dragon-code/codestyler --dev

composer config scripts.style "vendor/bin/rector && vendor/bin/pint --parallel"
```

It is also possible to establish dependence in the global area of visibility:

```
composer global require dragon-code/codestyler
```

After installing the dependency, add a file copy command to the `scripts.post-update-cmd` section. This will automatically copy the `pint.json` file to the project root.

When adding the command, replace `8.5` with the minimum PHP version your application works with. Available presets: `8.2`, `8.3`, `8.4` and `8.5.

You can also add copying the `.editorconfig` file to help the IDE and calling normalize the `composer.json` file and `biome.json` file for [Biome Linter](https://biomejs.dev):

```
{
    "scripts": {
        "post-update-cmd": [
            "vendor/bin/codestyle pint 8.5",
            "vendor/bin/codestyle rector laravel",
            "vendor/bin/codestyle editorconfig",
            "vendor/bin/codestyle npm",
            "composer normalize"
        ]
    }
}
```

When using a globally established dependence, the call must be replaced with the following:

```
{
    "scripts": {
        "post-update-cmd": [
            "codestyle pint 8.5",
            "codestyle rector laravel",
            "codestyle editorconfig",
            "codestyle npm",
            "composer normalize"
        ]
    }
}
```

### For JS, CSS, JSON

[](#for-js-css-json)

If it is necessary to correct the code style for JS, CSS and JSON, you need to separately set the dependence through the NPM package manager (or any other):

```
npm i -D @biomejs/biome
```

After that, write the commands in the `package.json` file:

```
{
    "scripts": {
        "lint": "npx @biomejs/biome lint --write",
        "format": "npx @biomejs/biome format --write",
        "style": "npm run lint && npm run format"
    }
}
```

Usage
-----

[](#usage)

### PHP Linter

[](#php-linter)

[`Laravel Pint`](https://laravel.com/docs/pint) is used as the linter for PHP.

The linter is invoked by a console command:

```
composer style
```

### Rector

[](#rector)

[`Rector`](https://getrector.com) is uses as the code rector for PHP.

The Rector is invoked by a console command:

```
composer style
```

To do this, make sure the file is in the root of the project. You can also automate this process by adding a call to the file copy function in the `scripts.post-update-cmd`section of the `composer.json` file.

```
{
    "scripts": {
        "post-update-cmd": [
            "vendor/bin/codestyle rector laravel"
        ]
    }
}
```

Available presets:

- `laravel`
- `default`

### Node Linter

[](#node-linter)

[Biome](https://biomejs.dev) is used as the linter for JS, CSS and JSON.

Make sure the `biome.json` file is in the root of the project. You can also automate this process by adding a call to the file copy function in the `scripts.post-update-cmd`section of the `composer.json` file:

```
{
    "scripts": {
        "post-update-cmd": [
            "vendor/bin/codestyle npm"
        ]
    }
}
```

### EditorConfig

[](#editorconfig)

The `.editorconfig` file helps your IDE to work according to certain rules.

To do this, make sure the file is in the root of the project. You can also automate this process by adding a call to the file copy function in the `scripts.post-update-cmd`section of the `composer.json` file.

```
{
    "scripts": {
        "post-update-cmd": [
            "vendor/bin/codestyle editorconfig"
        ]
    }
}
```

### Composer Normalize

[](#composer-normalize)

We recommend using the [Composer Normalize](https://github.com/ergebnis/composer-normalize) plugin, which normalizes the `composer.json` file appearance to match its schema. This will keep each project's file consistent, making it much easier to read.

To activate the plugin, call the console command:

```
composer config allow-plugins.ergebnis/composer-normalize true
```

To use this feature, add a call parameter to the `post-update-cmd` block of the `composer.json` file:

```
{
    "scripts": {
        "post-update-cmd": [
            "composer normalize"
        ]
    }
}
```

Now you can just a run console command:

```
composer update
```

### Finalized `composer.json`

[](#finalized-composerjson)

After completing all the steps, the `composer.json` file will have the following changes:

```
{
    "require-dev": {
        "dragon-code/codestyler": "^6.0"
    },
    "config": {
        "allow-plugins": {
            "ergebnis/composer-normalize": true
        }
    },
    "scripts": {
        "post-update-cmd": [
            "vendor/bin/codestyle pint 8.5",
            "vendor/bin/codestyle rector laravel",
            "vendor/bin/codestyle editorconfig",
            "vendor/bin/codestyle npm",
            "composer normalize"
        ],
        "style": [
            "vendor/bin/rector",
            "vendor/bin/pint --parallel"
        ]
    }
}
```

### Finalized `package.json`

[](#finalized-packagejson)

After completing all the steps, the `package.json` file will have the following changes:

```
{
    "scripts": {
        "lint": "npx @biomejs/biome lint --write",
        "format": "npx @biomejs/biome format --write",
        "style": "npm run lint && npm run format"
    },
    "devDependencies": {
        "@biomejs/biome": "^2.2.2"
    }
}
```

### GitHub Actions

[](#github-actions)

To use the Linter with GitHub Actions, just create a file `.github/workflows/code-style.yml` and insert this content into it:

```
name: Code Style

on:
    push:
    pull_request:

permissions: write-all

jobs:
    Checks:
        uses: TheDragonCode/.github/.github/workflows/code-style.yml@main
        with:
            php: true
            node: true
```

Defaults:

- php: true
- node: true

### IDE

[](#ide)

After executing the `composer update` console command, a `.editorconfig` file will be added to your application. If the file already exists, it will be replaced.

In order for your IDE to read the code style settings from it, make sure its support is enabled in the settings.

For example, in `phpStorm` the setting is in the File | Settings | Editor | Code Style:

[![image](https://private-user-images.githubusercontent.com/10347617/244794995-0a0ac61e-f297-41c9-b034-4ae52ea96da6.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNzk2OTMsIm5iZiI6MTc3NTI3OTM5MywicGF0aCI6Ii8xMDM0NzYxNy8yNDQ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GRiOGU1YmQzOGEzZTg1NWEyNWNkNTg2Yzk3NTcyOTNkYTdkZWNkOTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wKQkuMF0JNdg_VDZYFSHQhoz-1M98NNGc018IocKtg0)

License
-------

[](#license)

This package is licensed under the [MIT License](LICENSE).

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance88

Actively maintained with recent releases

Popularity48

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 80.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Recently: every ~16 days

Total

168

Last Release

60d ago

Major Versions

1.x-dev → v2.0.02022-04-20

2.x-dev → v3.0.02023-06-02

3.x-dev → 4.0.12024-02-10

4.3.1 → 5.0.02024-11-26

5.x-dev → 6.0.02025-07-11

PHP version history (4 changes)v1.6.0PHP ^8.0

v1.11.0PHP ^7.4 || ^8.0

v3.0.0PHP ^8.1

5.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/b77790e612f1c9beed1e1533e36eba4954fbd6da2a5c9f71e845cd0f5465f0ad?d=identicon)[Helldar](/maintainers/Helldar)

---

Top Contributors

[![andrey-helldar](https://avatars.githubusercontent.com/u/10347617?v=4)](https://github.com/andrey-helldar "andrey-helldar (715 commits)")[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (131 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (38 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

---

Tags

lintlinterphpphplintsyntaxsyntax-checkerphpjsonformatterCode stylestyleyamlformatstandardlinterlintCodestylephp-cs

### Embed Badge

![Health badge](/badges/dragon-code-codestyler/health.svg)

```
[![Health](https://phpackages.com/badges/dragon-code-codestyler/health.svg)](https://phpackages.com/packages/dragon-code-codestyler)
```

###  Alternatives

[laravel/pint

An opinionated code formatter for PHP.

3.1k147.7M13.2k](/packages/laravel-pint)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[phppkg/config

Config manage, load, get. Supports INI,JSON,YAML,NEON,PHP format file

133.5k](/packages/phppkg-config)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
