Suppress exceptions for deprecation notices, and simply output them to console instead

Hi,

We're running composer in a test environment with minimum-stability set to dev and seeing failures since Symfony started adding deprecation messages a day or so ago. Composer currently handles these deprecation messages as errors and throws an ErrorException, causing the composer run to fail.

This patch causes E_DEPRECATED and E_USER_DEPRECATED (which Symfony is using) to simply output to standard out, or if console is initialised as a "<warning>text</warning>" message, and to not end the composer run with a failure.

Let me know if you believe a different approach is necessary - but I think deprecation notices are likely able to be ignored in dev stability. It might make moving forward from the deprecation notices easier too as it will output them all at once. It should be easy to extend this patch too to have an option to hide deprecation messages, even by default, if it's felt necessary.

Thanks,

Jason
Thanks for the review!

> it would be good to check an assertion.
Could you elaborate more? I'm not sure what you mean here.

>> and you should also restore the error handler
All of the other error handler tests do not restore the handler. Additionally, the error handler interface does not provide an unregister() method. So its best left to another PR where the register() is called in a before() and unregister() in an after() so even after failure it resets.