Skip to content

build: exclude the legacy global classes from the PSR-4 classmap - #1621

Merged
rumblefrog merged 1 commit into
sbpp:mainfrom
ChrisTX:psr4-exclude-legacy
Nov 7, 2026
Merged

rumblefrog merged 1 commit into
sbpp:mainfrom
ChrisTX:psr4-exclude-legacy

Conversation

@ChrisTX

@ChrisTX ChrisTX commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Description

Adds exclude-from-classmap to web/composer.json for the files under the PSR-4 root includes/ whose classes aren't in Sbpp\: Auth/openid.php (LightOpenID), BanRemoval.php, BanType.php, LogSearchType.php, LogType.php, WebPermission.php and SteamID/.

Motivation and Context

composer install --optimize-autoloader, as release.yml runs it, scans includes/ for the Sbpp\ namespace and prints a warning for each of these classes:

Class BanType located in ./includes/BanType.php does not comply with psr-4 autoloading standard (rule: Sbpp\ => ./includes). Skipping.

They're loaded with require_once in init.php, so skipping them is right; excluding them just makes that explicit and keeps the build output clean, so a real PSR-4 mistake in a new file would stand out.

How Has This Been Tested?

composer dump-autoload --optimize --no-dev prints no warnings, and the generated autoload_classmap.php is byte-for-byte identical to the one from main. composer validate passes; the lock file isn't affected.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

🤖 Generated with Claude Code

`composer install --optimize-autoloader`, as release.yml runs it, scans
the PSR-4 root `includes/` for `Sbpp\` and warns about the classes there
that aren't in that namespace: the global enums, LightOpenID and the
SteamID classes. init.php loads them with require_once, so they were
skipped anyway. Exclude them from the classmap, which leaves the
generated autoloader identical and drops the eight warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ChrisTX
ChrisTX requested a review from a team November 5, 2026 20:52
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@ChrisTX

ChrisTX commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

ChrisTX added a commit to ChrisTX/aur-packages that referenced this pull request Nov 5, 2026
- composer-exclude-legacy-classes.patch, sbpp/sourcebans-pp#1621 as it
  is: composer's optimised autoloader no longer warns about the 8 classes
  outside Sbpp\ in includes/; the package is the same
- LICENSES/Elastic-2.0.txt for the patch, which is of the web panel and
  thus under its licence

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
archlinux-github pushed a commit to archlinux/aur that referenced this pull request Nov 5, 2026
- composer-exclude-legacy-classes.patch, sbpp/sourcebans-pp#1621 as it
  is: composer's optimised autoloader no longer warns about the 8 classes
  outside Sbpp\ in includes/; the package is the same
- LICENSES/Elastic-2.0.txt for the patch, which is of the web panel and
  thus under its licence

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rumblefrog
rumblefrog added this pull request to the merge queue Nov 7, 2026
Merged via the queue into sbpp:main with commit f01b3f8 Nov 7, 2026
1 of 2 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants