Nexmo-PHP-lib icon indicating copy to clipboard operation
Nexmo-PHP-lib copied to clipboard

PSR-4 Autoloading Failing

Open davidbarratt opened this issue 10 years ago • 4 comments

In composer.json it is specified that a PSR-4 Autoloader can be used: https://github.com/prawnsalad/Nexmo-PHP-lib/blob/master/composer.json#L8-L10

However, the classes in the library do not have a namespace which is required by PSR-4 http://www.php-fig.org/psr/psr-4/

Either a namespace should be added to all three classes like so:

namespace PrawnSalad\Nexmo;

or the composer.json should be updated to use a classmap instead of PSR-4 https://getcomposer.org/doc/04-schema.md#classmap

davidbarratt avatar Jan 24 '15 18:01 davidbarratt

Bumping this issue :+1: for this

bryglen avatar Jan 30 '15 05:01 bryglen

:+1:

arianmaykon avatar Mar 14 '15 02:03 arianmaykon

Yep. This library is pretty much unusable because of the lack of proper name-spacing.

northern avatar Apr 27 '15 23:04 northern

Solved this issue by adding the following snippet to my own composer.json. Hopes this helps!

"autoload": {
   "classmap": [
      "vendor/prawnsalad/nexmo/src/"
   ]
}

giannidhooge avatar Nov 06 '15 11:11 giannidhooge