diff vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php @ 13:5fb285c0d0e3

Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've been lucky to get away with this so far, as we don't support self-registration which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5 was vulnerable to.
author Chris Cannam
date Mon, 23 Apr 2018 09:33:26 +0100
parents 4c8ae668cc8c
children
line wrap: on
line diff
--- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php	Fri Feb 23 15:52:07 2018 +0000
+++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php	Mon Apr 23 09:33:26 2018 +0100
@@ -1,13 +1,17 @@
-<?php
+<?php declare(strict_types=1);
 
 namespace PhpParser\Node\Stmt;
 
 use PhpParser\Node;
 
-abstract class ClassLike extends Node\Stmt {
-    /** @var string|null Name */
+/**
+ * @property Node\Name $namespacedName Namespaced name (if using NameResolver)
+ */
+abstract class ClassLike extends Node\Stmt
+{
+    /** @var Node\Identifier|null Name */
     public $name;
-    /** @var Node[] Statements */
+    /** @var Node\Stmt[] Statements */
     public $stmts;
 
     /**
@@ -15,8 +19,8 @@
      *
      * @return ClassMethod[]
      */
-    public function getMethods() {
-        $methods = array();
+    public function getMethods() : array {
+        $methods = [];
         foreach ($this->stmts as $stmt) {
             if ($stmt instanceof ClassMethod) {
                 $methods[] = $stmt;
@@ -32,10 +36,10 @@
      *
      * @return ClassMethod|null Method node or null if the method does not exist
      */
-    public function getMethod($name) {
+    public function getMethod(string $name) {
         $lowerName = strtolower($name);
         foreach ($this->stmts as $stmt) {
-            if ($stmt instanceof ClassMethod && $lowerName === strtolower($stmt->name)) {
+            if ($stmt instanceof ClassMethod && $lowerName === $stmt->name->toLowerString()) {
                 return $stmt;
             }
         }