ebsco / edsapi-drupal-plugin

A Drupal modules for the EBSCO Discovery Services API
Apache License 2.0
1 stars 3 forks source link

PSR-4 compliance & class autoloading #15

Open jameswilson opened 6 years ago

jameswilson commented 6 years ago
require_once __DIR__ . '/lib/EBSCODocument.php';

In order to follow modern PHP best practices, the Drupal 8 ebsco.module file and the various classes in the lib folder should be refactored to use PSR-4 autoloading.

A more complete solution however would be to consider extracting EBSCODocument and all the other classes into a separate repository, so they can be exposed to Packagist, and installed via a composer dependency in the Drupal module's composer.json this would mean that any PHP project (eg Symfony or Laravel) could benefit from using these classes.

See Drupal 8 Coding Standards for PSR-4 Namespaces and Autoloading