Skip to content

Commit 0d8d7b4

Browse files
Leverage trigger_deprecation() from symfony/deprecation-contracts
1 parent 88b2da3 commit 0d8d7b4

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Extension/Core/Type/FormType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
6161
}
6262

6363
if (!method_exists($builder, 'setIsEmptyCallback')) {
64-
@trigger_error(sprintf('Not implementing the "%s::setIsEmptyCallback()" method in "%s" is deprecated since Symfony 5.1.', FormConfigBuilderInterface::class, \get_class($builder)), E_USER_DEPRECATED);
64+
trigger_deprecation('symfony/form', '5.1', 'Not implementing the "%s::setIsEmptyCallback()" method in "%s" is deprecated.', FormConfigBuilderInterface::class, \get_class($builder));
6565

6666
return;
6767
}

Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ public function isEmpty()
727727
}
728728

729729
if (!method_exists($this->config, 'getIsEmptyCallback')) {
730-
@trigger_error(sprintf('Not implementing the "%s::getIsEmptyCallback()" method in "%s" is deprecated since Symfony 5.1.', FormConfigInterface::class, \get_class($this->config)), E_USER_DEPRECATED);
730+
trigger_deprecation('symfony/form', '5.1', 'Not implementing the "%s::getIsEmptyCallback()" method in "%s" is deprecated.', FormConfigInterface::class, \get_class($this->config));
731731

732732
$isEmptyCallback = null;
733733
} else {

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": "^7.2.5",
20+
"symfony/deprecation-contracts": "^2.1",
2021
"symfony/event-dispatcher": "^4.4|^5.0",
2122
"symfony/intl": "^4.4|^5.0",
2223
"symfony/options-resolver": "^5.0",

0 commit comments

Comments
 (0)