X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FError.php;h=1aa9733b5d44f348090092a16b4f777b92e89878;hb=697d73e0224dfa5611e40f6d01baabf60ca53318;hp=6b264a944efed8b884bbce210a371902a7a0d8c8;hpb=d6789d2374e9c49ad74d5cca6cda45baf9530742;p=civicrm-core.git diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 6b264a944e..1aa9733b5d 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -817,11 +817,11 @@ class CRM_Core_Error extends PEAR_ErrorStack { /** * Render an exception as HTML string. * - * @param Exception $e + * @param Throwable $e * @return string * printable HTML text */ - public static function formatHtmlException(Exception $e) { + public static function formatHtmlException(Throwable $e) { $msg = ''; // Exception metadata @@ -856,11 +856,11 @@ class CRM_Core_Error extends PEAR_ErrorStack { /** * Write details of an exception to the log. * - * @param Exception $e + * @param Throwable $e * @return string * printable plain text */ - public static function formatTextException(Exception $e) { + public static function formatTextException(Throwable $e) { $msg = get_class($e) . ": \"" . $e->getMessage() . "\"\n"; $ei = $e; @@ -1039,7 +1039,15 @@ class CRM_Core_Error extends PEAR_ErrorStack { $callerClass = $dbt[1]['class'] ?? NULL; $oldMethod = "{$callerClass}::{$callerFunction}"; } - Civi::log()->warning("Deprecated function $oldMethod, use $newMethod.", ['civi.tag' => 'deprecated']); + self::deprecatedWarning("Deprecated function $oldMethod, use $newMethod."); + } + + /** + * Output a deprecated notice about a deprecated call path, rather than deprecating a whole function. + * @param string $message + */ + public static function deprecatedWarning($message) { + Civi::log()->warning($message, ['civi.tag' => 'deprecated']); } }