Skip to content

Commit 7fb10f2

Browse files
committed
Silence invasive deprecation warnings, opt-in for warnings
1 parent 3cacf5d commit 7fb10f2

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

ContainerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ private function getProxyInstantiator()
11271127
private function synchronize($id)
11281128
{
11291129
if ('request' !== $id) {
1130-
trigger_error('The '.__METHOD__.' method is deprecated in version 2.7 and will be removed in version 3.0.', E_USER_DEPRECATED);
1130+
@trigger_error('The '.__METHOD__.' method is deprecated in version 2.7 and will be removed in version 3.0.', E_USER_DEPRECATED);
11311131
}
11321132

11331133
foreach ($this->definitions as $definitionId => $definition) {

Definition.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function getFactory()
9898
*/
9999
public function setFactoryClass($factoryClass)
100100
{
101-
trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryClass), E_USER_DEPRECATED);
101+
@trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryClass), E_USER_DEPRECATED);
102102

103103
$this->factoryClass = $factoryClass;
104104

@@ -116,7 +116,7 @@ public function setFactoryClass($factoryClass)
116116
public function getFactoryClass($triggerDeprecationError = true)
117117
{
118118
if ($triggerDeprecationError) {
119-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
119+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
120120
}
121121

122122
return $this->factoryClass;
@@ -134,7 +134,7 @@ public function getFactoryClass($triggerDeprecationError = true)
134134
*/
135135
public function setFactoryMethod($factoryMethod)
136136
{
137-
trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryMethod), E_USER_DEPRECATED);
137+
@trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryMethod), E_USER_DEPRECATED);
138138

139139
$this->factoryMethod = $factoryMethod;
140140

@@ -187,7 +187,7 @@ public function getDecoratedService()
187187
public function getFactoryMethod($triggerDeprecationError = true)
188188
{
189189
if ($triggerDeprecationError) {
190-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
190+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
191191
}
192192

193193
return $this->factoryMethod;
@@ -205,7 +205,7 @@ public function getFactoryMethod($triggerDeprecationError = true)
205205
*/
206206
public function setFactoryService($factoryService)
207207
{
208-
trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryService), E_USER_DEPRECATED);
208+
@trigger_error(sprintf('%s(%s) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', __METHOD__, $factoryService), E_USER_DEPRECATED);
209209

210210
$this->factoryService = $factoryService;
211211

