Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Unit-testable, PSR-4 compatible fork - but what do to with it? #23

Open
lordelph opened this issue Mar 19, 2018 · 3 comments
Open

Unit-testable, PSR-4 compatible fork - but what do to with it? #23

lordelph opened this issue Mar 19, 2018 · 3 comments

Comments

@lordelph
Copy link

Firstly, thanks for creating this!

I created a fork and began making several improvements that I wanted:

  • PSR-4 compatible, so can now be easily installed via composer
  • PSR-2 formatted
  • replaced curl with Guzzle (as this allows easier unit testing)
  • added unit tests (around 80% complete so far)
  • reduction in code complexity (breaking apart methods, refactoring deeply nested ifs - still some work to go)
  • support for a PSR-3 logger
  • added custom exception classes so that the client throws its own exceptions
  • a few bugs fixed along the way

What I'd also really like is to abstract the storage so that you can have the orders, certificates etc stored somewhere other than the local filesystem.

You can see the branch here https://github.com/lordelph/LEClient/tree/polish

I can turn this into a big pull request once I've got the testing completed, but are these changes too much for you? I'm happy to rename my version to avoid confusion - let me know what you would prefer.

@yourivw
Copy link
Owner

yourivw commented Mar 29, 2018

I will look into it when I have some more time, but I like the work you've done. The namespace can be pushed anyway because I wanted to implement that. The logging and exceptions I'm not yet sure, because I'm still not sure how I want to implement this on my own system. I do have plans to make a logger class but a little bit customized.

@drkbcn
Copy link

drkbcn commented Mar 29, 2018

The current branch can be converted to PSR-2 in just a few seconds. It would be great to see code indented correctly. I use the following tool: https://github.com/FriendsOfPHP/PHP-CS-Fixer

@lordelph
Copy link
Author

Worth noting I've integrated both the checker and fixer into the composer.json, so you can simply use

composer check-style
and
composer fix-style

(also, note that because there's a few long lines, it takes more than a few seconds to clean up the first time!)

This, and some of the other 'boilerplate' is just taken from the thephpleague/skeleton

I'll be aiming to finish my branch in the next few weeks. If it's too divergent for you, I'll rename it to avoid any confusion. My particular use case is probably quite niche - I want to manage a lot of certificates centrally from within an existing PHP application.

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

No branches or pull requests

3 participants