{"id":34007802,"url":"https://github.com/jnbn/composer-json-fixer","last_synced_at":"2026-04-06T02:31:12.720Z","repository":{"id":57000411,"uuid":"255647854","full_name":"jnbn/composer-json-fixer","owner":"jnbn","description":"A tool for fixing and cleaning up \"composer.json\" file according to its schema and best practices.","archived":false,"fork":false,"pushed_at":"2020-12-05T11:42:27.000Z","size":130,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-14T22:59:04.004Z","etag":null,"topics":["cleaner","composer","fixer","standardization"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jnbn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-14T15:28:31.000Z","updated_at":"2024-04-02T17:46:32.000Z","dependencies_parsed_at":"2022-08-21T13:20:43.533Z","dependency_job_id":null,"html_url":"https://github.com/jnbn/composer-json-fixer","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/jnbn/composer-json-fixer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnbn%2Fcomposer-json-fixer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnbn%2Fcomposer-json-fixer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnbn%2Fcomposer-json-fixer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnbn%2Fcomposer-json-fixer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jnbn","download_url":"https://codeload.github.com/jnbn/composer-json-fixer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnbn%2Fcomposer-json-fixer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31457486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cleaner","composer","fixer","standardization"],"created_at":"2025-12-13T11:13:27.711Z","updated_at":"2026-04-06T02:31:12.708Z","avatar_url":"https://github.com/jnbn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# composer.json fixer\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/jnbn/composer-json-fixer.svg)](https://packagist.org/packages/jnbn/composer-json-fixer)\n[![PHP Version](https://img.shields.io/badge/php-%5E7.1-8892BF.svg)](https://php.net)\n[![License](https://img.shields.io/github/license/jnbn/composer-json-fixer.svg)](https://packagist.org/packages/jnbn/composer-json-fixer)\n[![Build Status](https://img.shields.io/travis/jnbn/composer-json-fixer/master.svg)](https://travis-ci.org/jnbn/composer-json-fixer)\n[![Code coverage](https://img.shields.io/coveralls/github/jnbn/composer-json-fixer/master.svg)](https://coveralls.io/github/jnbn/composer-json-fixer?branch=master)\n\n\nA tool for fixing and cleaning up `composer.json` file\naccording to its [schema](https://getcomposer.org/doc/04-schema.md) and best practices.\n\n\n## Installation\ncomposer.json fixer can be installed [globally](https://getcomposer.org/doc/03-cli.md#global):\n```bash\ncomposer global require jnbn/composer-json-fixer\n```\nor as a dependency (e.g. to include into CI process):\n```bash\ncomposer require --dev jnbn/composer-json-fixer\n```\n\n\n## Usage\nRun and fix:\n```bash\nvendor/bin/composer-json-fixer\n```\nSee diff of potential fixes:\n```bash\nvendor/bin/composer-json-fixer --dry-run\n```\nUpgrade dependencies with `composer require`:\n```bash\nvendor/bin/composer-json-fixer --upgrade\n```\n\n\n## Fixers\n- **composer keys lowercase** - changes names of properties to lowercase\n- **autoload** - fixes paths and sorts `autoload` and `autoload-dev`\n- **config** - sorts `config` by key\n- **keywords** - sorts `keywords` by value\n- **license** - adds `license` if it is missing\n- **minimum stability** - removes `minimum-stability` if it has default value (\"stable\")\n- **name** - makes package name lowercase\n- **repositories** - sorts `repositories`\n- **require** - cleans up versions for `require` and `require-dev`\n- **version** - removes `version` if it is present\n- **composer keys sorting** - sorts properties according to [the documentation](https://getcomposer.org/doc/04-schema.md)\n\n\n## Example\nBefore running `composer-json-fixer`:\n```json\n{\n    \"name\": \"JohnDoe/FooBar\",\n    \"version\": \"v1.0.0\",\n    \"type\": \"library\",\n    \"description\": \"A library to do something cool\",\n    \"keywords\": [\n        \"cool\",\n        \"awesome stuff\"\n    ],\n    \"require-dev\": {\n        \"phpunit/phpunit\": \"^5.7 | ^6.5\"\n    },\n    \"require\": {\n        \"symfony/finder\": \"^2.7|^3.4|^4\",\n        \"symfony/yaml\": \"\u003e= 2.7\"\n    },\n    \"minimum-stability\": \"stable\",\n    \"autoload\": {\n        \"psr-4\": {\n            \"FooBar\": \"src\"\n        }\n    }\n}\n\n```\nAfter:\n```json\n{\n    \"name\": \"johndoe/foobar\",\n    \"description\": \"A library to do something cool\",\n    \"type\": \"library\",\n    \"keywords\": [\n        \"awesome stuff\",\n        \"cool\"\n    ],\n    \"license\": \"proprietary\",\n    \"require\": {\n        \"symfony/finder\": \"^2.7 || ^3.4 || ^4\",\n        \"symfony/yaml\": \"\u003e=2.7\"\n    },\n    \"require-dev\": {\n        \"phpunit/phpunit\": \"^5.7 || ^6.5\"\n    },\n    \"autoload\": {\n        \"psr-4\": {\n            \"FooBar\\\\\": \"src/\"\n        }\n    }\n}\n\n```\n\n\n## Exit status\n - `0` - `composer.json` file does not require fixing,\n - `1` - `composer.json` file can be, or was fixed,\n - `2` - exception was thrown.\n\n\n## Contributing\nRequest a feature or report a bug by creating [issue](https://github.com/jnbn/composer-json-fixer/issues).\n\nAlternatively, fork the repo, develop your changes, regenerate `README.md`:\n```bash\nsrc/Readme/run \u003e README.md\n```\nmake sure all checks pass:\n```bash\ncomposer check\n```\nand submit a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnbn%2Fcomposer-json-fixer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjnbn%2Fcomposer-json-fixer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnbn%2Fcomposer-json-fixer/lists"}