Skip to content

Commit ccf1473

Browse files
Leverage trigger_deprecation() from symfony/deprecation-contracts
1 parent 160559f commit ccf1473

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

OptionsResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ public function offsetGet($option, bool $triggerDeprecation = true)
863863
// Shortcut for resolved options
864864
if (isset($this->resolved[$option]) || \array_key_exists($option, $this->resolved)) {
865865
if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || $this->calling) && \is_string($this->deprecated[$option])) {
866-
@trigger_error(strtr($this->deprecated[$option], ['%name%' => $option]), E_USER_DEPRECATED);
866+
trigger_deprecation('', '', strtr($this->deprecated[$option], ['%name%' => $option]));
867867
}
868868

869869
return $this->resolved[$option];
@@ -1022,7 +1022,7 @@ public function offsetGet($option, bool $triggerDeprecation = true)
10221022
}
10231023

10241024
if ('' !== $deprecationMessage) {
1025-
@trigger_error(strtr($deprecationMessage, ['%name%' => $option]), E_USER_DEPRECATED);
1025+
trigger_deprecation('', '', strtr($deprecationMessage, ['%name%' => $option]));
10261026
}
10271027
}
10281028

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.5"
19+
"php": "^7.2.5",
20+
"symfony/deprecation-contracts": "^2.1"
2021
},
2122
"autoload": {
2223
"psr-4": { "Symfony\\Component\\OptionsResolver\\": "" },

0 commit comments

Comments
 (0)