@@ -223,7 +223,7 @@ public function setFactoryService($factoryService)
223223
public function getFactoryService($triggerDeprecationError = true)
224224
{
225225
if ($triggerDeprecationError) {
226-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
226+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
227227
}
228228

229229
return $this->factoryService;
@@ -667,7 +667,7 @@ public function isPublic()
667667
public function setSynchronized($boolean, $triggerDeprecationError = true)
668668
{
669669
if ($triggerDeprecationError) {
670-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
670+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
671671
}
672672

673673
$this->synchronized = (bool) $boolean;
@@ -687,7 +687,7 @@ public function setSynchronized($boolean, $triggerDeprecationError = true)
687687
public function isSynchronized($triggerDeprecationError = true)
688688
{
689689
if ($triggerDeprecationError) {
690-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
690+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0.', E_USER_DEPRECATED);
691691
}
692692

693693
return $this->synchronized;

Dumper/PhpDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ private function addServiceSynchronizer($id, Definition $definition)
705705
}
706706

707707
if ('request' !== $id) {
708-
trigger_error('Synchronized services were deprecated in version 2.7 and won\'t work anymore in 3.0.', E_USER_DEPRECATED);
708+
@trigger_error('Synchronized services were deprecated in version 2.7 and won\'t work anymore in 3.0.', E_USER_DEPRECATED);
709709
}
710710

711711
$code = '';
@@ -1414,7 +1414,7 @@ public function dumpParameter($name)
14141414
*/
14151415
public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider)
14161416
{
1417-
trigger_error('The '.__METHOD__.' method is deprecated since version 2.6.2 and will be removed in 3.0. Use the Symfony\Component\DependencyInjection\ContainerBuilder::addExpressionLanguageProvider method instead.', E_USER_DEPRECATED);
1417+
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.6.2 and will be removed in 3.0. Use the Symfony\Component\DependencyInjection\ContainerBuilder::addExpressionLanguageProvider method instead.', E_USER_DEPRECATED);
14181418

14191419
$this->expressionLanguageProviders[] = $provider;
14201420
}

Loader/XmlFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private function parseDefinition(\DOMElement $service, $file)
151151
foreach (array('class', 'scope', 'public', 'factory-class', 'factory-method', 'factory-service', 'synthetic', 'lazy', 'abstract') as $key) {
152152
if ($value = $service->getAttribute($key)) {
153153
if (in_array($key, array('factory-class', 'factory-method', 'factory-service'))) {
154-
trigger_error(sprintf('The "%s" attribute in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use the "factory" element instead.', $key, $file), E_USER_DEPRECATED);
154+
@trigger_error(sprintf('The "%s" attribute in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use the "factory" element instead.', $key, $file), E_USER_DEPRECATED);
155155
}
156156
$method = 'set'.str_replace('-', '', $key);
157157
$definition->$method(XmlUtils::phpize($value));
@@ -162,7 +162,7 @@ private function parseDefinition(\DOMElement $service, $file)
162162
$triggerDeprecation = 'request' !== (string) $service->getAttribute('id');
163163

164164
if ($triggerDeprecation) {
165-
trigger_error(sprintf('The "synchronized" attribute in file "%s" is deprecated since version 2.7 and will be removed in 3.0.', $file), E_USER_DEPRECATED);
165+
@trigger_error(sprintf('The "synchronized" attribute in file "%s" is deprecated since version 2.7 and will be removed in 3.0.', $file), E_USER_DEPRECATED);
166166
}
167167

168168
$definition->setSynchronized(XmlUtils::phpize($value), $triggerDeprecation);

Loader/YamlFileLoader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private function parseDefinition($id, $service, $file)
172172
}
173173

174174
if (isset($service['synchronized'])) {
175-
trigger_error(sprintf('The "synchronized" key in file "%s" is deprecated since version 2.7 and will be removed in 3.0.', $file), E_USER_DEPRECATED);
175+
@trigger_error(sprintf('The "synchronized" key in file "%s" is deprecated since version 2.7 and will be removed in 3.0.', $file), E_USER_DEPRECATED);
176176
$definition->setSynchronized($service['synchronized'], 'request' !== $id);
177177
}
178178

@@ -202,17 +202,17 @@ private function parseDefinition($id, $service, $file)
202202
}
203203

204204
if (isset($service['factory_class'])) {
205-
trigger_error(sprintf('The "factory_class" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED);
205+
@trigger_error(sprintf('The "factory_class" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED);
206206
$definition->setFactoryClass($service['factory_class']);
207207
}
208208

209209
if (isset($service['factory_method'])) {
210-
trigger_error(sprintf('The "factory_method" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED);
210+
@trigger_error(sprintf('The "factory_method" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED);
211211
$definition->setFactoryMethod($service['factory_method']);
212212
}
213213

214214
if (isset($service['factory_service'])) {
215-
trigger_error(sprintf('The "factory_service" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED);
215+
@trigger_error(sprintf('The "factory_service" key in file "%s" is deprecated since version 2.6 and will be removed in 3.0. Use "factory" instead.', $file), E_USER_DEPRECATED);
216216
$definition->setFactoryService($service['factory_service']);
217217
}
218218

SimpleXMLElement.php

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

1212
namespace Symfony\Component\DependencyInjection;
1313

14-
trigger_error('The '.__NAMESPACE__.'\SimpleXMLElement method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\SimpleXMLElement method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
1515

1616
use Symfony\Component\Config\Util\XmlUtils;
1717
use Symfony\Component\ExpressionLanguage\Expression;

0 commit comments

Comments
 (0)