PHPackages                             kubawerlos/composer-require-better - 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. [CLI &amp; Console](/categories/cli)
4. /
5. kubawerlos/composer-require-better

AbandonedComposer-plugin[CLI &amp; Console](/categories/cli)

kubawerlos/composer-require-better
==================================

Provides a command to require package with constraint having patch version

v1.5.0(4y ago)197MITPHPPHP ^7.4 || ^8.0

Since Mar 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/kubawerlos/composer-require-better)[ Packagist](https://packagist.org/packages/kubawerlos/composer-require-better)[ RSS](/packages/kubawerlos-composer-require-better/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (10)Used By (0)

composer-require-better
=======================

[](#composer-require-better)

This repository is abandoned, use [`composer bump`](https://getcomposer.org/doc/03-cli.md#bump) instead.
--------------------------------------------------------------------------------------------------------

[](#this-repository-is-abandoneduse-composer-bump-instead)

Plugin for [Composer](https://getcomposer.org) to require package with constraint having [patch version](https://semver.org).

[![Current version](https://camo.githubusercontent.com/5c8e6ea0658fddae0e8a6d6d334ea68ce1f57f1b581ce1f75c631be886cb804f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b7562617765726c6f732f636f6d706f7365722d726571756972652d6265747465722e7376673f6c6162656c3d43757272656e7425323076657273696f6e)](https://packagist.org/packages/kubawerlos/composer-require-better)[![PHP version](https://camo.githubusercontent.com/1bb0a375d51a4e9e9506f17c2c5a1f4a2019d7f85c6a46d14640129578300547/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6b7562617765726c6f732f636f6d706f7365722d726571756972652d6265747465722e737667)](https://php.net)[![CI Status](https://github.com/kubawerlos/composer-require-better/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/kubawerlos/composer-require-better/actions)[![Code coverage](https://camo.githubusercontent.com/7f0b4231ad23922d0e763929b990cc0ae9ce0d5a97234b0e5e04f36e273510f5/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f6b7562617765726c6f732f636f6d706f7365722d726571756972652d6265747465722f6d61696e2e737667)](https://coveralls.io/github/kubawerlos/composer-require-better?branch=main)[![Psalm type coverage](https://camo.githubusercontent.com/5f631472db12b86822fe410ce589a3efab64a7240939226bfd9fb86e739f2d61/68747470733a2f2f73686570686572642e6465762f6769746875622f6b7562617765726c6f732f636f6d706f7365722d726571756972652d6265747465722f636f7665726167652e737667)](https://shepherd.dev/github/kubawerlos/composer-require-better)

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

[](#installation)

```
composer global require kubawerlos/composer-require-better
```

Usage
-----

[](#usage)

```
composer rb vendor/package
```

All Composer's [require](https://getcomposer.org/doc/03-cli.md#require) options (except `prefer-lowest` and `prefer-stable`) can be used.

Motivation
----------

[](#motivation)

Let's assume we want to install package `acme-corporation/adding-machine` for our project and it has versions `1.0.0` and `1.0.1` released. Usually, we run:

```
composer require acme-corporation/adding-machine
```

We will have the latest version installed (`1.0.1`) and constraint `^1.0` added to `composer.json`. The constraint means all version from `1.0.0`, but lower than `2.0.0` are allowed.

This can result in some problems in the future:

1. If we would want to install another package, that allows `acme-corporation/adding-machine` only in version `1.0.0` (or has a conflict with `acme-corporation/adding-machine` version `1.0.1`) it would result with `acme-corporation/adding-machine` being downgraded to version `1.0.0` - we can easily miss that downgrade (as it will be one line in the console) - what if `1.0.1` fixes critical bug for us?
2. If we run `composer update --prefer-lowest` (quite often practice when developing a library) we would end up with `acme-corporation/adding-machine` in version `1.0.0`.
3. Command `composer update` could take a long time to run when having many packages with many allowed versions (e.g. Symfony 3 LTS has current version `3.4.38`, so constraint `^3.4` is allowing 39 versions - from `3.4.0` to `3.4.38`).

So instead we can run:

```
composer rb acme-corporation/adding-machine
```

We will have the latest version installed - the same as with `require` command, but the constraint added to `composer.json` will be `^1.0.1` - it would mean all version from `1.0.0`, but lower than `2.0.0` are allowed. What would that change?

1. If we would want to install the package that previously downgraded `acme-corporation/adding-machine` we would see an error and would have to make a decision - is this acceptable to us or we cannot allow it?
2. Running `composer update --prefer-lowest` would do nothing for the package as now installed version is the lowest allowed with the constraint.
3. Command `composer update` would work faster - mentioned Symfony 3 LST constraint would be `^3.4.38`, so it would allow only single version, not 39 versions.
4. In `composer.json` we now have the installed version as the constraint, so we don't have to check with `composer show` or in `composer.lock` (if we even have it in the repository) which version is used in the project.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 61% 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 ~148 days

Recently: every ~180 days

Total

6

Last Release

1500d ago

PHP version history (3 changes)v1.0.0PHP ^7.2

v1.3.0PHP ^7.2 || ^8.0

v1.5.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/43e5f3c381362868a775f822f2f0bd6d32d77d0226a2d2716e63c65311923ff5?d=identicon)[kubawerlos](/maintainers/kubawerlos)

---

Top Contributors

[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (166 commits)")[![kubawerlos](https://avatars.githubusercontent.com/u/9282069?v=4)](https://github.com/kubawerlos "kubawerlos (55 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (50 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")

---

Tags

composercomposer-pluginphpplugincomposerclirequire

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kubawerlos-composer-require-better/health.svg)

```
[![Health](https://phpackages.com/badges/kubawerlos-composer-require-better/health.svg)](https://phpackages.com/packages/kubawerlos-composer-require-better)
```

PHPackages © 2026

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