Skip to content

Commit eb261d4

Browse files
committed
Silence invasive deprecation warnings, opt-in for warnings
1 parent 18f0dda commit eb261d4

File tree

204 files changed

+314
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+314
-314
lines changed

UPGRADE-2.7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Global
55
------
66

77
* `E_USER_DEPRECATED` warnings -
8-
`trigger_error('... is deprecated ...', E_USER_DEPRECATED)` -
8+
`@trigger_error('... is deprecated ...', E_USER_DEPRECATED)` -
99
are now triggered when using all deprecated functionality.
1010
To avoid filling up error logs, you may need to add
1111
`~E_USER_DEPRECATED` to your `error_reporting` setting in

src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Form\ChoiceList;
1313

14-
trigger_error('The '.__NAMESPACE__.'\EntityChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader instead.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\EntityChoiceList class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader instead.', E_USER_DEPRECATED);
1515

1616
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
1717
use Doctrine\Common\Persistence\ObjectManager;
@@ -305,7 +305,7 @@ public function getValuesForChoices(array $entities)
305305
*/
306306
public function getIndicesForChoices(array $entities)
307307
{
308-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
308+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
309309

310310
// Performance optimization
311311
if (empty($entities)) {
@@ -349,7 +349,7 @@ public function getIndicesForChoices(array $entities)
349349
*/
350350
public function getIndicesForValues(array $values)
351351
{
352-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
352+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
353353

354354
// Performance optimization
355355
if (empty($values)) {

src/Symfony/Bridge/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ public function __construct($queryBuilder, $manager = null, $class = null)
5757
}
5858

5959
if ($queryBuilder instanceof \Closure) {
60-
trigger_error('Passing a QueryBuilder closure to '.__CLASS__.'::__construct() is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
60+
@trigger_error('Passing a QueryBuilder closure to '.__CLASS__.'::__construct() is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
6161

6262
if (!$manager instanceof EntityManager) {
6363
throw new UnexpectedTypeException($manager, 'Doctrine\ORM\EntityManager');
6464
}
6565

66-
trigger_error('Passing an EntityManager to '.__CLASS__.'::__construct() is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
67-
trigger_error('Passing a class to '.__CLASS__.'::__construct() is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
66+
@trigger_error('Passing an EntityManager to '.__CLASS__.'::__construct() is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
67+
@trigger_error('Passing a class to '.__CLASS__.'::__construct() is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
6868

6969
$queryBuilder = $queryBuilder($manager->getRepository($class));
7070

src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public function configureOptions(OptionsResolver $resolver)
248248
// deprecation note
249249
$propertyNormalizer = function (Options $options, $propertyName) {
250250
if ($propertyName) {
251-
trigger_error('The "property" option is deprecated since version 2.7 and will be removed in 3.0. Use "choice_label" instead.', E_USER_DEPRECATED);
251+
@trigger_error('The "property" option is deprecated since version 2.7 and will be removed in 3.0. Use "choice_label" instead.', E_USER_DEPRECATED);
252252
}
253253

254254
return $propertyName;
@@ -267,7 +267,7 @@ public function configureOptions(OptionsResolver $resolver)
267267
// deprecation note
268268
$loaderNormalizer = function (Options $options, $loader) {
269269
if ($loader) {
270-
trigger_error('The "loader" option is deprecated since version 2.7 and will be removed in 3.0. Override getLoader() instead.', E_USER_DEPRECATED);
270+
@trigger_error('The "loader" option is deprecated since version 2.7 and will be removed in 3.0. Override getLoader() instead.', E_USER_DEPRECATED);
271271
}
272272

273273
return $loader;

src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bridge\Doctrine\Tests;
1313

14-
trigger_error('The '.__NAMESPACE__.'\DoctrineOrmTestCase class is deprecated since version 2.4 and will be removed in 3.0. Use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper class instead.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\DoctrineOrmTestCase class is deprecated since version 2.4 and will be removed in 3.0. Use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper class instead.', E_USER_DEPRECATED);
1515

1616
use Doctrine\ORM\EntityManager;
1717
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;

src/Symfony/Bridge/Monolog/Logger.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Logger extends BaseLogger implements LoggerInterface, DebugLoggerInterface
2727
*/
2828
public function emerg($message, array $context = array())
2929
{
30-
trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the emergency() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
30+
@trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the emergency() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
3131

3232
return parent::addRecord(BaseLogger::EMERGENCY, $message, $context);
3333
}
@@ -37,7 +37,7 @@ public function emerg($message, array $context = array())
3737
*/
3838
public function crit($message, array $context = array())
3939
{
40-
trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the method critical() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
40+
@trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the method critical() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
4141

4242
return parent::addRecord(BaseLogger::CRITICAL, $message, $context);
4343
}
@@ -47,7 +47,7 @@ public function crit($message, array $context = array())
4747
*/
4848
public function err($message, array $context = array())
4949
{
50-
trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the error() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
50+
@trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the error() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
5151

5252
return parent::addRecord(BaseLogger::ERROR, $message, $context);
5353
}
@@ -57,7 +57,7 @@ public function err($message, array $context = array())
5757
*/
5858
public function warn($message, array $context = array())
5959
{
60-
trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the warning() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
60+
@trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the warning() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
6161

6262
return parent::addRecord(BaseLogger::WARNING, $message, $context);
6363
}

src/Symfony/Bridge/Swiftmailer/DataCollector/MessageDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bridge\Swiftmailer\DataCollector;
1313

14-
trigger_error(__CLASS__.' class is deprecated since version 2.4 and will be removed in 3.0. Use the Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector class from SwiftmailerBundle instead. Require symfony/swiftmailer-bundle package to download SwiftmailerBundle with Composer.', E_USER_DEPRECATED);
14+
@trigger_error(__CLASS__.' class is deprecated since version 2.4 and will be removed in 3.0. Use the Symfony\Bundle\SwiftmailerBundle\DataCollector\MessageDataCollector class from SwiftmailerBundle instead. Require symfony/swiftmailer-bundle package to download SwiftmailerBundle with Composer.', E_USER_DEPRECATED);
1515

1616
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
1717
use Symfony\Component\HttpFoundation\Request;

src/Symfony/Bridge/Twig/AppVariable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function setDebug($debug)
6868
*/
6969
public function getSecurity()
7070
{
71-
trigger_error('The "app.security" variable is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
71+
@trigger_error('The "app.security" variable is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
7272

7373
if (null === $this->container) {
7474
throw new \RuntimeException('The "app.security" variable is not available.');

src/Symfony/Bridge/Twig/Extension/AssetExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ public function getAssetUrl($path, $packageName = null, $absolute = false, $vers
6161
{
6262
// BC layer to be removed in 3.0
6363
if (2 < $count = func_num_args()) {
64-
trigger_error('Generating absolute URLs with the Twig asset() function was deprecated in 2.7 and will be removed in 3.0. Please use absolute_url() instead.', E_USER_DEPRECATED);
64+
@trigger_error('Generating absolute URLs with the Twig asset() function was deprecated in 2.7 and will be removed in 3.0. Please use absolute_url() instead.', E_USER_DEPRECATED);
6565
if (4 === $count) {
66-
trigger_error('Forcing a version with the Twig asset() function was deprecated in 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
66+
@trigger_error('Forcing a version with the Twig asset() function was deprecated in 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
6767
}
6868

6969
$args = func_get_args();
@@ -89,7 +89,7 @@ public function getAssetVersion($path, $packageName = null)
8989

9090
public function getAssetsVersion($packageName = null)
9191
{
92-
trigger_error('The Twig assets_version() function was deprecated in 2.7 and will be removed in 3.0. Please use asset_version() instead.', E_USER_DEPRECATED);
92+
@trigger_error('The Twig assets_version() function was deprecated in 2.7 and will be removed in 3.0. Please use asset_version() instead.', E_USER_DEPRECATED);
9393

9494
return $this->packages->getVersion('/', $packageName);
9595
}

src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function createFormBuilder($data = null, array $options = array())
273273
*/
274274
public function getRequest()
275275
{
276-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0. The only reliable way to get the "Request" object is to inject it in the action method.', E_USER_DEPRECATED);
276+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0. The only reliable way to get the "Request" object is to inject it in the action method.', E_USER_DEPRECATED);
277277

278278
return $this->container->get('request_stack')->getCurrentRequest();
279279
}
@@ -343,7 +343,7 @@ public function has($id)
343343
public function get($id)
344344
{
345345
if ('request' === $id) {
346-
trigger_error('The "request" service is deprecated and will be removed in 3.0. Add a typehint for Symfony\\Component\\HttpFoundation\\Request to your controller parameters to retrieve the request instead.', E_USER_DEPRECATED);
346+
@trigger_error('The "request" service is deprecated and will be removed in 3.0. Add a typehint for Symfony\\Component\\HttpFoundation\\Request to your controller parameters to retrieve the request instead.', E_USER_DEPRECATED);
347347
}
348348

349349
return $this->container->get($id);

0 commit comments

Comments
 (0)