Skip to content

Commit 337dcea

Browse files
committed
Silence invasive deprecation warnings, opt-in for warnings
1 parent aeae235 commit 337dcea

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

Form/ChoiceList/EntityChoiceList.php

Lines changed: 3 additions & 5 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;
@@ -300,12 +300,11 @@ public function getValuesForChoices(array $entities)
300300
* @return array
301301
*
302302
* @see ChoiceListInterface
303-
*
304303
* @deprecated since version 2.4, to be removed in 3.0.
305304
*/
306305
public function getIndicesForChoices(array $entities)
307306
{
308-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
307+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
309308

310309
// Performance optimization
311310
if (empty($entities)) {
@@ -344,12 +343,11 @@ public function getIndicesForChoices(array $entities)
344343
* @return array
345344
*
346345
* @see ChoiceListInterface
347-
*
348346
* @deprecated since version 2.4, to be removed in 3.0.
349347
*/
350348
public function getIndicesForValues(array $values)
351349
{
352-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
350+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
353351

354352
// Performance optimization
355353
if (empty($values)) {

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

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;

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;

0 commit comments

Comments
 (0)