gared/polyless

Composer plugin that removes unnecessary Symfony polyfill packages

Maintainers

Package info

github.com/Gared/polyless

Type:composer-plugin

pkg:composer/gared/polyless

Statistics

Installs: 16

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

0.4.0 2026-06-28 15:41 UTC

This package is auto-updated.

Last update: 2026-06-29 20:17:03 UTC


README

polyless is a Composer plugin that marks unnecessary symfony/polyfill-* packages as replaced by the root project and removes their package candidates from Composer's pool.

What it does

The current basic implementation disables polyfills when one of these conditions is true:

  • the project's PHP constraint guarantees a version that already contains the feature set of a symfony/polyfill-phpXY package
  • the root project explicitly requires the corresponding extension, for example ext-mbstring for symfony/polyfill-mbstring
  • config.platform.php or configured ext-* platform entries provide the same guarantee

Direct root requirements for a specific symfony/polyfill-* package are left untouched.

Usage

Add this package to your project dev dependencies:

composer require --dev gared/polyless

You need to allow this package to run as a plugin!

After that run:

composer update symfony/polyfill-*

to remove any unnecessary polyfill packages from your project.

Current examples

PHP polyfills

If your project requires PHP 8.5:

{
  "require": {
    "php": "^8.5"
  }
}

then the plugin can replace packages such as:

  • symfony/polyfill-php80
  • symfony/polyfill-php81
  • symfony/polyfill-php82
  • symfony/polyfill-php83
  • symfony/polyfill-php84
  • symfony/polyfill-php85

If your project requires ext-intl, polyfills such as symfony/polyfill-intl-grapheme and symfony/polyfill-intl-normalizer can also be skipped.

Extension polyfills

If you composer.lock contains symfony/polyfill-mbstring you can run the following command to require the ext-mbstring extension instead (of course you need to have the PHP extension installed):

composer require ext-mbstring

this will automatically remove the symfony/polyfill-mbstring package from your project.