Discussion:
[Symfony2] Disable deprecated warning in Symfony 2.7
Don_Busi
2015-04-11 20:37:00 UTC
Permalink
Hi everybody,

I have the same problem as in this thread on stackoverflow:
http://stackoverflow.com/questions/28850809/disable-deprecated-warning-in-symfony-2-7

Some of the bundles I open-sourced ARE compatible with Symfony version 2.1
through 2.7.

But in 2.7 there is deprecated code being used at several places..... it
still works fine, but errors are being thrown during unit-tests.

Now as suggested in the stackoverflow-thread mentioned above, I could
change the default-error reporting in the AppKernel in my development
environment. But on travis-ci the packages still appear faild for Symfony
2.7.

I mean the bundle works fine with Symfony 2.7, to use it with Symfony 3.0
I'll need to remove all the deprecations, but Symfony 3.0 will only be
released in November, so I'll release a new version to be used with Symfony
3.0 then.

What do you do with your bundles? Just limit Symfony to ">=2.1,<2.7" in
your .travis-file or is there an other workaround?

Cheers,
Don
--
--
If you want to report a vulnerability issue on Symfony, please read the procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to
symfony2+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Christophe COEVOET
2015-04-12 08:18:35 UTC
Permalink
Post by Don_Busi
Hi everybody,
http://stackoverflow.com/questions/28850809/disable-deprecated-warning-in-symfony-2-7
Some of the bundles I open-sourced ARE compatible with Symfony version
2.1 through 2.7.
But in 2.7 there is deprecated code being used at several places.....
it still works fine, but errors are being thrown during unit-tests.
Now as suggested in the stackoverflow-thread mentioned above, I could
change the default-error reporting in the AppKernel in my development
environment. But on travis-ci the packages still appear faild for
Symfony 2.7.
I mean the bundle works fine with Symfony 2.7, to use it with Symfony
3.0 I'll need to remove all the deprecations, but Symfony 3.0 will
only be released in November, so I'll release a new version to be used
with Symfony 3.0 then.
What do you do with your bundles? Just limit Symfony to ">=2.1,<2.7"
in your .travis-file or is there an other workaround?
Cheers,
Don
PHPUnit overwrites the error_reporting level when running the testsuite.
So if you want to change it to ignore deprecations, you also need to
define it in your phpunit.xml file.
--
Christophe | Stof
--
--
If you want to report a vulnerability issue on Symfony, please read the procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to
symfony2+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Don_Busi
2015-04-12 19:34:19 UTC
Permalink
Hi Christophe,

Thanx for the tip. Setting "convert*ToExceptions" to false in my
phpunit.xml worked fine.

Cheers,
Don

<phpunit
convertErrorsToExceptions="false"
convertNoticesToExceptions="false"
convertWarningsToExceptions="false"
...
</phpunit>
See: https://phpunit.de/manual/current/en/appendixes.configuration.html
--
--
If you want to report a vulnerability issue on Symfony, please read the procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to
symfony2+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Christian Flothmann
2015-04-13 09:05:39 UTC
Permalink
I don't think it is a good idea to completely disable the conversion.
Instead, you can just hide E_USER_DEPRECATED error messages by setting
the error_reporting level accordingly in your PHPUnit configuration
like this:

<phpunit>
<php>
<!-- disable E_USER_DEPRECATED -->
<!-- -16385 is the same as -1 & ~E_USER_DEPRECATED -->
<ini name="error_reporting" value="-16385"/>
</php>

<!-- ... -->
</phpunit>
Post by Don_Busi
Hi Christophe,
Thanx for the tip. Setting "convert*ToExceptions" to false in my phpunit.xml
worked fine.
Cheers,
Don
<phpunit
convertErrorsToExceptions="false"
convertNoticesToExceptions="false"
convertWarningsToExceptions="false"
...
</phpunit>
See: https://phpunit.de/manual/current/en/appendixes.configuration.html
--
--
If you want to report a vulnerability issue on Symfony, please read the
procedure on http://symfony.com/security
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
If you want to report a vulnerability issue on Symfony, please read the procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to
symfony2+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Don_Busi
2015-04-13 18:35:04 UTC
Permalink
Hi Christian,

thanx for this hint. It does def. make sense only to skip as few
errors/warnings etc. as needed.

It works fine for me with the phpunit.xml as below.

Cheers,
Don

<phpunit
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true">

<php>
<!-- disable E_USER_DEPRECATED -->
<!-- -16385 is the same as -1 & ~E_USER_DEPRECATED -->
<ini name="error_reporting" value="-16385"/>
</php>

<!-- ... -->
</phpunit>
--
--
If you want to report a vulnerability issue on Symfony, please read the procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to
symfony2+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Christian Flothmann
2015-04-13 19:10:43 UTC
Permalink
And since these are the default values, you can leave them out completely. :)
Post by Don_Busi
Hi Christian,
thanx for this hint. It does def. make sense only to skip as few
errors/warnings etc. as needed.
It works fine for me with the phpunit.xml as below.
Cheers,
Don
<phpunit
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true">
<php>
<!-- disable E_USER_DEPRECATED -->
<!-- -16385 is the same as -1 & ~E_USER_DEPRECATED -->
<ini name="error_reporting" value="-16385"/>
</php>
<!-- ... -->
</phpunit>
--
--
If you want to report a vulnerability issue on Symfony, please read the
procedure on http://symfony.com/security
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
If you want to report a vulnerability issue on Symfony, please read the procedure on http://symfony.com/security

You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to
symfony2+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
---
You received this message because you are subscribed to the Google Groups "Symfony2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...