campaignmonitor / createsend-php

A PHP library for the Campaign Monitor API
http://campaignmonitor.github.io/createsend-php
Other
285 stars 106 forks source link

PSR-4 autoloading #88

Open dustinleblanc opened 5 years ago

dustinleblanc commented 5 years ago

Hey Folks!

We just pulled this project into a site we're working on and realized that none of the code is namespaced per PSR-4 conventions which makes it a little unconventional to work with. Would you be amenable to a pull-request to move this library over to a full PSR-4 compliant namespacing setup? I believe it shouldn't be too difficult to do as I think there are only a handful of classes here. It may help to promote adoption and make it easier for people to create dependent packages (like a Laravel Package, a Drupal 8 module, etc).

Thanks!

bertheyman commented 5 years ago

I'd be a fan of these changes. However, CampaignMonitor aren't too quick answering on Github - might be best to also drop their support an email.

purdy commented 3 years ago

Any traction on this? My Drupal codebase fails code style checks because the classes aren't namespaced.

use CS_REST_Subscribers;

Non-namespaced classes/interfaces/traits should not be referenced with use statements

purdy commented 3 years ago

BTW, if this is helpful to anyone else, you can surround the use statement with annotations to tell phpcs to ignore it for now:

// @codingStandardsIgnoreStart
use CS_REST_Subscribers;
// @codingStandardsIgnoreEnd