From f4a3565344bcb24d8168cdb00ea946c471f9c269 Mon Sep 17 00:00:00 2001 From: Helmut Januschka Date: Sun, 7 Mar 2021 19:18:24 +0100 Subject: [PATCH] Update ClassUtils.php --- src/ClassUtils.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ClassUtils.php b/src/ClassUtils.php index 92941bf..5d70c22 100644 --- a/src/ClassUtils.php +++ b/src/ClassUtils.php @@ -34,7 +34,9 @@ public static function shortenClassFromCode($code, callable $callback = null) return static::shortenClassName($matches[1]); }; } - + if(is_null($code)) { + return ""; + } $codeParsed = \preg_replace_callback('@((?:\\\\{1,2}\w+|\w+\\\\{1,2})(?:\w+\\\\{0,2})+)@', $callback, $code); return $codeParsed;