Mercurial > hg > isophonics-drupal-site
comparison 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 |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
37 } | 37 } |
38 | 38 |
39 public static function fromNewNode(Expr\New_ $newNode) { | 39 public static function fromNewNode(Expr\New_ $newNode) { |
40 $class = $newNode->class; | 40 $class = $newNode->class; |
41 assert($class instanceof Node\Stmt\Class_); | 41 assert($class instanceof Node\Stmt\Class_); |
42 assert($class->name === null); | 42 // We don't assert that $class->name is null here, to allow consumers to assign unique names |
43 // to anonymous classes for their own purposes. We simplify ignore the name here. | |
43 return new self( | 44 return new self( |
44 $newNode->args, $class->extends, $class->implements, | 45 $newNode->args, $class->extends, $class->implements, |
45 $class->stmts, $newNode->getAttributes() | 46 $class->stmts, $newNode->getAttributes() |
46 ); | 47 ); |
47 } | 48 } |