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

Fix typos in code #4422

Merged
merged 3 commits into from
Dec 5, 2014
Merged

Fix typos in code #4422

merged 3 commits into from
Dec 5, 2014

Conversation

ifdattic
Copy link
Contributor

@ifdattic ifdattic commented Nov 4, 2014

Q A
Doc fix? yes
New docs? no
Applies to 2.3
Fixed tickets

PS 1: As so far I used only yaml files for services not sure if the changes to XML and PHP code blocks are correct

PS 2: Maybe I configured something wrong or something like that (or you could point me in the right direction for more information), but I don't think the terminate listener will work. In my opinion when command is exited with exception the exit code should be more than zero, but on ConsoleTerminateEvent and even on ConsoleExceptionEvent the exit code is 0

@xabbuh
Copy link
Member

xabbuh commented Nov 4, 2014

What do you think about removing the parameters entirely and putting the class names directly into the service definitions? There is no benefit in using the parameters.

@ifdattic
Copy link
Contributor Author

ifdattic commented Nov 5, 2014

Following the Symfony best practices it would make sense to remove the parameters.
Will try to do it later when having some free time

@xabbuh
Copy link
Member

xabbuh commented Nov 5, 2014

👍 looks good

namespace Acme\DemoBundle\EventListener;

use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Psr\Log\LoggerInterface;

class ConsoleExceptionListener
class ConsoleTerminateListener
Copy link
Member

Choose a reason for hiding this comment

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

This renaming is wrong IMO. ConsoleExceptionListener describes better the goal of the listener than ConsoleTerminateListener. The responsibility of the class is to log exceptions

Copy link
Member

Choose a reason for hiding this comment

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

A much better name could be ConsoleErrorLoggerListener (or ErrorLoggerListener to be shorter), given that it does not really log exceptions, but failure exit codes (logging exceptions would be on using the console.exception event)

Copy link
Member

Choose a reason for hiding this comment

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

ping @ifdattic It would be great if you could fix this, then we can merge these changes in!

@ifdattic
Copy link
Contributor Author

ping @wouterj @stof Updated, it should be ready for merge now

@xabbuh
Copy link
Member

xabbuh commented Nov 29, 2014

I agree. @wouterj or @weaverryan can merge this once they have some time. Thank you for your great job as always @ifdattic!

@ifdattic
Copy link
Contributor Author

Glad to help and happy being a part of a wonderful community

@weaverryan
Copy link
Member

Yes, excellent change! Well, I don't see any difference with the class re-name, but I like the new name anyways :). But the removing of the constants is of course perfect. Thanks Andrew!

@weaverryan weaverryan merged commit 2135b82 into symfony:2.3 Dec 5, 2014
weaverryan added a commit that referenced this pull request Dec 5, 2014
This PR was merged into the 2.3 branch.

Discussion
----------

Fix typos in code

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3
| Fixed tickets |

PS 1: As so far I used only yaml files for services not sure if the changes to XML and PHP code blocks are correct

PS 2: Maybe I configured something wrong or something like that (or you could point me in the right direction for more information), but I don't think the terminate listener will work. In my opinion when command is exited with exception the exit code should be more than zero, but on `ConsoleTerminateEvent` and even on `ConsoleExceptionEvent` the exit code is `0`

Commits
-------

2135b82 Change: ConsoleTerminateListener => ErrorLoggerListener
fc403b1 Removed parameters from service
d4ba3c0 Fix typos in code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants