sendgrid / sendgrid-php

The Official Twilio SendGrid PHP API Library
https://sendgrid.com
MIT License
1.49k stars 624 forks source link

php-http-client is another project and needs sub-package name #1018

Open centurianii opened 3 years ago

centurianii commented 3 years ago

php-http-client is at 3.13.0 version currently and as is a different project with it's own versioning I think the next is confusing:

use SendGrid\Client;

which implies a direct relation with the current library.

I think a better solution is to create a sub-namespace like:

use SendGrid\Http\Client;

that makes psr4 autoloading much easier as now you can point the package loader to any folder you like and put there the project's files:

http-client
     |_ Exception
     |         |_ InvalidRequest.php
     |_ Client.php
     |_ Response.php

I experiment this now in a sub-folder using my own autoloading function.

centurianii commented 3 years ago

...another thing is that the next 3 files do not have a namespace:

namespace SendGrid;
BaseSendGridClientInterface.php
SendGrid.php
TwilioEmail.php
centurianii commented 3 years ago

...also starkbank library can easily be converted to psr4: just rename the files/directories, delete elipticcurve.php and you are done:

ecdsa.php -> Ecdsa.php
privatekey.php -> PrivateKey.php
publickey.php -> PublicKey.php
signature.php -> Signature.php
utils -> Utils
file.php -> File.php
thinkingserious commented 3 years ago

Hello @centurianii,

Thank you for this feedback! This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

With best regards,

Elmer