Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous LoggerInterface #58

Open
rkrx opened this issue Aug 1, 2017 · 5 comments
Open

Ambiguous LoggerInterface #58

rkrx opened this issue Aug 1, 2017 · 5 comments

Comments

@rkrx
Copy link

rkrx commented Aug 1, 2017

The SDK ships it's own version of Psr\Log\LoggerInterface which causes some IDEs (like PHPStorm) to remark an ambiguity when composer is used to install the real Psr\Log\LoggerInterface which is available twice then.

Currently, I have to fork this SDK and remove the Psr\Log\LoggerInterface to get rid of that remark.

I see the following solution:

  • Add an adapter-interface and an adapter for Psr\Log\LoggerInterface and also an default-adapter shipped with the SDK.
  • Remove Psr\Log\LoggerInterface-Files from the project and depend on composer alone. There is currently no implementation other than NullLogger shipped with the SDK so the interface alone makes not much sense. The interface-typehint will work without the interface-files. Using use and typehinting don't require the actual interface to be present.

OR

  • Publish a repository which only consists of files from the directoy /AmazonPay and /tst.
@ejegg
Copy link

ejegg commented Aug 9, 2017

Seconded!

ejegg added a commit to ejegg/login-and-pay-with-amazon-sdk-php that referenced this issue Aug 10, 2017
This commit removes a duplicated version of Psr\Log, which could have
caused applications to use a different version than expected. Instead,
we list psr/log as a composer dependency.

To facilitate unit tests, a phpunit-bootstrap file is added which
includes vendor/autoload.php, and a phpunit.xml file is added to point
to the bootstrap.

Phpunit is also added to the require-dev section of composer.json, as
the unit tests do depend on it.

Fixes amzn#58
ejegg added a commit to ejegg/login-and-pay-with-amazon-sdk-php that referenced this issue Aug 10, 2017
This commit removes a duplicated version of Psr\Log, which could have
caused applications to use a different version than expected. Instead,
we list psr/log as a composer dependency.

To facilitate unit tests, a phpunit-bootstrap file is added which
includes vendor/autoload.php, and a phpunit.xml file is added to point
to the bootstrap.

Running unit tests now requires 'composer install', but afterward you
simply run 'phpunit' in the root directory of the project.
'composer test' also works.

Phpunit is also added to the require-dev section of composer.json, as
the unit tests do depend on it.

Fixes amzn#58
ejegg added a commit to ejegg/login-and-pay-with-amazon-sdk-php that referenced this issue Dec 15, 2017
This commit removes a duplicated version of Psr\Log, which could have
caused applications to use a different version than expected. Instead,
we list psr/log as a composer dependency.

To facilitate unit tests, a phpunit-bootstrap file is added which
includes vendor/autoload.php, and a phpunit.xml file is added to point
to the bootstrap.

Running unit tests now requires 'composer install', but afterward you
simply run 'phpunit' in the root directory of the project.
'composer test' also works.

Phpunit is also added to the require-dev section of composer.json, as
the unit tests do depend on it.

Fixes amzn#58
@nlubisch
Copy link

As mentioned in the existing PR i also appreciate this.

@theromulans
Copy link

I've come here to post this same comment.

@marcelloinfoweb
Copy link

marcelloinfoweb commented Jan 12, 2023

In 2023 the same problem

@ahmad562
Copy link

i am facing same problem with laravel 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants