minor #15004 [2.7] Fix unsilenced deprecation notices (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[2.7] Fix unsilenced deprecation notices

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

dae98e0 [2.7] Fix unsilenced deprecation notices
This commit is contained in:
Fabien Potencier 2015-06-16 23:37:16 +02:00
commit 450706fbb3
3 changed files with 6 additions and 6 deletions

View File

@ -179,7 +179,7 @@ class DebugClassLoader
}
if (in_array(strtolower($refl->getShortName()), self::$php7Reserved)) {
trigger_error(sprintf('%s uses a reserved class name (%s) that will break on PHP 7 and higher', $name, $refl->getShortName()), E_USER_DEPRECATED);
@trigger_error(sprintf('%s uses a reserved class name (%s) that will break on PHP 7 and higher', $name, $refl->getShortName()), E_USER_DEPRECATED);
} elseif (preg_match('#\n \* @deprecated (.*?)\r?\n \*(?: @|/$)#s', $refl->getDocComment(), $notice)) {
self::$deprecated[$name] = preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]);
} else {

View File

@ -91,7 +91,7 @@ class Logger implements LoggerInterface
*/
public function emerg($message, array $context = array())
{
trigger_error('Use emergency() which is PSR-3 compatible', E_USER_DEPRECATED);
@trigger_error('Use emergency() which is PSR-3 compatible', E_USER_DEPRECATED);
$this->log('emergency', $message, $context);
}
@ -101,7 +101,7 @@ class Logger implements LoggerInterface
*/
public function crit($message, array $context = array())
{
trigger_error('Use critical() which is PSR-3 compatible', E_USER_DEPRECATED);
@trigger_error('Use critical() which is PSR-3 compatible', E_USER_DEPRECATED);
$this->log('critical', $message, $context);
}
@ -111,7 +111,7 @@ class Logger implements LoggerInterface
*/
public function err($message, array $context = array())
{
trigger_error('Use error() which is PSR-3 compatible', E_USER_DEPRECATED);
@trigger_error('Use error() which is PSR-3 compatible', E_USER_DEPRECATED);
$this->log('error', $message, $context);
}
@ -121,7 +121,7 @@ class Logger implements LoggerInterface
*/
public function warn($message, array $context = array())
{
trigger_error('Use warning() which is PSR-3 compatible', E_USER_DEPRECATED);
@trigger_error('Use warning() which is PSR-3 compatible', E_USER_DEPRECATED);
$this->log('warning', $message, $context);
}

View File

@ -36,7 +36,7 @@ class UnexpectedTypeException extends RuntimeException
$path->getElement($pathIndex)
);
} else {
trigger_error('The '.__CLASS__.' constructor now expects 3 arguments: the invalid property value, the '.__NAMESPACE__.'\PropertyPathInterface object and the current index of the property path.', E_USER_DEPRECATED);
@trigger_error('The '.__CLASS__.' constructor now expects 3 arguments: the invalid property value, the '.__NAMESPACE__.'\PropertyPathInterface object and the current index of the property path.', E_USER_DEPRECATED);
$message = sprintf(
'Expected argument of type "%s", "%s" given',