Skip to content

Fix misleading configuration option name in error message #12498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kayw-geek
Copy link

Problem

The current error message displays incorrect configuration option name when terminal doesn't support hyperlinks:

To resolve ambiguity in classes not under your control you can ignore them by path using exclude-files-from-classmap

The hyperlink anchor text exclude-files-from-classmap is actually pointing to the documentation section #exclude-files-from-classmaps, but the actual configuration option documented there is exclude-from-classmap.

Impact

When users' terminals don't support hyperlinks, they see exclude-files-from-classmap as plain text and mistakenly believe this is the correct configuration option. This leads to invalid composer.json configurations that don't work.

Solution

Update the error message to show the correct configuration option name exclude-from-classmap instead of using the documentation anchor as the link text.

Before

$this->io->writeError('<info>To resolve ambiguity in classes not under your control you can ignore them by path using <href='.OutputFormatter::escape('https://getcomposer.org/doc/04-schema.md#exclude-files-from-classmaps').'>exclude-files-from-classmap</>');

After

$this->io->writeError('<info>To resolve ambiguity in classes not under your control you can ignore them by path using <href='.OutputFormatter::escape('https://getcomposer.org/doc/04-schema.md#exclude-files-from-classmaps').'>exclude-from-classmap</>');

This ensures users see the correct configuration option name regardless of their terminal's hyperlink support.

Seldaek and others added 30 commits July 16, 2025 16:53
… fix

If the installer script linked from [this page]([https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md](https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md)) is run using PHP 8, it generates the following deprecation notice.

```
Deprecated: Function openssl_free_key() is deprecated since 8.0, as OpenSSLAsymmetricKey objects are freed automatically in Standard input code on line 982
```

This issue was [fixed in the installer script]([composer/getcomposer.org#159](composer/getcomposer.org#159)), but the documentation was not updated to link to the version of it that includes the fix.
This will simplify secure installation of composer in GitHub Actions to two
calls to `gh` cli with no need to manually import any PGP signing keys:

    gh release --repo composer/composer download --pattern composer.phar
    gh attestation verify --repo composer/composer composer.phar

Given that the current PGP signing key is stored as a GitHub Action secret,
this type of attestation is no less secure than the existing PGP signing.
Glad that I added some tests as this meant I found a bug in the PR I pulled previously (composer#12257).

The `thanks_dev` key expects a username in the format `u/gh/USERNAME`, but the call to `basename()` was stripping the `u/gh/` part off.

If the use of `basename()` is preferred here, the alternative would be to add `u/gh/` to the default URL prefix for thanks.dev. Let me know if you me to change that.
ictbeheer and others added 28 commits July 16, 2025 16:54
* Add a CI job running with a 32bits build of PHP

* Move to a run that only happens on main branch

---------

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
composer#12383)

* Do not output script being run when running via composer <script-name>

Fixes composer#12375

* Fix global test expectations
Copy link

composer.lock

Package changes

Package Operation From To About
composer/ca-bundle downgrade 1.5.7 1.5.6 diff
composer/spdx-licenses downgrade 1.5.9 1.5.8 diff
justinrainbow/json-schema downgrade 6.4.2 6.4.1 diff
symfony/polyfill-ctype downgrade v1.32.0 v1.31.0 diff
symfony/polyfill-intl-grapheme downgrade v1.32.0 v1.31.0 diff
symfony/polyfill-intl-normalizer downgrade v1.32.0 v1.31.0 diff
symfony/polyfill-mbstring downgrade v1.32.0 v1.31.0 diff
symfony/polyfill-php73 downgrade v1.32.0 v1.31.0 diff
symfony/polyfill-php80 downgrade v1.32.0 v1.31.0 diff
symfony/polyfill-php81 downgrade v1.32.0 v1.31.0 diff

Dev Package changes

Package Operation From To About
phpstan/phpstan downgrade 1.12.27 1.12.23 diff
symfony/phpunit-bridge downgrade v7.3.0 v7.2.0 diff

Settings · Docs · Powered by Private Packagist

@kayw-geek kayw-geek closed this Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.