Return non-zero status code if anything was fixed

This is so that commit hooks, or CI tools can easily fail.

fixes #158
Changed exit to just return
merged branch baldurrensch/issue_158 (PR #173)

This PR was merged into the master branch.

Commits
-------

951475f Changed exit to just return
85e4f1f Return non-zero status code if anything was fixed

Discussion
----------

Return non-zero status code if anything was fixed

This is so that commit hooks, or CI tools can easily fail.

fixes #158

---------------------------------------------------------------------------

by lyrixx at 2013-01-25T21:53:22Z

You should not exit by yourself, but return the return code.
See: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Application.php#L193 and https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Application.php#L119

---------------------------------------------------------------------------

by baldurrensch at 2013-01-25T22:20:52Z

@lyrixx: Thanks for the comment. FIxed.

---------------------------------------------------------------------------

by stof at 2013-01-25T23:29:45Z

This is bad IMO. The goal of the fixer is to fix your code. So why would it be a failure when it does its job ?

---------------------------------------------------------------------------

by baldurrensch at 2013-01-25T23:43:26Z

It would make it a little easier to use in tests (CI, pre-commit hook). I would have no problem with adding a comand-line option `--check` to enable the return code. Please also see the discussion for the issue.

---------------------------------------------------------------------------

by lyrixx at 2013-01-26T11:05:55Z

@stof I agree with you. But in this case, it's better to be pragmatic and don't respect the purity of code.

You can also made an analogy with grep:

``` bash
>[~/dev/foo](patch-2) grep foooooo web/index.php
>[~/dev/foo](patch-2) echo $?
1
>[~/dev/foo](patch-2) grep php web/index.php
Some content ...
>[~/dev/foo](patch-2) echo $?
0
```

If grep find something, it return 0, If not it return 1.
If php-cs-fixer find something it return 0, else it return 1. (Yes the pr do the opposite)
fixed CS