diff vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 5fb285c0d0e3
children
line wrap: on
line diff
--- a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php	Thu Feb 28 13:21:36 2019 +0000
@@ -39,7 +39,8 @@
     public static function fromNewNode(Expr\New_ $newNode) {
         $class = $newNode->class;
         assert($class instanceof Node\Stmt\Class_);
-        assert($class->name === null);
+        // We don't assert that $class->name is null here, to allow consumers to assign unique names
+        // to anonymous classes for their own purposes. We simplify ignore the name here.
         return new self(
             $newNode->args, $class->extends, $class->implements,
             $class->stmts, $newNode->getAttributes()