bitpay / php-bitpay-client

PHP implementation for the BitPay cryptographically secure RESTful API
MIT License
165 stars 149 forks source link

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

Open petski opened 6 years ago

petski commented 6 years ago

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 commented 5 years ago

I can confirm this issue.