PHP-OAuth2 icon indicating copy to clipboard operation
PHP-OAuth2 copied to clipboard

Having own specific namespace to prevent conflicts

Open smuuf opened this issue 8 years ago • 0 comments

Hi, I'm proposing this to avoid namespace conflicts when having multiple libraries dealing with OAuth2 and both have - let's admit it - pretty silly general OAuth2 namespace, which bears a high probability of conflicts with other libraries.

Basically this pull request changes stuff like:

<?php

namespace OAuth2\GrantType;

to

<?php

namespace Adoy\OAuth2\GrantType;

I know this is a BC break, so I'm not expecting this to be merged any time soon, but I figured even some day will be better than never. :)

The reason I had a conflict was this OAuth2 server library (https://github.com/bshaffer/oauth2-server-php), that - unfortunately - used the same generic OAuth2 namespace and thus class name conflicts appeared. It's only because adoy/PHP-OAuth2 had fewer files I decided to namespace this OAuth2 client library and not the OAuth2 server lib. to resolve the problem, so please don't take this personally :D

I know my solution could have remained being just a fork, but I figured that if it could help other people to prevent the same problem, then I might as well propose a PR.

smuuf avatar Aug 24 '16 12:08 smuuf