Skip to content

Version 3 #52

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

Merged
merged 4 commits into from
Apr 21, 2015
Merged

Version 3 #52

merged 4 commits into from
Apr 21, 2015

Conversation

pkruithof
Copy link
Contributor

Sorry in advance for the long PR description 😉

This weekend I noticed that Pheanstalk has reached version 3, but this bundle limits the dependency to <3.0. This was the right choice as Pheanstalk now properly uses namespaces. However with that library moving forward I think it's a good idea to upgrade this bundle as well.

As the namespaces of Pheanstalk have changed, this could cause breaking changes in projects that use this bundle, if they use any of the Pheanstalk classes directly. Granted, projects should include Pheanstalk as a dependency if they do this, but I think practically it would be best if this bundle's new version is also a major one.

Hence I've been working on what I think should be v3 of this bundle. I left the code mostly unchanged, except for some minor details. However I did make some decisions which I feel I should explain here, so here goes:

  • I've upped the required PHP version to 5.5.9. This is in line with Symfony's requirement when it reaches version 3.0 in a couple of months. Now it is not necessary for this bundle, but I feel that supporting old versions of PHP (5.3 has reached EOL 8 months ago, 5.4 will be in 4 months) does not help anyone really. Besides, when Symfony 3.0 is released, you'll want to be able to use this bundle with it I imagine, which requires this PHP version anyway.
  • In the same light I've updated the minimum supported Symfony version to 2.3 (which is LTS). I've added all these versions in the test matrix for Travis so all combinations are properly tested.
  • The project layout has been restructured: all code is in /src, all tests in /tests, like many projects/libraries do these days. It looks much more clean and organised now in my opinion.
  • All code has been run against the CS-Fixer to be PSR-2 compliant and more in line with Symfony's code standards. I also added/fixed a lot of PhpDoc when I encountered it.
  • The Monolog dependency has been replaced with the PSR-3 LoggerInterface
  • The commands have been refactored a bit: all commands used to start with the same block of code that selects a pheanstalk service, and checks if the service is running. That code has been moved to an abstract command, making it more DRY.
  • PheanstalkLogListenerTest was not really testing anything before, it is now.
  • Tests for all commands were added, as well as some other minor tests.
  • PheanstalkTest has been removed, as it tested Pheanstalk classes, which is outside of the scope of this bundle.

That's it, hope you like it ;)

@pkruithof
Copy link
Contributor Author

I git-renamed all the files properly, however due to some files being changed too much (> 50%), git sees it as a rm/add, which makes reviewing much more difficult. I've split the commits into 1) rename, 2) modify, so you can look at the second commit if you want to review the actual changes.

@armetiz
Copy link
Owner

armetiz commented Apr 20, 2015

Hi @pkruithof
Thanks for this cool and long PR :p

You did a great job.

Let me few hours to review it before merging.

Regards;
Thomas.

@pkruithof
Copy link
Contributor Author

Good luck 😉

By the way, the "phpunit/phpunit-mock-objects": "2.3.0" requirement is because of an HHVM bug. When that bug is resolved, you can just drop the mock-objects line.

armetiz added a commit that referenced this pull request Apr 21, 2015
@armetiz armetiz merged commit 14eb7be into armetiz:master Apr 21, 2015
@armetiz
Copy link
Owner

armetiz commented Apr 21, 2015

I've trusted your work quickly. I haven't take a look on each part of your PR.

Also,
I agree with your requirements.

Thanks for this huge work ;)
Regards.

@pkruithof
Copy link
Contributor Author

Nice! :shipit:

We're using a lot of worker functionality in our projects, I'll upgrade one of them soon to this new version, that way it's tested in real life 😃

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="leezy.pheanstalk.command.abstract.class">Leezy\PheanstalkBundle\Command\AbstractPheanstalkCommand</parameter>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @armetiz.
What you think about adopting this proposal in "leezy/pheanstalk-bundle": "~3.0"?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this proposal; Do you want to make a PR ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good @armetiz. Yes, I guess I'll send you a PR today.
Thank you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: #53.

@pkruithof pkruithof deleted the version-3 branch May 8, 2015 07:25
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

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy