Drop redundant load_composer_autoloader#131
Merged
Merged
Conversation
The extension.json load_composer_autoloader key only require_once's the extension's own vendor/autoload.php (a file_exists-guarded include, independent of AutoloadNamespaces). SemanticScribunto has no composer autoload block and no third-party runtime composer dependencies — its require lists only php and composer/installers — so there is no local vendor autoloader worth loading; SMW\Scribunto classes load via AutoloadNamespaces. Remove the key, matching SemanticCompoundQueries.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #131 +/- ##
=========================================
Coverage 97.97% 97.97%
Complexity 72 72
=========================================
Files 4 4
Lines 198 198
=========================================
Hits 194 194
Misses 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
extension.jsonload_composer_autoloaderkey onlyrequire_onces theextension's own
vendor/autoload.php— afile_exists-guarded include, fullyindependent of
AutoloadNamespaces/AutoloadClasses. It is only useful when anextension ships its own third-party Composer dependencies in a local
vendor/.SemanticScribunto has no composer
autoloadblock and no third-party runtimeComposer dependencies (
requireisphp+composer/installersonly;composer/installersis a build-time plugin never loaded at runtime). Its ownclasses load via
AutoloadNamespaces(SMW\Scribunto\→src/), and theScribunto/Semantic MediaWiki dependencies are MediaWiki extensions
(
requires.extensions), not Composer libraries. So the key loads nothing and isdead weight. This matches the SemanticCompoundQueries end state.
Verification
Run in the docker-compose-ci container (MediaWiki 1.43, SMW
dev-master,Scribunto
REL1_43), with the key removed:composer analyzeclean (parallel-lint + PHPCS + minus-x).composer phpunitgreen — 161 tests, 492 assertions (7 pre-existingenvironment-gated skips).
eval.phpchecks: the extension still loads from the manifest(
ExtensionRegistry::isLoadedtrue), theScribuntoExternalLibrarieshook isregistered in the real hook container, and
SMW\Scribunto\HooksHandlerautoloads via
AutoloadNamespaces.