Conversation
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
4a0fd9c to
e197b8e
Compare
|
Updated for 3.2.0, conflicts resolved. @bjguillot want to merge this? It looks pretty silly to have those duplicate Psr\Log files in this library. |
|
Thanks, @ejegg. I agree with you that the Psr\Log files should be removed since they duplicate code from another repository, but my concern is what to do about merchants that may be using the SDK without composer. There are some merchants that simply clone the files from GitHub directly into their production environment, and if were to remove the files, it could potentially complicate that method. It would also impact folks using the SDK in it's .phar form (perhaps bundling a second .phar for Psr\Log that could be separately downloaded)? If you have a suggestion on the best way to handle those aspects, that could speed along accepting the PR in the next SDK release. Thanks again for insisting on high standards. |
|
@bjguillot the Github Releases would be the right solution. I'm also very interested in this, as i plan a major cleanup (PSR2, correct PHPDocs, and so on) for the current code base. |
|
What is the status of this? I ask because I'm constantly getting error warnings in my IDE due to having two instances of @nlubisch gave a valid answer for how to handle customers that don't use composer. |
This PR 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 #58