Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

composer.json autoload causes src dir to be used as fallback directory #284

Open
petski opened this issue Aug 30, 2018 · 1 comment
Open

Comments

@petski
Copy link

petski commented Aug 30, 2018

The current composer.json autoload directive causes Bitpay's src directory to be used as fallback autoload directory. This behavior is caused because the "key"-value of autoload/psr-4/* is "". See documentation at https://getcomposer.org/doc/04-schema.md#psr-4 (grep on fallback).

You shouldn't use this project as a fallback directory as it degrades performance of the application in which you use this package.

Easy to be fixed with this patch:

--- a/composer.json
+++ b/composer.json
@@ -19,7 +19,7 @@
     ],
     "autoload": {
         "psr-4": {
-            "": "src/"
+            "Bitpay\\": "src/"
         }
     },
     "require": {
@mfb
Copy link
Contributor

mfb commented Sep 11, 2018

I can confirm this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants