Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Node / Scalar / LNumber.php
index 3559b982c30c39471b82b18ab076cb5f82573289..7b9ec5e959175dd7a335ebfc463c44e550db938d 100644 (file)
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
 
 namespace PhpParser\Node\Scalar;
 
@@ -22,13 +22,13 @@ class LNumber extends Scalar
      * @param int   $value      Value of the number
      * @param array $attributes Additional attributes
      */
-    public function __construct($value, array $attributes = array()) {
+    public function __construct(int $value, array $attributes = []) {
         parent::__construct($attributes);
         $this->value = $value;
     }
 
-    public function getSubNodeNames() {
-        return array('value');
+    public function getSubNodeNames() : array {
+        return ['value'];
     }
 
     /**
@@ -40,7 +40,7 @@ class LNumber extends Scalar
      *
      * @return LNumber The constructed LNumber, including kind attribute
      */
-    public static function fromString($str, array $attributes = array(), $allowInvalidOctal = false) {
+    public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = false) : LNumber {
         if ('0' !== $str[0] || '0' === $str) {
             $attributes['kind'] = LNumber::KIND_DEC;
             return new LNumber((int) $str, $attributes);
@@ -64,4 +64,8 @@ class LNumber extends Scalar
         $attributes['kind'] = LNumber::KIND_OCT;
         return new LNumber(intval($str, 8), $attributes);
     }
+    
+    public function getType() : string {
+        return 'Scalar_LNumber';
+    }
 }