[2.7] Fix unsilenced deprecation notices

This commit is contained in:
Nicolas Grekas 2015-06-16 15:26:24 +02:00
parent f88cfd15d9
commit dae98e0b27
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)) { 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)) { } elseif (preg_match('#\n \* @deprecated (.*?)\r?\n \*(?: @|/$)#s', $refl->getDocComment(), $notice)) {
self::$deprecated[$name] = preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]); self::$deprecated[$name] = preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]);
} else { } else {

View File

@ -91,7 +91,7 @@ class Logger implements LoggerInterface
*/ */
public function emerg($message, array $context = array()) 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); $this->log('emergency', $message, $context);
} }
@ -101,7 +101,7 @@ class Logger implements LoggerInterface
*/ */
public function crit($message, array $context = array()) 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); $this->log('critical', $message, $context);
} }
@ -111,7 +111,7 @@ class Logger implements LoggerInterface
*/ */
public function err($message, array $context = array()) 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); $this->log('error', $message, $context);
} }
@ -121,7 +121,7 @@ class Logger implements LoggerInterface
*/ */
public function warn($message, array $context = array()) 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); $this->log('warning', $message, $context);
} }

View File

@ -36,7 +36,7 @@ class UnexpectedTypeException extends RuntimeException
$path->getElement($pathIndex) $path->getElement($pathIndex)
); );
} else { } 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( $message = sprintf(
'Expected argument of type "%s", "%s" given', 'Expected argument of type "%s", "%s" given',