PHPackages                             jnbn/composer-json-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. jnbn/composer-json-fixer

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

jnbn/composer-json-fixer
========================

A tool for fixing and cleaning up `composer.json` file according to its schema and best practices.

3.0.1(5y ago)127MITPHPPHP ^7.4|^8.0

Since Jun 30Pushed 5y agoCompare

[ Source](https://github.com/jnbn/composer-json-fixer)[ Packagist](https://packagist.org/packages/jnbn/composer-json-fixer)[ RSS](/packages/jnbn-composer-json-fixer/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (14)Versions (12)Used By (0)

composer.json fixer
===================

[](#composerjson-fixer)

[![Latest Stable Version](https://camo.githubusercontent.com/e139946b14d51cdea3dad0a18fc4b41b963f6741458da421e39243ae45df9246/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6e626e2f636f6d706f7365722d6a736f6e2d66697865722e737667)](https://packagist.org/packages/jnbn/composer-json-fixer)[![PHP Version](https://camo.githubusercontent.com/fc116dfb49f4c600fa3a3d813ab790cf7eae4c643d526b3ec746c79e1f7e0958/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545372e312d3838393242462e737667)](https://php.net)[![License](https://camo.githubusercontent.com/062ac842c204bd8588a87a44f90c63927bb335f19766482cdc88f21dc2c38f70/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6e626e2f636f6d706f7365722d6a736f6e2d66697865722e737667)](https://packagist.org/packages/jnbn/composer-json-fixer)[![Build Status](https://camo.githubusercontent.com/34539f7858d8d7253b52eabc9b8ec4af69af6605922099016dba99eb73a54136/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6a6e626e2f636f6d706f7365722d6a736f6e2d66697865722f6d61737465722e737667)](https://travis-ci.org/jnbn/composer-json-fixer)[![Code coverage](https://camo.githubusercontent.com/0e12cb46d9ea2a7d62d6e2811b9e1679105c83c474c68826607af383a2dc9f81/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f6a6e626e2f636f6d706f7365722d6a736f6e2d66697865722f6d61737465722e737667)](https://coveralls.io/github/jnbn/composer-json-fixer?branch=master)

A tool for fixing and cleaning up `composer.json` file according to its [schema](https://getcomposer.org/doc/04-schema.md) and best practices.

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

[](#installation)

composer.json fixer can be installed [globally](https://getcomposer.org/doc/03-cli.md#global):

```
composer global require jnbn/composer-json-fixer
```

or as a dependency (e.g. to include into CI process):

```
composer require --dev jnbn/composer-json-fixer
```

Usage
-----

[](#usage)

Run and fix:

```
vendor/bin/composer-json-fixer
```

See diff of potential fixes:

```
vendor/bin/composer-json-fixer --dry-run
```

Upgrade dependencies with `composer require`:

```
vendor/bin/composer-json-fixer --upgrade
```

Fixers
------

[](#fixers)

- **composer keys lowercase** - changes names of properties to lowercase
- **autoload** - fixes paths and sorts `autoload` and `autoload-dev`
- **config** - sorts `config` by key
- **keywords** - sorts `keywords` by value
- **license** - adds `license` if it is missing
- **minimum stability** - removes `minimum-stability` if it has default value ("stable")
- **name** - makes package name lowercase
- **repositories** - sorts `repositories`
- **require** - cleans up versions for `require` and `require-dev`
- **version** - removes `version` if it is present
- **composer keys sorting** - sorts properties according to [the documentation](https://getcomposer.org/doc/04-schema.md)

Example
-------

[](#example)

Before running `composer-json-fixer`:

```
{
    "name": "JohnDoe/FooBar",
    "version": "v1.0.0",
    "type": "library",
    "description": "A library to do something cool",
    "keywords": [
        "cool",
        "awesome stuff"
    ],
    "require-dev": {
        "phpunit/phpunit": "^5.7 | ^6.5"
    },
    "require": {
        "symfony/finder": "^2.7|^3.4|^4",
        "symfony/yaml": ">= 2.7"
    },
    "minimum-stability": "stable",
    "autoload": {
        "psr-4": {
            "FooBar": "src"
        }
    }
}
```

After:

```
{
    "name": "johndoe/foobar",
    "description": "A library to do something cool",
    "type": "library",
    "keywords": [
        "awesome stuff",
        "cool"
    ],
    "license": "proprietary",
    "require": {
        "symfony/finder": "^2.7 || ^3.4 || ^4",
        "symfony/yaml": ">=2.7"
    },
    "require-dev": {
        "phpunit/phpunit": "^5.7 || ^6.5"
    },
    "autoload": {
        "psr-4": {
            "FooBar\\": "src/"
        }
    }
}
```

Exit status
-----------

[](#exit-status)

- `0` - `composer.json` file does not require fixing,
- `1` - `composer.json` file can be, or was fixed,
- `2` - exception was thrown.

Contributing
------------

[](#contributing)

Request a feature or report a bug by creating [issue](https://github.com/jnbn/composer-json-fixer/issues).

Alternatively, fork the repo, develop your changes, regenerate `README.md`:

```
src/Readme/run > README.md
```

make sure all checks pass:

```
composer check
```

and submit a pull request.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 94.1% 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 ~125 days

Recently: every ~271 days

Total

11

Last Release

2035d ago

Major Versions

v1.3.0 → v2.0.02018-06-24

v2.1.0 → 3.0.02020-04-14

PHP version history (4 changes)v1.0.0PHP &gt;=5.6.6

v2.0.0PHP ^7.1

3.0.0PHP ^7.4

3.0.1PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/112425?v=4)[Ugur Aydogdu](/maintainers/jnbn)[@jnbn](https://github.com/jnbn)

---

Top Contributors

[![kubawerlos](https://avatars.githubusercontent.com/u/9282069?v=4)](https://github.com/kubawerlos "kubawerlos (111 commits)")[![jnbn](https://avatars.githubusercontent.com/u/112425?v=4)](https://github.com/jnbn "jnbn (7 commits)")

---

Tags

cleanercomposerfixerstandardizationcomposerfixer

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jnbn-composer-json-fixer/health.svg)

```
[![Health](https://phpackages.com/badges/jnbn-composer-json-fixer/health.svg)](https://phpackages.com/packages/jnbn-composer-json-fixer)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.1k](/packages/friendsofphp-php-cs-fixer)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k28.9M2.3k](/packages/infection-infection)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)

PHPackages © 2026

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