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:
commit
450706fbb3
@ -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 {
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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',
|
||||||
|
Reference in New Issue
Block a user