- $level = null === $level ? error_reporting() : $level;
- $this->throwAt($level, true);
- }
-
- /**
- * Sets the display_errors flag value.
- *
- * @param int $displayErrors The display_errors flag value
- *
- * @deprecated since version 2.6, to be removed in 3.0. Use throwAt() instead.
- */
- public function setDisplayErrors($displayErrors)
- {
- @trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the throwAt() method instead.', E_USER_DEPRECATED);
-
- if ($displayErrors) {
- $this->throwAt($this->displayErrors, true);
- } else {
- $displayErrors = $this->displayErrors;
- $this->throwAt(0, true);
- $this->displayErrors = $displayErrors;
- }
- }
-
- /**
- * Sets a logger for the given channel.
- *
- * @param LoggerInterface $logger A logger interface
- * @param string $channel The channel associated with the logger (deprecation, emergency or scream)
- *
- * @deprecated since version 2.6, to be removed in 3.0. Use setLoggers() or setDefaultLogger() instead.
- */
- public static function setLogger(LoggerInterface $logger, $channel = 'deprecation')
- {
- @trigger_error('The '.__METHOD__.' static method is deprecated since version 2.6 and will be removed in 3.0. Use the setLoggers() or setDefaultLogger() methods instead.', E_USER_DEPRECATED);
-
- $handler = set_error_handler('var_dump');
- $handler = is_array($handler) ? $handler[0] : null;
- restore_error_handler();
- if (!$handler instanceof self) {
- return;
- }
- if ('deprecation' === $channel) {
- $handler->setDefaultLogger($logger, E_DEPRECATED | E_USER_DEPRECATED, true);
- $handler->screamAt(E_DEPRECATED | E_USER_DEPRECATED);
- } elseif ('scream' === $channel) {
- $handler->setDefaultLogger($logger, E_ALL | E_STRICT, false);
- $handler->screamAt(E_ALL | E_STRICT);
- } elseif ('emergency' === $channel) {
- $handler->setDefaultLogger($logger, E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR, true);
- $handler->screamAt(E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR);