diff --git a/core/includes/errors.inc b/core/includes/errors.inc index d1b9d16..82e6ebb 100644 --- a/core/includes/errors.inc +++ b/core/includes/errors.inc @@ -347,6 +347,10 @@ function format_backtrace(array $backtrace) { else { $call['function'] = 'main'; } + // Args should never be empty, but it might be if a class method had a + // typed parameter, but the use part was not added. Thus, the type of the + // parameter would be "unknown" and the class autoloader would have empty + // args. if (!empty($trace['args'])) { foreach ($trace['args'] as $arg) { if (is_scalar($arg)) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Error/FormatBacktraceUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Error/FormatBacktraceUnitTest.php index 7eb156d..9b05909 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Error/FormatBacktraceUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Error/FormatBacktraceUnitTest.php @@ -2,7 +2,7 @@ /** * @file - * Definition of Drupal\system\Tests\Common\ValidNumberStepUnitTest. + * Contains \Drupal\system\Tests\Common\ValidNumberStepUnitTest. */ namespace Drupal\system\Tests\Error; @@ -13,6 +13,7 @@ * Tests backtrace formatting by format_backtrace(). */ class FormatBacktraceUnitTest extends UnitTestBase { + public static function getInfo() { return array( 'name' => 'Format Backtrace validation', @@ -64,4 +65,5 @@ function() // Compare to the given format. $this->assertEqual(format_backtrace($backtrace), $result); } + }