Security update for Core, with self-updated composer
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / NodeAbstract.php
index 62a96da118fea9b659e9416684b65ab38e3e95fb..1b757c7bc01dd15bc3c8a9ea916aea64b4cf4eff 100644 (file)
@@ -2,6 +2,8 @@
 
 namespace PhpParser;
 
+use PhpParser\Node;
+
 abstract class NodeAbstract implements Node, \JsonSerializable
 {
     protected $attributes;
@@ -21,7 +23,12 @@ abstract class NodeAbstract implements Node, \JsonSerializable
      * @return string Type of the node
      */
     public function getType() {
-        return strtr(substr(rtrim(get_class($this), '_'), 15), '\\', '_');
+        $className = rtrim(get_class($this), '_');
+        return strtr(
+            substr($className, strlen(Node::class) + 1),
+            '\\',
+            '_'
+        );
     }
 
     /**
@@ -37,6 +44,8 @@ abstract class NodeAbstract implements Node, \JsonSerializable
      * Sets line the node started in.
      *
      * @param int $line Line
+     *
+     * @deprecated
      */
     public function setLine($line) {
         $this->setAttribute('startLine', (int) $line);