Skip to content

Instantly share code, notes, and snippets.

@nikic

nikic/types.diff Secret

Created March 24, 2015 10:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikic/1521a879b97f0d40d79e to your computer and use it in GitHub Desktop.
Save nikic/1521a879b97f0d40d79e to your computer and use it in GitHub Desktop.
diff --git a/lib/PhpParser/Autoloader.php b/lib/PhpParser/Autoloader.php
index dc5a809..c950a6e 100644
--- a/lib/PhpParser/Autoloader.php
+++ b/lib/PhpParser/Autoloader.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -18,7 +18,7 @@ class Autoloader
*
* @param bool $prepend Whether to prepend the autoloader instead of appending
*/
- static public function register($prepend = false) {
+ static public function register(bool $prepend = false) {
if (self::$registered === true) {
return;
}
@@ -34,7 +34,7 @@ class Autoloader
*
* @param string $class A class name.
*/
- static public function autoload($class) {
+ static public function autoload(string $class) {
if (0 === strpos($class, 'PhpParser\\')) {
if (isset(self::$php7CompatAliases[$class])) {
if (!self::$runningOnPhp7) {
diff --git a/lib/PhpParser/Builder.php b/lib/PhpParser/Builder.php
index 95655e8..2680ef2 100644
--- a/lib/PhpParser/Builder.php
+++ b/lib/PhpParser/Builder.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -9,5 +9,5 @@ interface Builder
*
* @return Node The built node
*/
- public function getNode();
+ public function getNode() : \PhpParser\Node;
}
\ No newline at end of file
diff --git a/lib/PhpParser/Builder/Class_.php b/lib/PhpParser/Builder/Class_.php
index c247787..a0f3fb3 100644
--- a/lib/PhpParser/Builder/Class_.php
+++ b/lib/PhpParser/Builder/Class_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
@@ -24,7 +24,7 @@ class Class_ extends Declaration
*
* @param string $name Name of the class
*/
- public function __construct($name) {
+ public function __construct(string $name) {
$this->name = $name;
}
@@ -111,7 +111,7 @@ class Class_ extends Declaration
*
* @return Stmt\Class_ The built class node
*/
- public function getNode() {
+ public function getNode() : \PhpParser\Node {
return new Stmt\Class_($this->name, array(
'type' => $this->type,
'extends' => $this->extends,
diff --git a/lib/PhpParser/Builder/Declaration.php b/lib/PhpParser/Builder/Declaration.php
index f6a322c..376624c 100644
--- a/lib/PhpParser/Builder/Declaration.php
+++ b/lib/PhpParser/Builder/Declaration.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
diff --git a/lib/PhpParser/Builder/FunctionLike.php b/lib/PhpParser/Builder/FunctionLike.php
index 35646a3..83c4dd6 100644
--- a/lib/PhpParser/Builder/FunctionLike.php
+++ b/lib/PhpParser/Builder/FunctionLike.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
diff --git a/lib/PhpParser/Builder/Function_.php b/lib/PhpParser/Builder/Function_.php
index 374f315..bb20aa5 100644
--- a/lib/PhpParser/Builder/Function_.php
+++ b/lib/PhpParser/Builder/Function_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
@@ -16,7 +16,7 @@ class Function_ extends FunctionLike
*
* @param string $name Name of the function
*/
- public function __construct($name) {
+ public function __construct(string $name) {
$this->name = $name;
}
@@ -38,7 +38,7 @@ class Function_ extends FunctionLike
*
* @return Stmt\Function_ The built function node
*/
- public function getNode() {
+ public function getNode() : \PhpParser\Node {
return new Stmt\Function_($this->name, array(
'byRef' => $this->returnByRef,
'params' => $this->params,
diff --git a/lib/PhpParser/Builder/Interface_.php b/lib/PhpParser/Builder/Interface_.php
index 18afaaa..25f3835 100644
--- a/lib/PhpParser/Builder/Interface_.php
+++ b/lib/PhpParser/Builder/Interface_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
@@ -18,7 +18,7 @@ class Interface_ extends Declaration
*
* @param string $name Name of the interface
*/
- public function __construct($name) {
+ public function __construct(string $name) {
$this->name = $name;
}
@@ -72,7 +72,7 @@ class Interface_ extends Declaration
*
* @return Stmt\Interface_ The built interface node
*/
- public function getNode() {
+ public function getNode() : \PhpParser\Node {
return new Stmt\Interface_($this->name, array(
'extends' => $this->extends,
'stmts' => array_merge($this->constants, $this->methods),
diff --git a/lib/PhpParser/Builder/Method.php b/lib/PhpParser/Builder/Method.php
index 60dd4b9..3e44c04 100644
--- a/lib/PhpParser/Builder/Method.php
+++ b/lib/PhpParser/Builder/Method.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
@@ -17,7 +17,7 @@ class Method extends FunctionLike
*
* @param string $name Name of the method
*/
- public function __construct($name) {
+ public function __construct(string $name) {
$this->name = $name;
}
@@ -114,7 +114,7 @@ class Method extends FunctionLike
*
* @return Stmt\ClassMethod The built method node
*/
- public function getNode() {
+ public function getNode() : \PhpParser\Node {
return new Stmt\ClassMethod($this->name, array(
'type' => $this->type,
'byRef' => $this->returnByRef,
diff --git a/lib/PhpParser/Builder/Namespace_.php b/lib/PhpParser/Builder/Namespace_.php
index 432fcc7..a5ad149 100644
--- a/lib/PhpParser/Builder/Namespace_.php
+++ b/lib/PhpParser/Builder/Namespace_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
@@ -53,7 +53,7 @@ class Namespace_ extends PhpParser\BuilderAbstract
*
* @return Node The built node
*/
- public function getNode() {
+ public function getNode() : \PhpParser\Node {
return new Stmt\Namespace_($this->name, $this->stmts);
}
}
diff --git a/lib/PhpParser/Builder/Param.php b/lib/PhpParser/Builder/Param.php
index af910c2..ed65e93 100644
--- a/lib/PhpParser/Builder/Param.php
+++ b/lib/PhpParser/Builder/Param.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
@@ -18,7 +18,7 @@ class Param extends PhpParser\BuilderAbstract
*
* @param string $name Name of the parameter
*/
- public function __construct($name) {
+ public function __construct(string $name) {
$this->name = $name;
}
@@ -68,7 +68,7 @@ class Param extends PhpParser\BuilderAbstract
*
* @return Node\Param The built parameter node
*/
- public function getNode() {
+ public function getNode() : \PhpParser\Node {
return new Node\Param(
$this->name, $this->default, $this->type, $this->byRef
);
diff --git a/lib/PhpParser/Builder/Property.php b/lib/PhpParser/Builder/Property.php
index 2d59d4c..97fde28 100644
--- a/lib/PhpParser/Builder/Property.php
+++ b/lib/PhpParser/Builder/Property.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
@@ -18,7 +18,7 @@ class Property extends PhpParser\BuilderAbstract
*
* @param string $name Name of the property
*/
- public function __construct($name) {
+ public function __construct(string $name) {
$this->name = $name;
}
@@ -99,7 +99,7 @@ class Property extends PhpParser\BuilderAbstract
*
* @return Stmt\Property The built property node
*/
- public function getNode() {
+ public function getNode() : \PhpParser\Node {
return new Stmt\Property(
$this->type !== 0 ? $this->type : Stmt\Class_::MODIFIER_PUBLIC,
array(
diff --git a/lib/PhpParser/Builder/Trait_.php b/lib/PhpParser/Builder/Trait_.php
index a1953ce..baf4bf6 100644
--- a/lib/PhpParser/Builder/Trait_.php
+++ b/lib/PhpParser/Builder/Trait_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
@@ -16,7 +16,7 @@ class Trait_ extends Declaration
*
* @param string $name Name of the interface
*/
- public function __construct($name) {
+ public function __construct(string $name) {
$this->name = $name;
}
@@ -43,7 +43,7 @@ class Trait_ extends Declaration
*
* @return Stmt\Trait_ The built interface node
*/
- public function getNode() {
+ public function getNode() : \PhpParser\Node {
return new Stmt\Trait_($this->name, $this->methods, $this->attributes);
}
}
diff --git a/lib/PhpParser/Builder/Use_.php b/lib/PhpParser/Builder/Use_.php
index 9999d0a..39492a6 100644
--- a/lib/PhpParser/Builder/Use_.php
+++ b/lib/PhpParser/Builder/Use_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
@@ -20,7 +20,7 @@ class Use_ extends BuilderAbstract {
* @param Node\Name|string $name Name of the entity (namespace, class, function, constant) to alias
* @param int $type One of the Stmt\Use_::TYPE_* constants
*/
- public function __construct($name, $type) {
+ public function __construct($name, int $type) {
$this->name = $this->normalizeName($name);
$this->type = $type;
}
@@ -32,7 +32,7 @@ class Use_ extends BuilderAbstract {
*
* @return $this The builder instance (for fluid interface)
*/
- protected function as_($alias) {
+ protected function as_(string $alias) {
$this->alias = $alias;
return $this;
}
@@ -45,7 +45,7 @@ class Use_ extends BuilderAbstract {
*
* @return Node The built node
*/
- public function getNode() {
+ public function getNode() : \PhpParser\Node {
$alias = null !== $this->alias ? $this->alias : $this->name->getLast();
return new Stmt\Use_(array(
new Stmt\UseUse($this->name, $alias)
diff --git a/lib/PhpParser/BuilderAbstract.php b/lib/PhpParser/BuilderAbstract.php
index 626bedd..2013a82 100644
--- a/lib/PhpParser/BuilderAbstract.php
+++ b/lib/PhpParser/BuilderAbstract.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -16,7 +16,7 @@ abstract class BuilderAbstract implements Builder {
*
* @return Node The normalized node
*/
- protected function normalizeNode($node) {
+ protected function normalizeNode($node) : \PhpParser\Node {
if ($node instanceof Builder) {
return $node->getNode();
} elseif ($node instanceof Node) {
@@ -33,7 +33,7 @@ abstract class BuilderAbstract implements Builder {
*
* @return Name The normalized name
*/
- protected function normalizeName($name) {
+ protected function normalizeName($name) : \PhpParser\Node\Name {
if ($name instanceof Name) {
return $name;
} elseif (is_string($name)) {
@@ -61,7 +61,7 @@ abstract class BuilderAbstract implements Builder {
*
* @return Expr The normalized value
*/
- protected function normalizeValue($value) {
+ protected function normalizeValue($value) : \PhpParser\Node\Expr {
if ($value instanceof Node) {
return $value;
} elseif (is_null($value)) {
@@ -124,7 +124,7 @@ abstract class BuilderAbstract implements Builder {
*
* @param int $modifier Modifier to set
*/
- protected function setModifier($modifier) {
+ protected function setModifier(int $modifier) {
Stmt\Class_::verifyModifier($this->type, $modifier);
$this->type |= $modifier;
}
diff --git a/lib/PhpParser/BuilderFactory.php b/lib/PhpParser/BuilderFactory.php
index 99c4baf..32a27e2 100644
--- a/lib/PhpParser/BuilderFactory.php
+++ b/lib/PhpParser/BuilderFactory.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -36,7 +36,7 @@ class BuilderFactory
*
* @return Builder\Class_ The created class builder
*/
- protected function _class($name) {
+ protected function _class(string $name) {
return new Builder\Class_($name);
}
@@ -47,7 +47,7 @@ class BuilderFactory
*
* @return Builder\Interface_ The created interface builder
*/
- protected function _interface($name) {
+ protected function _interface(string $name) {
return new Builder\Interface_($name);
}
@@ -58,7 +58,7 @@ class BuilderFactory
*
* @return Builder\Trait_ The created trait builder
*/
- protected function _trait($name) {
+ protected function _trait(string $name) {
return new Builder\Trait_($name);
}
@@ -69,7 +69,7 @@ class BuilderFactory
*
* @return Builder\Method The created method builder
*/
- public function method($name) {
+ public function method(string $name) {
return new Builder\Method($name);
}
@@ -80,7 +80,7 @@ class BuilderFactory
*
* @return Builder\Param The created parameter builder
*/
- public function param($name) {
+ public function param(string $name) {
return new Builder\Param($name);
}
@@ -91,7 +91,7 @@ class BuilderFactory
*
* @return Builder\Property The created property builder
*/
- public function property($name) {
+ public function property(string $name) {
return new Builder\Property($name);
}
@@ -102,7 +102,7 @@ class BuilderFactory
*
* @return Builder\Function_ The created function builder
*/
- protected function _function($name) {
+ protected function _function(string $name) {
return new Builder\Function_($name);
}
diff --git a/lib/PhpParser/Comment.php b/lib/PhpParser/Comment.php
index 128d02e..b95f787 100644
--- a/lib/PhpParser/Comment.php
+++ b/lib/PhpParser/Comment.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -13,7 +13,7 @@ class Comment
* @param string $text Comment text (including comment delimiters like /*)
* @param int $line Line number the comment started on
*/
- public function __construct($text, $line = -1) {
+ public function __construct(string $text, int $line = -1) {
$this->text = $text;
$this->line = $line;
}
@@ -23,7 +23,7 @@ class Comment
*
* @return string The comment text (including comment delimiters like /*)
*/
- public function getText() {
+ public function getText() : string {
return $this->text;
}
@@ -32,7 +32,7 @@ class Comment
*
* @param string $text The comment text (including comment delimiters like /*)
*/
- public function setText($text) {
+ public function setText(string $text) {
$this->text = $text;
}
@@ -41,7 +41,7 @@ class Comment
*
* @return int Line number
*/
- public function getLine() {
+ public function getLine() : int {
return $this->line;
}
@@ -50,7 +50,7 @@ class Comment
*
* @param int $line Line number
*/
- public function setLine($line) {
+ public function setLine(int $line) {
$this->line = $line;
}
@@ -59,7 +59,7 @@ class Comment
*
* @return string The comment text (including comment delimiters like /*)
*/
- public function __toString() {
+ public function __toString() : string {
return $this->text;
}
diff --git a/lib/PhpParser/Comment/Doc.php b/lib/PhpParser/Comment/Doc.php
index 24fc6c9..6532a39 100644
--- a/lib/PhpParser/Comment/Doc.php
+++ b/lib/PhpParser/Comment/Doc.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Comment;
diff --git a/lib/PhpParser/Error.php b/lib/PhpParser/Error.php
index 619377d..b9a7131 100644
--- a/lib/PhpParser/Error.php
+++ b/lib/PhpParser/Error.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -13,7 +13,7 @@ class Error extends \RuntimeException
* @param string $message Error message
* @param int $line Error line in PHP file
*/
- public function __construct($message, $line = -1) {
+ public function __construct(string $message, int $line = -1) {
$this->rawMessage = (string) $message;
$this->rawLine = (int) $line;
$this->updateMessage();
@@ -24,7 +24,7 @@ class Error extends \RuntimeException
*
* @return string Error message
*/
- public function getRawMessage() {
+ public function getRawMessage() : string {
return $this->rawMessage;
}
@@ -33,7 +33,7 @@ class Error extends \RuntimeException
*
* @param string $message Error message
*/
- public function setRawMessage($message) {
+ public function setRawMessage(string $message) {
$this->rawMessage = (string) $message;
$this->updateMessage();
}
@@ -43,7 +43,7 @@ class Error extends \RuntimeException
*
* @return int Error line in the PHP file
*/
- public function getRawLine() {
+ public function getRawLine() : int {
return $this->rawLine;
}
@@ -52,7 +52,7 @@ class Error extends \RuntimeException
*
* @param int $line Error line in the PHP file
*/
- public function setRawLine($line) {
+ public function setRawLine(int $line) {
$this->rawLine = (int) $line;
$this->updateMessage();
}
diff --git a/lib/PhpParser/Lexer.php b/lib/PhpParser/Lexer.php
index 2a99a3c..de2baa7 100644
--- a/lib/PhpParser/Lexer.php
+++ b/lib/PhpParser/Lexer.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -47,7 +47,7 @@ class Lexer
*
* @throws Error on lexing errors (unterminated comment or unexpected character)
*/
- public function startLexing($code) {
+ public function startLexing(string $code) {
$scream = ini_set('xdebug.scream', '0');
$this->resetErrors();
@@ -119,7 +119,7 @@ class Lexer
*
* @return int Token id
*/
- public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) {
+ public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) : int {
$startAttributes = array();
$endAttributes = array();
@@ -208,7 +208,7 @@ class Lexer
*
* @return array Array of tokens in token_get_all() format
*/
- public function getTokens() {
+ public function getTokens() : array {
return $this->tokens;
}
@@ -217,7 +217,7 @@ class Lexer
*
* @return string Remaining text
*/
- public function handleHaltCompiler() {
+ public function handleHaltCompiler() : string {
// get the length of the text before the T_HALT_COMPILER token
$textBefore = '';
for ($i = 0; $i <= $this->pos; ++$i) {
@@ -254,7 +254,7 @@ class Lexer
*
* @return array The token map
*/
- protected function createTokenMap() {
+ protected function createTokenMap() : array {
$tokenMap = array();
// 256 is the minimum possible token number, as everything below
diff --git a/lib/PhpParser/Lexer/Emulative.php b/lib/PhpParser/Lexer/Emulative.php
index 7cf2773..da4a0c4 100644
--- a/lib/PhpParser/Lexer/Emulative.php
+++ b/lib/PhpParser/Lexer/Emulative.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Lexer;
@@ -62,7 +62,7 @@ class Emulative extends \PhpParser\Lexer
$this->tokenMap[self::T_POW_EQUAL] = Parser::T_POW_EQUAL;
}
- public function startLexing($code) {
+ public function startLexing(string $code) {
$this->inObjectAccess = false;
$preprocessedCode = $this->preprocessCode($code);
@@ -193,7 +193,7 @@ class Emulative extends \PhpParser\Lexer
}
}
- public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) {
+ public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) : int {
$token = parent::getNextToken($value, $startAttributes, $endAttributes);
// replace new keywords by their respective tokens. This is not done
diff --git a/lib/PhpParser/Node.php b/lib/PhpParser/Node.php
index a28ccc1..d7d238e 100644
--- a/lib/PhpParser/Node.php
+++ b/lib/PhpParser/Node.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -9,28 +9,28 @@ interface Node
*
* @return string Type of the node
*/
- public function getType();
+ public function getType() : string;
/**
* Gets the names of the sub nodes.
*
* @return array Names of sub nodes
*/
- public function getSubNodeNames();
+ public function getSubNodeNames() : array;
/**
* Gets line the node started in.
*
* @return int Line
*/
- public function getLine();
+ public function getLine() : int;
/**
* Sets line the node started in.
*
* @param int $line Line
*/
- public function setLine($line);
+ public function setLine(int $line);
/**
* Gets the doc comment of the node.
@@ -47,7 +47,7 @@ interface Node
* @param string $key
* @param mixed $value
*/
- public function setAttribute($key, $value);
+ public function setAttribute(string $key, $value);
/**
* Returns whether an attribute exists.
@@ -56,7 +56,7 @@ interface Node
*
* @return bool
*/
- public function hasAttribute($key);
+ public function hasAttribute(string $key) : bool;
/**
* Returns the value of an attribute.
@@ -66,12 +66,12 @@ interface Node
*
* @return mixed
*/
- public function &getAttribute($key, $default = null);
+ public function &getAttribute(string $key, $default = null);
/**
* Returns all attributes for the given node.
*
* @return array
*/
- public function getAttributes();
+ public function getAttributes() : array;
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Arg.php b/lib/PhpParser/Node/Arg.php
index c61db13..fd84764 100644
--- a/lib/PhpParser/Node/Arg.php
+++ b/lib/PhpParser/Node/Arg.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node;
@@ -21,14 +21,14 @@ class Arg extends NodeAbstract
* @param bool $unpack Whether to unpack the argument
* @param array $attributes Additional attributes
*/
- public function __construct(Expr $value, $byRef = false, $unpack = false, array $attributes = array()) {
+ public function __construct(Expr $value, bool $byRef = false, bool $unpack = false, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->value = $value;
$this->byRef = $byRef;
$this->unpack = $unpack;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('value', 'byRef', 'unpack');
}
}
diff --git a/lib/PhpParser/Node/Const_.php b/lib/PhpParser/Node/Const_.php
index f6fcf65..24df05a 100644
--- a/lib/PhpParser/Node/Const_.php
+++ b/lib/PhpParser/Node/Const_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node;
@@ -18,13 +18,13 @@ class Const_ extends NodeAbstract
* @param Expr $value Value
* @param array $attributes Additional attributes
*/
- public function __construct($name, Expr $value, array $attributes = array()) {
+ public function __construct(string $name, Expr $value, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->name = $name;
$this->value = $value;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name', 'value');
}
}
diff --git a/lib/PhpParser/Node/Expr.php b/lib/PhpParser/Node/Expr.php
index 2dae5bf..7f128a0 100644
--- a/lib/PhpParser/Node/Expr.php
+++ b/lib/PhpParser/Node/Expr.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node;
diff --git a/lib/PhpParser/Node/Expr/ArrayDimFetch.php b/lib/PhpParser/Node/Expr/ArrayDimFetch.php
index 0c53d76..b04d39a 100644
--- a/lib/PhpParser/Node/Expr/ArrayDimFetch.php
+++ b/lib/PhpParser/Node/Expr/ArrayDimFetch.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -24,7 +24,7 @@ class ArrayDimFetch extends Expr
$this->dim = $dim;
}
- public function getSubnodeNames() {
+ public function getSubnodeNames() : array {
return array('var', 'dim');
}
}
diff --git a/lib/PhpParser/Node/Expr/ArrayItem.php b/lib/PhpParser/Node/Expr/ArrayItem.php
index 8999b5f..79b4e86 100644
--- a/lib/PhpParser/Node/Expr/ArrayItem.php
+++ b/lib/PhpParser/Node/Expr/ArrayItem.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -21,14 +21,14 @@ class ArrayItem extends Expr
* @param bool $byRef Whether to assign by reference
* @param array $attributes Additional attributes
*/
- public function __construct(Expr $value, Expr $key = null, $byRef = false, array $attributes = array()) {
+ public function __construct(Expr $value, Expr $key = null, bool $byRef = false, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->key = $key;
$this->value = $value;
$this->byRef = $byRef;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('key', 'value', 'byRef');
}
}
diff --git a/lib/PhpParser/Node/Expr/Array_.php b/lib/PhpParser/Node/Expr/Array_.php
index 0385fe2..8cd501d 100644
--- a/lib/PhpParser/Node/Expr/Array_.php
+++ b/lib/PhpParser/Node/Expr/Array_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class Array_ extends Expr
$this->items = $items;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('items');
}
}
diff --git a/lib/PhpParser/Node/Expr/Assign.php b/lib/PhpParser/Node/Expr/Assign.php
index ef16f8e..80ad36e 100644
--- a/lib/PhpParser/Node/Expr/Assign.php
+++ b/lib/PhpParser/Node/Expr/Assign.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -24,7 +24,7 @@ class Assign extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('var', 'expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/AssignOp.php b/lib/PhpParser/Node/Expr/AssignOp.php
index 54653ff..273c66f 100644
--- a/lib/PhpParser/Node/Expr/AssignOp.php
+++ b/lib/PhpParser/Node/Expr/AssignOp.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -28,7 +28,7 @@ abstract class AssignOp extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('var', 'expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php b/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php
index 9e3ed82..29ce15f 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php b/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php
index a9fd4e9..75115bd 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php b/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php
index aabe552..a20f5d8 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/Concat.php b/lib/PhpParser/Node/Expr/AssignOp/Concat.php
index 215445d..0006328 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/Concat.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/Concat.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/Div.php b/lib/PhpParser/Node/Expr/AssignOp/Div.php
index 87893bb..298357c 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/Div.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/Div.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/Minus.php b/lib/PhpParser/Node/Expr/AssignOp/Minus.php
index 32cad52..b5c521b 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/Minus.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/Minus.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/Mod.php b/lib/PhpParser/Node/Expr/AssignOp/Mod.php
index a0a1571..1c58950 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/Mod.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/Mod.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/Mul.php b/lib/PhpParser/Node/Expr/AssignOp/Mul.php
index 88c582b..daf2bf1 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/Mul.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/Mul.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/Plus.php b/lib/PhpParser/Node/Expr/AssignOp/Plus.php
index bd4d77e..09acecb 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/Plus.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/Plus.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/Pow.php b/lib/PhpParser/Node/Expr/AssignOp/Pow.php
index b5e5d98..c056e25 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/Pow.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/Pow.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php b/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php
index 84b2d56..d9e6be0 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php b/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php
index 0c8e237..c2e32c1 100644
--- a/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php
+++ b/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\AssignOp;
diff --git a/lib/PhpParser/Node/Expr/AssignRef.php b/lib/PhpParser/Node/Expr/AssignRef.php
index bd2915c..771fd36 100644
--- a/lib/PhpParser/Node/Expr/AssignRef.php
+++ b/lib/PhpParser/Node/Expr/AssignRef.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -28,7 +28,7 @@ class AssignRef extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('var', 'expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/BinaryOp.php b/lib/PhpParser/Node/Expr/BinaryOp.php
index d8a7e25..55251ce 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -24,7 +24,7 @@ abstract class BinaryOp extends Expr
$this->right = $right;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('left', 'right');
}
}
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php b/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php
index bd6c5c1..a3b3986 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php b/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php
index aa0f114..1b5a76a 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php b/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php
index ce951d0..f1a0d13 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php b/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php
index 0671f33..5040e9d 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php b/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php
index 22d743f..b93570d 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php b/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php
index 55c2379..e8f84cb 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Concat.php b/lib/PhpParser/Node/Expr/BinaryOp/Concat.php
index f65dfa5..09652a4 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Concat.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Concat.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Div.php b/lib/PhpParser/Node/Expr/BinaryOp/Div.php
index 78d7f44..f0a0850 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Div.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Div.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Equal.php b/lib/PhpParser/Node/Expr/BinaryOp/Equal.php
index d9cb204..4be5e1f 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Equal.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Equal.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Greater.php b/lib/PhpParser/Node/Expr/BinaryOp/Greater.php
index 2f53a99..6c7ec0b 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Greater.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Greater.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php b/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php
index 9bd93a1..86cfd6d 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Identical.php b/lib/PhpParser/Node/Expr/BinaryOp/Identical.php
index 9562680..e57ee9f 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Identical.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Identical.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php b/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php
index 5e8bae0..9286829 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php b/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php
index da92f80..8aa4fda 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php b/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php
index 5fa9652..296cd4f 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Minus.php b/lib/PhpParser/Node/Expr/BinaryOp/Minus.php
index 4a3b117..c9996bd 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Minus.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Minus.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Mod.php b/lib/PhpParser/Node/Expr/BinaryOp/Mod.php
index 0b10669..20fd16d 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Mod.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Mod.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Mul.php b/lib/PhpParser/Node/Expr/BinaryOp/Mul.php
index 2338d0b..5cdd457 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Mul.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Mul.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php b/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php
index c205ee2..a55e90e 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php b/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php
index b7682d7..77a195e 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Plus.php b/lib/PhpParser/Node/Expr/BinaryOp/Plus.php
index 4025e63..c9a7dd9 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Plus.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Plus.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Pow.php b/lib/PhpParser/Node/Expr/BinaryOp/Pow.php
index 007b6cb..0886f90 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Pow.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Pow.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php b/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php
index 398ec0b..df1d836 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php b/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php
index 6f98db8..c61b620 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php b/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php
index ba2c28b..cd30607 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php b/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php
index ebb1911..ee50c90 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php b/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php
index f6a97ca..2b004c3 100644
--- a/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php
+++ b/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\BinaryOp;
diff --git a/lib/PhpParser/Node/Expr/BitwiseNot.php b/lib/PhpParser/Node/Expr/BitwiseNot.php
index d85f581..72bd839 100644
--- a/lib/PhpParser/Node/Expr/BitwiseNot.php
+++ b/lib/PhpParser/Node/Expr/BitwiseNot.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class BitwiseNot extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/BooleanNot.php b/lib/PhpParser/Node/Expr/BooleanNot.php
index 2706a50..1942079 100644
--- a/lib/PhpParser/Node/Expr/BooleanNot.php
+++ b/lib/PhpParser/Node/Expr/BooleanNot.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class BooleanNot extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/Cast.php b/lib/PhpParser/Node/Expr/Cast.php
index 13772e4..7b80926 100644
--- a/lib/PhpParser/Node/Expr/Cast.php
+++ b/lib/PhpParser/Node/Expr/Cast.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ abstract class Cast extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/Cast/Array_.php b/lib/PhpParser/Node/Expr/Cast/Array_.php
index 08b3a38..92c03c0 100644
--- a/lib/PhpParser/Node/Expr/Cast/Array_.php
+++ b/lib/PhpParser/Node/Expr/Cast/Array_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
diff --git a/lib/PhpParser/Node/Expr/Cast/Bool_.php b/lib/PhpParser/Node/Expr/Cast/Bool_.php
index 4a1bd8f..e360528 100644
--- a/lib/PhpParser/Node/Expr/Cast/Bool_.php
+++ b/lib/PhpParser/Node/Expr/Cast/Bool_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
diff --git a/lib/PhpParser/Node/Expr/Cast/Double.php b/lib/PhpParser/Node/Expr/Cast/Double.php
index eede472..dd2df7c 100644
--- a/lib/PhpParser/Node/Expr/Cast/Double.php
+++ b/lib/PhpParser/Node/Expr/Cast/Double.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
diff --git a/lib/PhpParser/Node/Expr/Cast/Int_.php b/lib/PhpParser/Node/Expr/Cast/Int_.php
index 02a7327..30ac797 100644
--- a/lib/PhpParser/Node/Expr/Cast/Int_.php
+++ b/lib/PhpParser/Node/Expr/Cast/Int_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
diff --git a/lib/PhpParser/Node/Expr/Cast/Object_.php b/lib/PhpParser/Node/Expr/Cast/Object_.php
index 4e9d74f..76c5ea7 100644
--- a/lib/PhpParser/Node/Expr/Cast/Object_.php
+++ b/lib/PhpParser/Node/Expr/Cast/Object_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
diff --git a/lib/PhpParser/Node/Expr/Cast/String_.php b/lib/PhpParser/Node/Expr/Cast/String_.php
index 7c648db..ef304a8 100644
--- a/lib/PhpParser/Node/Expr/Cast/String_.php
+++ b/lib/PhpParser/Node/Expr/Cast/String_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
diff --git a/lib/PhpParser/Node/Expr/Cast/Unset_.php b/lib/PhpParser/Node/Expr/Cast/Unset_.php
index 5cfd3ef..928fc1a 100644
--- a/lib/PhpParser/Node/Expr/Cast/Unset_.php
+++ b/lib/PhpParser/Node/Expr/Cast/Unset_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr\Cast;
diff --git a/lib/PhpParser/Node/Expr/ClassConstFetch.php b/lib/PhpParser/Node/Expr/ClassConstFetch.php
index 3540c90..3099b40 100644
--- a/lib/PhpParser/Node/Expr/ClassConstFetch.php
+++ b/lib/PhpParser/Node/Expr/ClassConstFetch.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -19,13 +19,13 @@ class ClassConstFetch extends Expr
* @param string $name Constant name
* @param array $attributes Additional attributes
*/
- public function __construct($class, $name, array $attributes = array()) {
+ public function __construct($class, string $name, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->class = $class;
$this->name = $name;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('class', 'name');
}
}
diff --git a/lib/PhpParser/Node/Expr/Clone_.php b/lib/PhpParser/Node/Expr/Clone_.php
index 1bfab2e..841964e 100644
--- a/lib/PhpParser/Node/Expr/Clone_.php
+++ b/lib/PhpParser/Node/Expr/Clone_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class Clone_ extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/Closure.php b/lib/PhpParser/Node/Expr/Closure.php
index f8ace6b..3c8eaa5 100644
--- a/lib/PhpParser/Node/Expr/Closure.php
+++ b/lib/PhpParser/Node/Expr/Closure.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -42,7 +42,7 @@ class Closure extends Expr
$this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('static', 'byRef', 'params', 'uses', 'returnType', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Expr/ClosureUse.php b/lib/PhpParser/Node/Expr/ClosureUse.php
index 6669127..2aac10f 100644
--- a/lib/PhpParser/Node/Expr/ClosureUse.php
+++ b/lib/PhpParser/Node/Expr/ClosureUse.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -18,13 +18,13 @@ class ClosureUse extends Expr
* @param bool $byRef Whether to use by reference
* @param array $attributes Additional attributes
*/
- public function __construct($var, $byRef = false, array $attributes = array()) {
+ public function __construct(string $var, bool $byRef = false, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->var = $var;
$this->byRef = $byRef;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('var', 'byRef');
}
}
diff --git a/lib/PhpParser/Node/Expr/ConstFetch.php b/lib/PhpParser/Node/Expr/ConstFetch.php
index 4604a32..d7b5f8e 100644
--- a/lib/PhpParser/Node/Expr/ConstFetch.php
+++ b/lib/PhpParser/Node/Expr/ConstFetch.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -21,7 +21,7 @@ class ConstFetch extends Expr
$this->name = $name;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name');
}
}
diff --git a/lib/PhpParser/Node/Expr/Empty_.php b/lib/PhpParser/Node/Expr/Empty_.php
index a2503df..c28986c 100644
--- a/lib/PhpParser/Node/Expr/Empty_.php
+++ b/lib/PhpParser/Node/Expr/Empty_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class Empty_ extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/ErrorSuppress.php b/lib/PhpParser/Node/Expr/ErrorSuppress.php
index b55cc50..0d1861f 100644
--- a/lib/PhpParser/Node/Expr/ErrorSuppress.php
+++ b/lib/PhpParser/Node/Expr/ErrorSuppress.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class ErrorSuppress extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/Eval_.php b/lib/PhpParser/Node/Expr/Eval_.php
index cb977c2..223cc91 100644
--- a/lib/PhpParser/Node/Expr/Eval_.php
+++ b/lib/PhpParser/Node/Expr/Eval_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class Eval_ extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/Exit_.php b/lib/PhpParser/Node/Expr/Exit_.php
index c8e542b..5261309 100644
--- a/lib/PhpParser/Node/Expr/Exit_.php
+++ b/lib/PhpParser/Node/Expr/Exit_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class Exit_ extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/FuncCall.php b/lib/PhpParser/Node/Expr/FuncCall.php
index dae3aab..ef9838a 100644
--- a/lib/PhpParser/Node/Expr/FuncCall.php
+++ b/lib/PhpParser/Node/Expr/FuncCall.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -25,7 +25,7 @@ class FuncCall extends Expr
$this->args = $args;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name', 'args');
}
}
diff --git a/lib/PhpParser/Node/Expr/Include_.php b/lib/PhpParser/Node/Expr/Include_.php
index 280ac98..1054ba3 100644
--- a/lib/PhpParser/Node/Expr/Include_.php
+++ b/lib/PhpParser/Node/Expr/Include_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -23,13 +23,13 @@ class Include_ extends Expr
* @param int $type Type of include
* @param array $attributes Additional attributes
*/
- public function __construct(Expr $expr, $type, array $attributes = array()) {
+ public function __construct(Expr $expr, int $type, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->expr = $expr;
$this->type = $type;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr', 'type');
}
}
diff --git a/lib/PhpParser/Node/Expr/Instanceof_.php b/lib/PhpParser/Node/Expr/Instanceof_.php
index 0c670b0..d0e3f3c 100644
--- a/lib/PhpParser/Node/Expr/Instanceof_.php
+++ b/lib/PhpParser/Node/Expr/Instanceof_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -25,7 +25,7 @@ class Instanceof_ extends Expr
$this->class = $class;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr', 'class');
}
}
diff --git a/lib/PhpParser/Node/Expr/Isset_.php b/lib/PhpParser/Node/Expr/Isset_.php
index 91e50fd..6c35f5d 100644
--- a/lib/PhpParser/Node/Expr/Isset_.php
+++ b/lib/PhpParser/Node/Expr/Isset_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class Isset_ extends Expr
$this->vars = $vars;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('vars');
}
}
diff --git a/lib/PhpParser/Node/Expr/List_.php b/lib/PhpParser/Node/Expr/List_.php
index 962543b..ccd6698 100644
--- a/lib/PhpParser/Node/Expr/List_.php
+++ b/lib/PhpParser/Node/Expr/List_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class List_ extends Expr
$this->vars = $vars;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('vars');
}
}
diff --git a/lib/PhpParser/Node/Expr/MethodCall.php b/lib/PhpParser/Node/Expr/MethodCall.php
index 0a8b6d9..c359bd2 100644
--- a/lib/PhpParser/Node/Expr/MethodCall.php
+++ b/lib/PhpParser/Node/Expr/MethodCall.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -29,7 +29,7 @@ class MethodCall extends Expr
$this->args = $args;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('var', 'name', 'args');
}
}
diff --git a/lib/PhpParser/Node/Expr/New_.php b/lib/PhpParser/Node/Expr/New_.php
index 71597cd..1b18117 100644
--- a/lib/PhpParser/Node/Expr/New_.php
+++ b/lib/PhpParser/Node/Expr/New_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -25,7 +25,7 @@ class New_ extends Expr
$this->args = $args;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('class', 'args');
}
}
diff --git a/lib/PhpParser/Node/Expr/PostDec.php b/lib/PhpParser/Node/Expr/PostDec.php
index 66ba5dc..1c28f39 100644
--- a/lib/PhpParser/Node/Expr/PostDec.php
+++ b/lib/PhpParser/Node/Expr/PostDec.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class PostDec extends Expr
$this->var = $var;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('var');
}
}
diff --git a/lib/PhpParser/Node/Expr/PostInc.php b/lib/PhpParser/Node/Expr/PostInc.php
index ad72482..2e176e9 100644
--- a/lib/PhpParser/Node/Expr/PostInc.php
+++ b/lib/PhpParser/Node/Expr/PostInc.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class PostInc extends Expr
$this->var = $var;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('var');
}
}
diff --git a/lib/PhpParser/Node/Expr/PreDec.php b/lib/PhpParser/Node/Expr/PreDec.php
index c388ab5..5bd9be1 100644
--- a/lib/PhpParser/Node/Expr/PreDec.php
+++ b/lib/PhpParser/Node/Expr/PreDec.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class PreDec extends Expr
$this->var = $var;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('var');
}
}
diff --git a/lib/PhpParser/Node/Expr/PreInc.php b/lib/PhpParser/Node/Expr/PreInc.php
index da8a58a..d2a960c 100644
--- a/lib/PhpParser/Node/Expr/PreInc.php
+++ b/lib/PhpParser/Node/Expr/PreInc.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class PreInc extends Expr
$this->var = $var;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('var');
}
}
diff --git a/lib/PhpParser/Node/Expr/Print_.php b/lib/PhpParser/Node/Expr/Print_.php
index af7f02d..f634b37 100644
--- a/lib/PhpParser/Node/Expr/Print_.php
+++ b/lib/PhpParser/Node/Expr/Print_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class Print_ extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/PropertyFetch.php b/lib/PhpParser/Node/Expr/PropertyFetch.php
index 37dcd7f..25de1c1 100644
--- a/lib/PhpParser/Node/Expr/PropertyFetch.php
+++ b/lib/PhpParser/Node/Expr/PropertyFetch.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -24,7 +24,7 @@ class PropertyFetch extends Expr
$this->name = $name;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('var', 'name');
}
}
diff --git a/lib/PhpParser/Node/Expr/ShellExec.php b/lib/PhpParser/Node/Expr/ShellExec.php
index 23d0257..19cffee 100644
--- a/lib/PhpParser/Node/Expr/ShellExec.php
+++ b/lib/PhpParser/Node/Expr/ShellExec.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -15,12 +15,12 @@ class ShellExec extends Expr
* @param array $parts Encapsed string array
* @param array $attributes Additional attributes
*/
- public function __construct($parts, array $attributes = array()) {
+ public function __construct(array $parts, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->parts = $parts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('parts');
}
}
diff --git a/lib/PhpParser/Node/Expr/StaticCall.php b/lib/PhpParser/Node/Expr/StaticCall.php
index eb17ab8..6c3bfc0 100644
--- a/lib/PhpParser/Node/Expr/StaticCall.php
+++ b/lib/PhpParser/Node/Expr/StaticCall.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -29,7 +29,7 @@ class StaticCall extends Expr
$this->args = $args;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('class', 'name', 'args');
}
}
diff --git a/lib/PhpParser/Node/Expr/StaticPropertyFetch.php b/lib/PhpParser/Node/Expr/StaticPropertyFetch.php
index acc86ec..ecc37ab 100644
--- a/lib/PhpParser/Node/Expr/StaticPropertyFetch.php
+++ b/lib/PhpParser/Node/Expr/StaticPropertyFetch.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -25,7 +25,7 @@ class StaticPropertyFetch extends Expr
$this->name = $name;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('class', 'name');
}
}
diff --git a/lib/PhpParser/Node/Expr/Ternary.php b/lib/PhpParser/Node/Expr/Ternary.php
index 05d2e7a..a6548df 100644
--- a/lib/PhpParser/Node/Expr/Ternary.php
+++ b/lib/PhpParser/Node/Expr/Ternary.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -28,7 +28,7 @@ class Ternary extends Expr
$this->else = $else;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('cond', 'if', 'else');
}
}
diff --git a/lib/PhpParser/Node/Expr/UnaryMinus.php b/lib/PhpParser/Node/Expr/UnaryMinus.php
index 27960f8..82de51d 100644
--- a/lib/PhpParser/Node/Expr/UnaryMinus.php
+++ b/lib/PhpParser/Node/Expr/UnaryMinus.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class UnaryMinus extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/UnaryPlus.php b/lib/PhpParser/Node/Expr/UnaryPlus.php
index 0f545b9..5854d02 100644
--- a/lib/PhpParser/Node/Expr/UnaryPlus.php
+++ b/lib/PhpParser/Node/Expr/UnaryPlus.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class UnaryPlus extends Expr
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Expr/Variable.php b/lib/PhpParser/Node/Expr/Variable.php
index b5dd78a..d9cfbda 100644
--- a/lib/PhpParser/Node/Expr/Variable.php
+++ b/lib/PhpParser/Node/Expr/Variable.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -20,7 +20,7 @@ class Variable extends Expr
$this->name = $name;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name');
}
}
diff --git a/lib/PhpParser/Node/Expr/Yield_.php b/lib/PhpParser/Node/Expr/Yield_.php
index e7e6f00..b747443 100644
--- a/lib/PhpParser/Node/Expr/Yield_.php
+++ b/lib/PhpParser/Node/Expr/Yield_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Expr;
@@ -24,7 +24,7 @@ class Yield_ extends Expr
$this->value = $value;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('key', 'value');
}
}
diff --git a/lib/PhpParser/Node/Name.php b/lib/PhpParser/Node/Name.php
index 2e3d781..0cea879 100644
--- a/lib/PhpParser/Node/Name.php
+++ b/lib/PhpParser/Node/Name.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node;
@@ -24,7 +24,7 @@ class Name extends NodeAbstract
$this->parts = $parts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('parts');
}
@@ -33,7 +33,7 @@ class Name extends NodeAbstract
*
* @return string First part of the name
*/
- public function getFirst() {
+ public function getFirst() : string {
return $this->parts[0];
}
@@ -42,7 +42,7 @@ class Name extends NodeAbstract
*
* @return string Last part of the name
*/
- public function getLast() {
+ public function getLast() : string {
return $this->parts[count($this->parts) - 1];
}
@@ -51,7 +51,7 @@ class Name extends NodeAbstract
*
* @return bool Whether the name is unqualified
*/
- public function isUnqualified() {
+ public function isUnqualified() : bool {
return 1 == count($this->parts);
}
@@ -60,7 +60,7 @@ class Name extends NodeAbstract
*
* @return bool Whether the name is qualified
*/
- public function isQualified() {
+ public function isQualified() : bool {
return 1 < count($this->parts);
}
@@ -69,7 +69,7 @@ class Name extends NodeAbstract
*
* @return bool Whether the name is fully qualified
*/
- public function isFullyQualified() {
+ public function isFullyQualified() : bool {
return false;
}
@@ -78,7 +78,7 @@ class Name extends NodeAbstract
*
* @return bool Whether the name is relative
*/
- public function isRelative() {
+ public function isRelative() : bool {
return false;
}
@@ -89,7 +89,7 @@ class Name extends NodeAbstract
*
* @return string String representation
*/
- public function toString($separator = '\\') {
+ public function toString(string $separator = '\\') : string {
return implode($separator, $this->parts);
}
@@ -99,7 +99,7 @@ class Name extends NodeAbstract
*
* @return string String representation
*/
- public function __toString() {
+ public function __toString() : string {
return implode('\\', $this->parts);
}
@@ -156,7 +156,7 @@ class Name extends NodeAbstract
*
* @return array Prepared name
*/
- protected function prepareName($name) {
+ protected function prepareName($name) : array {
if (is_string($name)) {
return explode('\\', $name);
} elseif (is_array($name)) {
diff --git a/lib/PhpParser/Node/Name/FullyQualified.php b/lib/PhpParser/Node/Name/FullyQualified.php
index 97cc111..c518089 100644
--- a/lib/PhpParser/Node/Name/FullyQualified.php
+++ b/lib/PhpParser/Node/Name/FullyQualified.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Name;
@@ -9,7 +9,7 @@ class FullyQualified extends \PhpParser\Node\Name
*
* @return bool Whether the name is unqualified
*/
- public function isUnqualified() {
+ public function isUnqualified() : bool {
return false;
}
@@ -18,7 +18,7 @@ class FullyQualified extends \PhpParser\Node\Name
*
* @return bool Whether the name is qualified
*/
- public function isQualified() {
+ public function isQualified() : bool {
return false;
}
@@ -27,7 +27,7 @@ class FullyQualified extends \PhpParser\Node\Name
*
* @return bool Whether the name is fully qualified
*/
- public function isFullyQualified() {
+ public function isFullyQualified() : bool {
return true;
}
@@ -36,7 +36,7 @@ class FullyQualified extends \PhpParser\Node\Name
*
* @return bool Whether the name is relative
*/
- public function isRelative() {
+ public function isRelative() : bool {
return false;
}
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Name/Relative.php b/lib/PhpParser/Node/Name/Relative.php
index 25676ce..139eeba 100644
--- a/lib/PhpParser/Node/Name/Relative.php
+++ b/lib/PhpParser/Node/Name/Relative.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Name;
@@ -9,7 +9,7 @@ class Relative extends \PhpParser\Node\Name
*
* @return bool Whether the name is unqualified
*/
- public function isUnqualified() {
+ public function isUnqualified() : bool {
return false;
}
@@ -18,7 +18,7 @@ class Relative extends \PhpParser\Node\Name
*
* @return bool Whether the name is qualified
*/
- public function isQualified() {
+ public function isQualified() : bool {
return false;
}
@@ -27,7 +27,7 @@ class Relative extends \PhpParser\Node\Name
*
* @return bool Whether the name is fully qualified
*/
- public function isFullyQualified() {
+ public function isFullyQualified() : bool {
return false;
}
@@ -36,7 +36,7 @@ class Relative extends \PhpParser\Node\Name
*
* @return bool Whether the name is relative
*/
- public function isRelative() {
+ public function isRelative() : bool {
return true;
}
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Param.php b/lib/PhpParser/Node/Param.php
index 147568f..a1229de 100644
--- a/lib/PhpParser/Node/Param.php
+++ b/lib/PhpParser/Node/Param.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node;
@@ -28,7 +28,7 @@ class Param extends NodeAbstract
* @param bool $variadic Whether this is a variadic argument
* @param array $attributes Additional attributes
*/
- public function __construct($name, $default = null, $type = null, $byRef = false, $variadic = false, array $attributes = array()) {
+ public function __construct(string $name, \PhpParser\Node\Expr $default = null, $type = null, bool $byRef = false, bool $variadic = false, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->type = $type;
$this->byRef = $byRef;
@@ -41,7 +41,7 @@ class Param extends NodeAbstract
}
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('type', 'byRef', 'variadic', 'name', 'default');
}
}
diff --git a/lib/PhpParser/Node/Scalar.php b/lib/PhpParser/Node/Scalar.php
index 0117753..148af8a 100644
--- a/lib/PhpParser/Node/Scalar.php
+++ b/lib/PhpParser/Node/Scalar.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node;
diff --git a/lib/PhpParser/Node/Scalar/DNumber.php b/lib/PhpParser/Node/Scalar/DNumber.php
index 7fe9f73..5fdd6bb 100644
--- a/lib/PhpParser/Node/Scalar/DNumber.php
+++ b/lib/PhpParser/Node/Scalar/DNumber.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
@@ -15,12 +15,12 @@ class DNumber extends Scalar
* @param float $value Value of the number
* @param array $attributes Additional attributes
*/
- public function __construct($value = 0.0, array $attributes = array()) {
+ public function __construct(float $value = 0.0, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->value = $value;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('value');
}
@@ -33,7 +33,7 @@ class DNumber extends Scalar
*
* @return float The parsed number
*/
- public static function parse($str) {
+ public static function parse(string $str) : float {
// if string contains any of .eE just cast it to float
if (false !== strpbrk($str, '.eE')) {
return (float) $str;
diff --git a/lib/PhpParser/Node/Scalar/Encapsed.php b/lib/PhpParser/Node/Scalar/Encapsed.php
index c2555bf..61c676a 100644
--- a/lib/PhpParser/Node/Scalar/Encapsed.php
+++ b/lib/PhpParser/Node/Scalar/Encapsed.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
@@ -20,7 +20,7 @@ class Encapsed extends Scalar
$this->parts = $parts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('parts');
}
}
diff --git a/lib/PhpParser/Node/Scalar/LNumber.php b/lib/PhpParser/Node/Scalar/LNumber.php
index 4a4e603..b804dd0 100644
--- a/lib/PhpParser/Node/Scalar/LNumber.php
+++ b/lib/PhpParser/Node/Scalar/LNumber.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
@@ -15,12 +15,12 @@ class LNumber extends Scalar
* @param int $value Value of the number
* @param array $attributes Additional attributes
*/
- public function __construct($value = 0, array $attributes = array()) {
+ public function __construct(int $value = 0, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->value = $value;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('value');
}
@@ -33,7 +33,7 @@ class LNumber extends Scalar
*
* @return int The parsed number
*/
- public static function parse($str) {
+ public static function parse(string $str) : int {
// handle plain 0 specially
if ('0' === $str) {
return 0;
diff --git a/lib/PhpParser/Node/Scalar/MagicConst.php b/lib/PhpParser/Node/Scalar/MagicConst.php
index 969a664..b1b50be 100644
--- a/lib/PhpParser/Node/Scalar/MagicConst.php
+++ b/lib/PhpParser/Node/Scalar/MagicConst.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
@@ -15,7 +15,7 @@ abstract class MagicConst extends Scalar
parent::__construct(null, $attributes);
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array();
}
@@ -24,5 +24,5 @@ abstract class MagicConst extends Scalar
*
* @return string Name of magic constant
*/
- abstract public function getName();
+ abstract public function getName() : string;
}
diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Class_.php b/lib/PhpParser/Node/Scalar/MagicConst/Class_.php
index 3466b21..9cd9051 100644
--- a/lib/PhpParser/Node/Scalar/MagicConst/Class_.php
+++ b/lib/PhpParser/Node/Scalar/MagicConst/Class_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,7 @@ use PhpParser\Node\Scalar\MagicConst;
class Class_ extends MagicConst
{
- public function getName() {
+ public function getName() : string {
return '__CLASS__';
}
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Dir.php b/lib/PhpParser/Node/Scalar/MagicConst/Dir.php
index 9a86ae9..1ed9647 100644
--- a/lib/PhpParser/Node/Scalar/MagicConst/Dir.php
+++ b/lib/PhpParser/Node/Scalar/MagicConst/Dir.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,7 @@ use PhpParser\Node\Scalar\MagicConst;
class Dir extends MagicConst
{
- public function getName() {
+ public function getName() : string {
return '__DIR__';
}
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Scalar/MagicConst/File.php b/lib/PhpParser/Node/Scalar/MagicConst/File.php
index db293ef..8f495e5 100644
--- a/lib/PhpParser/Node/Scalar/MagicConst/File.php
+++ b/lib/PhpParser/Node/Scalar/MagicConst/File.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,7 @@ use PhpParser\Node\Scalar\MagicConst;
class File extends MagicConst
{
- public function getName() {
+ public function getName() : string {
return '__FILE__';
}
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Function_.php b/lib/PhpParser/Node/Scalar/MagicConst/Function_.php
index 435a8ae..ba0b396 100644
--- a/lib/PhpParser/Node/Scalar/MagicConst/Function_.php
+++ b/lib/PhpParser/Node/Scalar/MagicConst/Function_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,7 @@ use PhpParser\Node\Scalar\MagicConst;
class Function_ extends MagicConst
{
- public function getName() {
+ public function getName() : string {
return '__FUNCTION__';
}
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Line.php b/lib/PhpParser/Node/Scalar/MagicConst/Line.php
index 35f89bc..cb1e308 100644
--- a/lib/PhpParser/Node/Scalar/MagicConst/Line.php
+++ b/lib/PhpParser/Node/Scalar/MagicConst/Line.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,7 @@ use PhpParser\Node\Scalar\MagicConst;
class Line extends MagicConst
{
- public function getName() {
+ public function getName() : string {
return '__LINE__';
}
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Method.php b/lib/PhpParser/Node/Scalar/MagicConst/Method.php
index 7791b9d..fd6b3f2 100644
--- a/lib/PhpParser/Node/Scalar/MagicConst/Method.php
+++ b/lib/PhpParser/Node/Scalar/MagicConst/Method.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,7 @@ use PhpParser\Node\Scalar\MagicConst;
class Method extends MagicConst
{
- public function getName() {
+ public function getName() : string {
return '__METHOD__';
}
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php b/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php
index 07f5aff..182b215 100644
--- a/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php
+++ b/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,7 @@ use PhpParser\Node\Scalar\MagicConst;
class Namespace_ extends MagicConst
{
- public function getName() {
+ public function getName() : string {
return '__NAMESPACE__';
}
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php b/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php
index 1ac3f78..5507f4d 100644
--- a/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php
+++ b/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar\MagicConst;
@@ -6,7 +6,7 @@ use PhpParser\Node\Scalar\MagicConst;
class Trait_ extends MagicConst
{
- public function getName() {
+ public function getName() : string {
return '__TRAIT__';
}
}
\ No newline at end of file
diff --git a/lib/PhpParser/Node/Scalar/String_.php b/lib/PhpParser/Node/Scalar/String_.php
index e6dcafa..67e6db1 100644
--- a/lib/PhpParser/Node/Scalar/String_.php
+++ b/lib/PhpParser/Node/Scalar/String_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
@@ -26,12 +26,12 @@ class String_ extends Scalar
* @param string $value Value of the string
* @param array $attributes Additional attributes
*/
- public function __construct($value = '', array $attributes = array()) {
+ public function __construct(string $value = '', array $attributes = array()) {
parent::__construct(null, $attributes);
$this->value = $value;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('value');
}
@@ -44,7 +44,7 @@ class String_ extends Scalar
*
* @return string The parsed string
*/
- public static function parse($str) {
+ public static function parse(string $str) : string {
$bLength = 0;
if ('b' === $str[0]) {
$bLength = 1;
@@ -71,7 +71,7 @@ class String_ extends Scalar
*
* @return string String with escape sequences parsed
*/
- public static function parseEscapeSequences($str, $quote) {
+ public static function parseEscapeSequences(string $str, $quote) : string {
if (null !== $quote) {
$str = str_replace('\\' . $quote, $quote, $str);
}
@@ -105,7 +105,7 @@ class String_ extends Scalar
*
* @return string Parsed string
*/
- public static function parseDocString($startToken, $str) {
+ public static function parseDocString(string $startToken, string $str) : string {
// strip last newline (thanks tokenizer for sticking it into the string!)
$str = preg_replace('~(\r\n|\n|\r)$~', '', $str);
diff --git a/lib/PhpParser/Node/Stmt.php b/lib/PhpParser/Node/Stmt.php
index baa2f3e..d2829b0 100644
--- a/lib/PhpParser/Node/Stmt.php
+++ b/lib/PhpParser/Node/Stmt.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node;
diff --git a/lib/PhpParser/Node/Stmt/Break_.php b/lib/PhpParser/Node/Stmt/Break_.php
index 0d7d02e..efc47de 100644
--- a/lib/PhpParser/Node/Stmt/Break_.php
+++ b/lib/PhpParser/Node/Stmt/Break_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class Break_ extends Node\Stmt
$this->num = $num;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('num');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Case_.php b/lib/PhpParser/Node/Stmt/Case_.php
index 50f17a6..b331a4f 100644
--- a/lib/PhpParser/Node/Stmt/Case_.php
+++ b/lib/PhpParser/Node/Stmt/Case_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -24,7 +24,7 @@ class Case_ extends Node\Stmt
$this->stmts = $stmts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('cond', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Catch_.php b/lib/PhpParser/Node/Stmt/Catch_.php
index 7dd3e9b..d84bbf6 100644
--- a/lib/PhpParser/Node/Stmt/Catch_.php
+++ b/lib/PhpParser/Node/Stmt/Catch_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -21,14 +21,14 @@ class Catch_ extends Node\Stmt
* @param Node[] $stmts Statements
* @param array $attributes Additional attributes
*/
- public function __construct(Node\Name $type, $var, array $stmts = array(), array $attributes = array()) {
+ public function __construct(Node\Name $type, string $var, array $stmts = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
$this->type = $type;
$this->var = $var;
$this->stmts = $stmts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('type', 'var', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/ClassConst.php b/lib/PhpParser/Node/Stmt/ClassConst.php
index 3eb6b0c..764df65 100644
--- a/lib/PhpParser/Node/Stmt/ClassConst.php
+++ b/lib/PhpParser/Node/Stmt/ClassConst.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class ClassConst extends Node\Stmt
$this->consts = $consts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('consts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/ClassLike.php b/lib/PhpParser/Node/Stmt/ClassLike.php
index 28a2714..9a8486c 100644
--- a/lib/PhpParser/Node/Stmt/ClassLike.php
+++ b/lib/PhpParser/Node/Stmt/ClassLike.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
diff --git a/lib/PhpParser/Node/Stmt/ClassMethod.php b/lib/PhpParser/Node/Stmt/ClassMethod.php
index f5b2bac..6f29a8d 100644
--- a/lib/PhpParser/Node/Stmt/ClassMethod.php
+++ b/lib/PhpParser/Node/Stmt/ClassMethod.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -32,7 +32,7 @@ class ClassMethod extends Node\Stmt
* 'stmts' => array() : Statements
* @param array $attributes Additional attributes
*/
- public function __construct($name, array $subNodes = array(), array $attributes = array()) {
+ public function __construct(string $name, array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
$this->type = isset($subNodes['type']) ? $subNodes['type'] : 0;
$this->byRef = isset($subNodes['byRef']) ? $subNodes['byRef'] : false;
@@ -53,7 +53,7 @@ class ClassMethod extends Node\Stmt
}
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('type', 'byRef', 'name', 'params', 'returnType', 'stmts');
}
diff --git a/lib/PhpParser/Node/Stmt/Class_.php b/lib/PhpParser/Node/Stmt/Class_.php
index 548aaca..e335917 100644
--- a/lib/PhpParser/Node/Stmt/Class_.php
+++ b/lib/PhpParser/Node/Stmt/Class_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -40,7 +40,7 @@ class Class_ extends ClassLike
* 'stmts' => array(): Statements
* @param array $attributes Additional attributes
*/
- public function __construct($name, array $subNodes = array(), array $attributes = array()) {
+ public function __construct(string $name, array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
$this->type = isset($subNodes['type']) ? $subNodes['type'] : 0;
$this->name = $name;
@@ -63,7 +63,7 @@ class Class_ extends ClassLike
}
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('type', 'name', 'extends', 'implements', 'stmts');
}
diff --git a/lib/PhpParser/Node/Stmt/Const_.php b/lib/PhpParser/Node/Stmt/Const_.php
index b42c8df..83a8e11 100644
--- a/lib/PhpParser/Node/Stmt/Const_.php
+++ b/lib/PhpParser/Node/Stmt/Const_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class Const_ extends Node\Stmt
$this->consts = $consts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('consts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Continue_.php b/lib/PhpParser/Node/Stmt/Continue_.php
index 0f4c596..319e961 100644
--- a/lib/PhpParser/Node/Stmt/Continue_.php
+++ b/lib/PhpParser/Node/Stmt/Continue_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class Continue_ extends Node\Stmt
$this->num = $num;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('num');
}
}
diff --git a/lib/PhpParser/Node/Stmt/DeclareDeclare.php b/lib/PhpParser/Node/Stmt/DeclareDeclare.php
index e7833f6..73215b1 100644
--- a/lib/PhpParser/Node/Stmt/DeclareDeclare.php
+++ b/lib/PhpParser/Node/Stmt/DeclareDeclare.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -18,13 +18,13 @@ class DeclareDeclare extends Node\Stmt
* @param Node\Expr $value Value
* @param array $attributes Additional attributes
*/
- public function __construct($key, Node\Expr $value, array $attributes = array()) {
+ public function __construct(string $key, Node\Expr $value, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->key = $key;
$this->value = $value;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('key', 'value');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Declare_.php b/lib/PhpParser/Node/Stmt/Declare_.php
index 67a753e..1929c38 100644
--- a/lib/PhpParser/Node/Stmt/Declare_.php
+++ b/lib/PhpParser/Node/Stmt/Declare_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -23,7 +23,7 @@ class Declare_ extends Node\Stmt
$this->stmts = $stmts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('declares', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Do_.php b/lib/PhpParser/Node/Stmt/Do_.php
index b5f3092..d2551dd 100644
--- a/lib/PhpParser/Node/Stmt/Do_.php
+++ b/lib/PhpParser/Node/Stmt/Do_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -24,7 +24,7 @@ class Do_ extends Node\Stmt
$this->stmts = $stmts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('cond', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Echo_.php b/lib/PhpParser/Node/Stmt/Echo_.php
index 9275158..4f03559 100644
--- a/lib/PhpParser/Node/Stmt/Echo_.php
+++ b/lib/PhpParser/Node/Stmt/Echo_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class Echo_ extends Node\Stmt
$this->exprs = $exprs;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('exprs');
}
}
diff --git a/lib/PhpParser/Node/Stmt/ElseIf_.php b/lib/PhpParser/Node/Stmt/ElseIf_.php
index 1a9773c..979a9ac 100644
--- a/lib/PhpParser/Node/Stmt/ElseIf_.php
+++ b/lib/PhpParser/Node/Stmt/ElseIf_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -24,7 +24,7 @@ class ElseIf_ extends Node\Stmt
$this->stmts = $stmts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('cond', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Else_.php b/lib/PhpParser/Node/Stmt/Else_.php
index ecec6e6..25d0c50 100644
--- a/lib/PhpParser/Node/Stmt/Else_.php
+++ b/lib/PhpParser/Node/Stmt/Else_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class Else_ extends Node\Stmt
$this->stmts = $stmts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/For_.php b/lib/PhpParser/Node/Stmt/For_.php
index 4f7d4e8..198120a 100644
--- a/lib/PhpParser/Node/Stmt/For_.php
+++ b/lib/PhpParser/Node/Stmt/For_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -33,7 +33,7 @@ class For_ extends Node\Stmt
$this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('init', 'cond', 'loop', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Foreach_.php b/lib/PhpParser/Node/Stmt/Foreach_.php
index bec82e9..88e180d 100644
--- a/lib/PhpParser/Node/Stmt/Foreach_.php
+++ b/lib/PhpParser/Node/Stmt/Foreach_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -37,7 +37,7 @@ class Foreach_ extends Node\Stmt
$this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr', 'keyVar', 'byRef', 'valueVar', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Function_.php b/lib/PhpParser/Node/Stmt/Function_.php
index 8e81b70..b4ff9ad 100644
--- a/lib/PhpParser/Node/Stmt/Function_.php
+++ b/lib/PhpParser/Node/Stmt/Function_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -28,7 +28,7 @@ class Function_ extends Node\Stmt
* 'stmts' => array(): Statements
* @param array $attributes Additional attributes
*/
- public function __construct($name, array $subNodes = array(), array $attributes = array()) {
+ public function __construct(string $name, array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
$this->byRef = isset($subNodes['byRef']) ? $subNodes['byRef'] : false;
$this->name = $name;
@@ -37,7 +37,7 @@ class Function_ extends Node\Stmt
$this->stmts = isset($subNodes['stmts']) ? $subNodes['stmts'] : array();
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('byRef', 'name', 'params', 'returnType', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Global_.php b/lib/PhpParser/Node/Stmt/Global_.php
index 21c040f..269a645 100644
--- a/lib/PhpParser/Node/Stmt/Global_.php
+++ b/lib/PhpParser/Node/Stmt/Global_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class Global_ extends Node\Stmt
$this->vars = $vars;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('vars');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Goto_.php b/lib/PhpParser/Node/Stmt/Goto_.php
index 97c46f9..3af69c9 100644
--- a/lib/PhpParser/Node/Stmt/Goto_.php
+++ b/lib/PhpParser/Node/Stmt/Goto_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -15,12 +15,12 @@ class Goto_ extends Stmt
* @param string $name Name of label to jump to
* @param array $attributes Additional attributes
*/
- public function __construct($name, array $attributes = array()) {
+ public function __construct(string $name, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->name = $name;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name');
}
}
diff --git a/lib/PhpParser/Node/Stmt/HaltCompiler.php b/lib/PhpParser/Node/Stmt/HaltCompiler.php
index c6c85cf..fd5b6ca 100644
--- a/lib/PhpParser/Node/Stmt/HaltCompiler.php
+++ b/lib/PhpParser/Node/Stmt/HaltCompiler.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -15,12 +15,12 @@ class HaltCompiler extends Stmt
* @param string $remaining Remaining text after halt compiler statement.
* @param array $attributes Additional attributes
*/
- public function __construct($remaining, array $attributes = array()) {
+ public function __construct(string $remaining, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->remaining = $remaining;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('remaining');
}
}
diff --git a/lib/PhpParser/Node/Stmt/If_.php b/lib/PhpParser/Node/Stmt/If_.php
index 3e11f24..6868e69 100644
--- a/lib/PhpParser/Node/Stmt/If_.php
+++ b/lib/PhpParser/Node/Stmt/If_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -33,7 +33,7 @@ class If_ extends Node\Stmt
$this->else = isset($subNodes['else']) ? $subNodes['else'] : null;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('cond', 'stmts', 'elseifs', 'else');
}
}
diff --git a/lib/PhpParser/Node/Stmt/InlineHTML.php b/lib/PhpParser/Node/Stmt/InlineHTML.php
index 2d0ff98..8542c2d 100644
--- a/lib/PhpParser/Node/Stmt/InlineHTML.php
+++ b/lib/PhpParser/Node/Stmt/InlineHTML.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -15,12 +15,12 @@ class InlineHTML extends Stmt
* @param string $value String
* @param array $attributes Additional attributes
*/
- public function __construct($value, array $attributes = array()) {
+ public function __construct(string $value, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->value = $value;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('value');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Interface_.php b/lib/PhpParser/Node/Stmt/Interface_.php
index b047e51..5c223a0 100644
--- a/lib/PhpParser/Node/Stmt/Interface_.php
+++ b/lib/PhpParser/Node/Stmt/Interface_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -25,7 +25,7 @@ class Interface_ extends ClassLike
* 'stmts' => array(): Statements
* @param array $attributes Additional attributes
*/
- public function __construct($name, array $subNodes = array(), array $attributes = array()) {
+ public function __construct(string $name, array $subNodes = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
$this->name = $name;
$this->extends = isset($subNodes['extends']) ? $subNodes['extends'] : array();
@@ -42,7 +42,7 @@ class Interface_ extends ClassLike
}
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name', 'extends', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Label.php b/lib/PhpParser/Node/Stmt/Label.php
index d30acb9..f1c8150 100644
--- a/lib/PhpParser/Node/Stmt/Label.php
+++ b/lib/PhpParser/Node/Stmt/Label.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -15,12 +15,12 @@ class Label extends Stmt
* @param string $name Name
* @param array $attributes Additional attributes
*/
- public function __construct($name, array $attributes = array()) {
+ public function __construct(string $name, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->name = $name;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Namespace_.php b/lib/PhpParser/Node/Stmt/Namespace_.php
index 49b1490..afa4cc2 100644
--- a/lib/PhpParser/Node/Stmt/Namespace_.php
+++ b/lib/PhpParser/Node/Stmt/Namespace_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -43,7 +43,7 @@ class Namespace_ extends Node\Stmt
}
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Property.php b/lib/PhpParser/Node/Stmt/Property.php
index 295f369..0447854 100644
--- a/lib/PhpParser/Node/Stmt/Property.php
+++ b/lib/PhpParser/Node/Stmt/Property.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -19,7 +19,7 @@ class Property extends Node\Stmt
* @param PropertyProperty[] $props Properties
* @param array $attributes Additional attributes
*/
- public function __construct($type, array $props, array $attributes = array()) {
+ public function __construct(int $type, array $props, array $attributes = array()) {
if ($type & Class_::MODIFIER_ABSTRACT) {
throw new Error('Properties cannot be declared abstract');
}
@@ -33,7 +33,7 @@ class Property extends Node\Stmt
$this->props = $props;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('type', 'props');
}
diff --git a/lib/PhpParser/Node/Stmt/PropertyProperty.php b/lib/PhpParser/Node/Stmt/PropertyProperty.php
index f9748aa..2484c03 100644
--- a/lib/PhpParser/Node/Stmt/PropertyProperty.php
+++ b/lib/PhpParser/Node/Stmt/PropertyProperty.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -18,13 +18,13 @@ class PropertyProperty extends Node\Stmt
* @param null|Node\Expr $default Default value
* @param array $attributes Additional attributes
*/
- public function __construct($name, Node\Expr $default = null, array $attributes = array()) {
+ public function __construct(string $name, Node\Expr $default = null, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->name = $name;
$this->default = $default;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name', 'default');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Return_.php b/lib/PhpParser/Node/Stmt/Return_.php
index 67b139b..b39d82e 100644
--- a/lib/PhpParser/Node/Stmt/Return_.php
+++ b/lib/PhpParser/Node/Stmt/Return_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class Return_ extends Node\Stmt
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Stmt/StaticVar.php b/lib/PhpParser/Node/Stmt/StaticVar.php
index aab5174..e60e025 100644
--- a/lib/PhpParser/Node/Stmt/StaticVar.php
+++ b/lib/PhpParser/Node/Stmt/StaticVar.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -18,13 +18,13 @@ class StaticVar extends Node\Stmt
* @param null|Node\Expr $default Default value
* @param array $attributes Additional attributes
*/
- public function __construct($name, Node\Expr $default = null, array $attributes = array()) {
+ public function __construct(string $name, Node\Expr $default = null, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->name = $name;
$this->default = $default;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name', 'default');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Static_.php b/lib/PhpParser/Node/Stmt/Static_.php
index 49a3f70..6874dd8 100644
--- a/lib/PhpParser/Node/Stmt/Static_.php
+++ b/lib/PhpParser/Node/Stmt/Static_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class Static_ extends Stmt
$this->vars = $vars;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('vars');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Switch_.php b/lib/PhpParser/Node/Stmt/Switch_.php
index 7a7ec92..1a7521d 100644
--- a/lib/PhpParser/Node/Stmt/Switch_.php
+++ b/lib/PhpParser/Node/Stmt/Switch_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -24,7 +24,7 @@ class Switch_ extends Node\Stmt
$this->cases = $cases;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('cond', 'cases');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Throw_.php b/lib/PhpParser/Node/Stmt/Throw_.php
index 3e21986..4ee9005 100644
--- a/lib/PhpParser/Node/Stmt/Throw_.php
+++ b/lib/PhpParser/Node/Stmt/Throw_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class Throw_ extends Node\Stmt
$this->expr = $expr;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('expr');
}
}
diff --git a/lib/PhpParser/Node/Stmt/TraitUse.php b/lib/PhpParser/Node/Stmt/TraitUse.php
index b38f122..2049dce 100644
--- a/lib/PhpParser/Node/Stmt/TraitUse.php
+++ b/lib/PhpParser/Node/Stmt/TraitUse.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -25,7 +25,7 @@ class TraitUse extends Node\Stmt
$this->adaptations = $adaptations;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('traits', 'adaptations');
}
}
diff --git a/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php b/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php
index c6038c8..4d9a212 100644
--- a/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php
+++ b/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
diff --git a/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php b/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php
index 62811db..f9253db 100644
--- a/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php
+++ b/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt\TraitUseAdaptation;
@@ -20,7 +20,7 @@ class Alias extends Node\Stmt\TraitUseAdaptation
* @param null|string $newName New name
* @param array $attributes Additional attributes
*/
- public function __construct($trait, $method, $newModifier, $newName, array $attributes = array()) {
+ public function __construct($trait, string $method, $newModifier, $newName, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->trait = $trait;
$this->method = $method;
@@ -28,7 +28,7 @@ class Alias extends Node\Stmt\TraitUseAdaptation
$this->newName = $newName;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('trait', 'method', 'newModifier', 'newName');
}
}
diff --git a/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php b/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php
index b30c4f8..534d38c 100644
--- a/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php
+++ b/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt\TraitUseAdaptation;
@@ -17,14 +17,14 @@ class Precedence extends Node\Stmt\TraitUseAdaptation
* @param Node\Name[] $insteadof Overwritten traits
* @param array $attributes Additional attributes
*/
- public function __construct(Node\Name $trait, $method, array $insteadof, array $attributes = array()) {
+ public function __construct(Node\Name $trait, string $method, array $insteadof, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->trait = $trait;
$this->method = $method;
$this->insteadof = $insteadof;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('trait', 'method', 'insteadof');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Trait_.php b/lib/PhpParser/Node/Stmt/Trait_.php
index b96395b..ed9dfb7 100644
--- a/lib/PhpParser/Node/Stmt/Trait_.php
+++ b/lib/PhpParser/Node/Stmt/Trait_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -13,13 +13,13 @@ class Trait_ extends ClassLike
* @param Node[] $stmts Statements
* @param array $attributes Additional attributes
*/
- public function __construct($name, array $stmts = array(), array $attributes = array()) {
+ public function __construct(string $name, array $stmts = array(), array $attributes = array()) {
parent::__construct(null, $attributes);
$this->name = $name;
$this->stmts = $stmts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name', 'stmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/TryCatch.php b/lib/PhpParser/Node/Stmt/TryCatch.php
index e3c1782..4752de5 100644
--- a/lib/PhpParser/Node/Stmt/TryCatch.php
+++ b/lib/PhpParser/Node/Stmt/TryCatch.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -33,7 +33,7 @@ class TryCatch extends Node\Stmt
$this->finallyStmts = $finallyStmts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('stmts', 'catches', 'finallyStmts');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Unset_.php b/lib/PhpParser/Node/Stmt/Unset_.php
index 035d0bd..6a1e4f6 100644
--- a/lib/PhpParser/Node/Stmt/Unset_.php
+++ b/lib/PhpParser/Node/Stmt/Unset_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -20,7 +20,7 @@ class Unset_ extends Node\Stmt
$this->vars = $vars;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('vars');
}
}
diff --git a/lib/PhpParser/Node/Stmt/UseUse.php b/lib/PhpParser/Node/Stmt/UseUse.php
index 4081c29..d1a9b99 100644
--- a/lib/PhpParser/Node/Stmt/UseUse.php
+++ b/lib/PhpParser/Node/Stmt/UseUse.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -19,7 +19,7 @@ class UseUse extends Node\Stmt
* @param null|string $alias Alias
* @param array $attributes Additional attributes
*/
- public function __construct(Node\Name $name, $alias = null, array $attributes = array()) {
+ public function __construct(Node\Name $name, string $alias = null, array $attributes = array()) {
if (null === $alias) {
$alias = $name->getLast();
}
@@ -36,7 +36,7 @@ class UseUse extends Node\Stmt
$this->alias = $alias;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('name', 'alias');
}
}
diff --git a/lib/PhpParser/Node/Stmt/Use_.php b/lib/PhpParser/Node/Stmt/Use_.php
index 25ef577..cdb8a3a 100644
--- a/lib/PhpParser/Node/Stmt/Use_.php
+++ b/lib/PhpParser/Node/Stmt/Use_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -22,13 +22,13 @@ class Use_ extends Stmt
* @param int $type Type of alias
* @param array $attributes Additional attributes
*/
- public function __construct(array $uses, $type = self::TYPE_NORMAL, array $attributes = array()) {
+ public function __construct(array $uses, int $type = self::TYPE_NORMAL, array $attributes = array()) {
parent::__construct(null, $attributes);
$this->type = $type;
$this->uses = $uses;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('type', 'uses');
}
}
diff --git a/lib/PhpParser/Node/Stmt/While_.php b/lib/PhpParser/Node/Stmt/While_.php
index 7ca10e2..4759373 100644
--- a/lib/PhpParser/Node/Stmt/While_.php
+++ b/lib/PhpParser/Node/Stmt/While_.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
@@ -24,7 +24,7 @@ class While_ extends Node\Stmt
$this->stmts = $stmts;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('cond', 'stmts');
}
}
diff --git a/lib/PhpParser/NodeAbstract.php b/lib/PhpParser/NodeAbstract.php
index 8940e2d..03ca185 100644
--- a/lib/PhpParser/NodeAbstract.php
+++ b/lib/PhpParser/NodeAbstract.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -35,7 +35,7 @@ abstract class NodeAbstract implements Node
*
* @return string Type of the node
*/
- public function getType() {
+ public function getType() : string {
return strtr(substr(rtrim(get_class($this), '_'), 15), '\\', '_');
}
@@ -44,7 +44,7 @@ abstract class NodeAbstract implements Node
*
* @return array Names of sub nodes
*/
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return $this->subNodeNames;
}
@@ -53,7 +53,7 @@ abstract class NodeAbstract implements Node
*
* @return int Line
*/
- public function getLine() {
+ public function getLine() : int {
return $this->getAttribute('startLine', -1);
}
@@ -62,7 +62,7 @@ abstract class NodeAbstract implements Node
*
* @param int $line Line
*/
- public function setLine($line) {
+ public function setLine(int $line) {
$this->setAttribute('startLine', (int) $line);
}
@@ -90,21 +90,21 @@ abstract class NodeAbstract implements Node
/**
* {@inheritDoc}
*/
- public function setAttribute($key, $value) {
+ public function setAttribute(string $key, $value) {
$this->attributes[$key] = $value;
}
/**
* {@inheritDoc}
*/
- public function hasAttribute($key) {
+ public function hasAttribute(string $key) : bool {
return array_key_exists($key, $this->attributes);
}
/**
* {@inheritDoc}
*/
- public function &getAttribute($key, $default = null) {
+ public function &getAttribute(string $key, $default = null) {
if (!array_key_exists($key, $this->attributes)) {
return $default;
} else {
@@ -115,7 +115,7 @@ abstract class NodeAbstract implements Node
/**
* {@inheritDoc}
*/
- public function getAttributes() {
+ public function getAttributes() : array {
return $this->attributes;
}
}
diff --git a/lib/PhpParser/NodeDumper.php b/lib/PhpParser/NodeDumper.php
index 57a6fe7..dd6fcf6 100644
--- a/lib/PhpParser/NodeDumper.php
+++ b/lib/PhpParser/NodeDumper.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -11,7 +11,7 @@ class NodeDumper
*
* @return string Dumped value
*/
- public function dump($node) {
+ public function dump($node) : string {
if ($node instanceof Node) {
$r = $node->getType() . '(';
diff --git a/lib/PhpParser/NodeTraverser.php b/lib/PhpParser/NodeTraverser.php
index ba6857b..38035ec 100644
--- a/lib/PhpParser/NodeTraverser.php
+++ b/lib/PhpParser/NodeTraverser.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -19,7 +19,7 @@ class NodeTraverser implements NodeTraverserInterface
*
* @param bool $cloneNodes Should the traverser clone the nodes when traversing the AST
*/
- public function __construct($cloneNodes = true) {
+ public function __construct(bool $cloneNodes = true) {
$this->visitors = array();
$this->cloneNodes = $cloneNodes;
}
@@ -54,7 +54,7 @@ class NodeTraverser implements NodeTraverserInterface
*
* @return Node[] Traversed array of nodes
*/
- public function traverse(array $nodes) {
+ public function traverse(array $nodes) : array {
foreach ($this->visitors as $visitor) {
if (null !== $return = $visitor->beforeTraverse($nodes)) {
$nodes = $return;
diff --git a/lib/PhpParser/NodeTraverserInterface.php b/lib/PhpParser/NodeTraverserInterface.php
index 0752de2..d42f405 100644
--- a/lib/PhpParser/NodeTraverserInterface.php
+++ b/lib/PhpParser/NodeTraverserInterface.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -43,6 +43,6 @@ interface NodeTraverserInterface
*
* @return Node[] Traversed array of nodes
*/
- function traverse(array $nodes);
+ function traverse(array $nodes) : array;
}
diff --git a/lib/PhpParser/NodeVisitor.php b/lib/PhpParser/NodeVisitor.php
index 706a5d2..c5ba91d 100644
--- a/lib/PhpParser/NodeVisitor.php
+++ b/lib/PhpParser/NodeVisitor.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/lib/PhpParser/NodeVisitor/NameResolver.php b/lib/PhpParser/NodeVisitor/NameResolver.php
index 52b0587..2a96a53 100644
--- a/lib/PhpParser/NodeVisitor/NameResolver.php
+++ b/lib/PhpParser/NodeVisitor/NameResolver.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\NodeVisitor;
diff --git a/lib/PhpParser/NodeVisitorAbstract.php b/lib/PhpParser/NodeVisitorAbstract.php
index 3e1743a..ded982a 100644
--- a/lib/PhpParser/NodeVisitorAbstract.php
+++ b/lib/PhpParser/NodeVisitorAbstract.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/lib/PhpParser/Parser.php b/lib/PhpParser/Parser.php
index 8825251..976ac3c 100644
--- a/lib/PhpParser/Parser.php
+++ b/lib/PhpParser/Parser.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/lib/PhpParser/ParserAbstract.php b/lib/PhpParser/ParserAbstract.php
index 31f266f..5f94cbf 100644
--- a/lib/PhpParser/ParserAbstract.php
+++ b/lib/PhpParser/ParserAbstract.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -97,7 +97,7 @@ abstract class ParserAbstract
*
* @return Node[] Array of statements
*/
- public function parse($code) {
+ public function parse(string $code) : array {
$this->lexer->startLexing($code);
// We start off with no lookahead-token
@@ -308,7 +308,7 @@ abstract class ParserAbstract
* @param Node[] $stmts
* @return Node[]
*/
- protected function handleNamespaces(array $stmts) {
+ protected function handleNamespaces(array $stmts) : array {
$style = $this->getNamespacingStyle($stmts);
if (null === $style) {
// not namespaced, nothing to do
diff --git a/lib/PhpParser/PrettyPrinter/Standard.php b/lib/PhpParser/PrettyPrinter/Standard.php
index a52eefe..5225f10 100644
--- a/lib/PhpParser/PrettyPrinter/Standard.php
+++ b/lib/PhpParser/PrettyPrinter/Standard.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\PrettyPrinter;
diff --git a/lib/PhpParser/PrettyPrinterAbstract.php b/lib/PhpParser/PrettyPrinterAbstract.php
index 94578ca..231c400 100644
--- a/lib/PhpParser/PrettyPrinterAbstract.php
+++ b/lib/PhpParser/PrettyPrinterAbstract.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -86,7 +86,7 @@ abstract class PrettyPrinterAbstract
*
* @return string Pretty printed statements
*/
- public function prettyPrint(array $stmts) {
+ public function prettyPrint(array $stmts) : string {
$this->preprocessNodes($stmts);
return ltrim(str_replace("\n" . $this->noIndentToken, "\n", $this->pStmts($stmts, false)));
@@ -99,7 +99,7 @@ abstract class PrettyPrinterAbstract
*
* @return string Pretty printed node
*/
- public function prettyPrintExpr(Expr $node) {
+ public function prettyPrintExpr(Expr $node) : string {
return str_replace("\n" . $this->noIndentToken, "\n", $this->p($node));
}
@@ -110,7 +110,7 @@ abstract class PrettyPrinterAbstract
*
* @return string Pretty printed statements
*/
- public function prettyPrintFile(array $stmts) {
+ public function prettyPrintFile(array $stmts) : string {
$p = rtrim($this->prettyPrint($stmts));
$p = preg_replace('/^\?>\n?/', '', $p, -1, $count);
@@ -146,7 +146,7 @@ abstract class PrettyPrinterAbstract
*
* @return string Pretty printed statements
*/
- protected function pStmts(array $nodes, $indent = true) {
+ protected function pStmts(array $nodes, bool $indent = true) : string {
$result = '';
foreach ($nodes as $node) {
$result .= "\n"
@@ -169,7 +169,7 @@ abstract class PrettyPrinterAbstract
*
* @return string Pretty printed node
*/
- protected function p(Node $node) {
+ protected function p(Node $node) : string {
return $this->{'p' . $node->getType()}($node);
}
@@ -203,7 +203,7 @@ abstract class PrettyPrinterAbstract
*
* @return string The pretty printed node
*/
- protected function pPrec(Node $node, $parentPrecedence, $parentAssociativity, $childPosition) {
+ protected function pPrec(Node $node, int $parentPrecedence, int $parentAssociativity, int $childPosition) : string {
$type = $node->getType();
if (isset($this->precedenceMap[$type])) {
$childPrecedence = $this->precedenceMap[$type][0];
@@ -225,7 +225,7 @@ abstract class PrettyPrinterAbstract
*
* @return string Imploded pretty printed nodes
*/
- protected function pImplode(array $nodes, $glue = '') {
+ protected function pImplode(array $nodes, string $glue = '') : string {
$pNodes = array();
foreach ($nodes as $node) {
$pNodes[] = $this->p($node);
@@ -241,7 +241,7 @@ abstract class PrettyPrinterAbstract
*
* @return string Comma separated pretty printed nodes
*/
- protected function pCommaSeparated(array $nodes) {
+ protected function pCommaSeparated(array $nodes) : string {
return $this->pImplode($nodes, ', ');
}
@@ -252,7 +252,7 @@ abstract class PrettyPrinterAbstract
*
* @return mixed String marked with $this->noIndentToken's.
*/
- protected function pNoIndent($string) {
+ protected function pNoIndent(string $string) {
return str_replace("\n", "\n" . $this->noIndentToken, $string);
}
diff --git a/lib/PhpParser/Serializer.php b/lib/PhpParser/Serializer.php
index 7c173cd..ea46c16 100644
--- a/lib/PhpParser/Serializer.php
+++ b/lib/PhpParser/Serializer.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -11,5 +11,5 @@ interface Serializer
*
* @return string Serialized string
*/
- public function serialize(array $nodes);
+ public function serialize(array $nodes) : string;
}
\ No newline at end of file
diff --git a/lib/PhpParser/Serializer/XML.php b/lib/PhpParser/Serializer/XML.php
index a21b1ee..2525fba 100644
--- a/lib/PhpParser/Serializer/XML.php
+++ b/lib/PhpParser/Serializer/XML.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Serializer;
@@ -20,7 +20,7 @@ class XML implements Serializer
$this->writer->setIndent(true);
}
- public function serialize(array $nodes) {
+ public function serialize(array $nodes) : string {
$this->writer->flush();
$this->writer->startDocument('1.0', 'UTF-8');
diff --git a/lib/PhpParser/Unserializer.php b/lib/PhpParser/Unserializer.php
index bfa6da0..9f0c42f 100644
--- a/lib/PhpParser/Unserializer.php
+++ b/lib/PhpParser/Unserializer.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -11,5 +11,5 @@ interface Unserializer
*
* @return mixed Node tree
*/
- public function unserialize($string);
+ public function unserialize(string $string);
}
diff --git a/lib/PhpParser/Unserializer/XML.php b/lib/PhpParser/Unserializer/XML.php
index 1d8405f..aba44cf 100644
--- a/lib/PhpParser/Unserializer/XML.php
+++ b/lib/PhpParser/Unserializer/XML.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Unserializer;
@@ -14,7 +14,7 @@ class XML implements Unserializer
$this->reader = new XMLReader;
}
- public function unserialize($string) {
+ public function unserialize(string $string) {
$this->reader->XML($string);
$this->reader->read();
diff --git a/lib/bootstrap.php b/lib/bootstrap.php
index b0f5178..23b21c8 100644
--- a/lib/bootstrap.php
+++ b/lib/bootstrap.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
if (!class_exists('PhpParser\Autoloader')) {
require __DIR__ . '/PhpParser/Autoloader.php';
diff --git a/test/PhpParser/AutoloaderTest.php b/test/PhpParser/AutoloaderTest.php
index cc57364..3a8ae30 100644
--- a/test/PhpParser/AutoloaderTest.php
+++ b/test/PhpParser/AutoloaderTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/test/PhpParser/Builder/ClassTest.php b/test/PhpParser/Builder/ClassTest.php
index 94ce67a..a4ff99a 100644
--- a/test/PhpParser/Builder/ClassTest.php
+++ b/test/PhpParser/Builder/ClassTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
diff --git a/test/PhpParser/Builder/FunctionTest.php b/test/PhpParser/Builder/FunctionTest.php
index 88fb205..786780b 100644
--- a/test/PhpParser/Builder/FunctionTest.php
+++ b/test/PhpParser/Builder/FunctionTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
diff --git a/test/PhpParser/Builder/InterfaceTest.php b/test/PhpParser/Builder/InterfaceTest.php
index c0d2fe3..89321cd 100644
--- a/test/PhpParser/Builder/InterfaceTest.php
+++ b/test/PhpParser/Builder/InterfaceTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
diff --git a/test/PhpParser/Builder/MethodTest.php b/test/PhpParser/Builder/MethodTest.php
index 668d13f..099e762 100644
--- a/test/PhpParser/Builder/MethodTest.php
+++ b/test/PhpParser/Builder/MethodTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
diff --git a/test/PhpParser/Builder/NamespaceTest.php b/test/PhpParser/Builder/NamespaceTest.php
index 54e8c93..f6f8c4f 100644
--- a/test/PhpParser/Builder/NamespaceTest.php
+++ b/test/PhpParser/Builder/NamespaceTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
diff --git a/test/PhpParser/Builder/ParamTest.php b/test/PhpParser/Builder/ParamTest.php
index f71a10c..95f04e3 100644
--- a/test/PhpParser/Builder/ParamTest.php
+++ b/test/PhpParser/Builder/ParamTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
diff --git a/test/PhpParser/Builder/PropertyTest.php b/test/PhpParser/Builder/PropertyTest.php
index 1e62173..aff11aa 100644
--- a/test/PhpParser/Builder/PropertyTest.php
+++ b/test/PhpParser/Builder/PropertyTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
diff --git a/test/PhpParser/Builder/TraitTest.php b/test/PhpParser/Builder/TraitTest.php
index d52185c..85721ed 100644
--- a/test/PhpParser/Builder/TraitTest.php
+++ b/test/PhpParser/Builder/TraitTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Builder;
diff --git a/test/PhpParser/Builder/UseTest.php b/test/PhpParser/Builder/UseTest.php
index 79a2cb8..afdffe0 100644
--- a/test/PhpParser/Builder/UseTest.php
+++ b/test/PhpParser/Builder/UseTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
use PhpParser\Builder;
use PhpParser\Node\Name;
diff --git a/test/PhpParser/BuilderFactoryTest.php b/test/PhpParser/BuilderFactoryTest.php
index bc4e559..8c383b1 100644
--- a/test/PhpParser/BuilderFactoryTest.php
+++ b/test/PhpParser/BuilderFactoryTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/test/PhpParser/CodeTestAbstract.php b/test/PhpParser/CodeTestAbstract.php
index d22617e..36e81ed 100644
--- a/test/PhpParser/CodeTestAbstract.php
+++ b/test/PhpParser/CodeTestAbstract.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/test/PhpParser/CommentTest.php b/test/PhpParser/CommentTest.php
index 96db6e6..9c2807e 100644
--- a/test/PhpParser/CommentTest.php
+++ b/test/PhpParser/CommentTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/test/PhpParser/ErrorTest.php b/test/PhpParser/ErrorTest.php
index 62c03dc..e1502f4 100644
--- a/test/PhpParser/ErrorTest.php
+++ b/test/PhpParser/ErrorTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/test/PhpParser/Lexer/EmulativeTest.php b/test/PhpParser/Lexer/EmulativeTest.php
index 34eb65e..f3fbe91 100644
--- a/test/PhpParser/Lexer/EmulativeTest.php
+++ b/test/PhpParser/Lexer/EmulativeTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Lexer;
diff --git a/test/PhpParser/LexerTest.php b/test/PhpParser/LexerTest.php
index e72ded2..f95cfc3 100644
--- a/test/PhpParser/LexerTest.php
+++ b/test/PhpParser/LexerTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/test/PhpParser/Node/NameTest.php b/test/PhpParser/Node/NameTest.php
index 1b20ae3..75c8d43 100644
--- a/test/PhpParser/Node/NameTest.php
+++ b/test/PhpParser/Node/NameTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node;
diff --git a/test/PhpParser/Node/Scalar/MagicConstTest.php b/test/PhpParser/Node/Scalar/MagicConstTest.php
index 3141f56..8dce0e3 100644
--- a/test/PhpParser/Node/Scalar/MagicConstTest.php
+++ b/test/PhpParser/Node/Scalar/MagicConstTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
diff --git a/test/PhpParser/Node/Scalar/StringTest.php b/test/PhpParser/Node/Scalar/StringTest.php
index be39035..6bd350a 100644
--- a/test/PhpParser/Node/Scalar/StringTest.php
+++ b/test/PhpParser/Node/Scalar/StringTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Scalar;
diff --git a/test/PhpParser/Node/Stmt/ClassMethodTest.php b/test/PhpParser/Node/Stmt/ClassMethodTest.php
index cbc168a..c456b1e 100644
--- a/test/PhpParser/Node/Stmt/ClassMethodTest.php
+++ b/test/PhpParser/Node/Stmt/ClassMethodTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
diff --git a/test/PhpParser/Node/Stmt/ClassTest.php b/test/PhpParser/Node/Stmt/ClassTest.php
index 464b2ae..232b1ed 100644
--- a/test/PhpParser/Node/Stmt/ClassTest.php
+++ b/test/PhpParser/Node/Stmt/ClassTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
diff --git a/test/PhpParser/Node/Stmt/InterfaceTest.php b/test/PhpParser/Node/Stmt/InterfaceTest.php
index c499058..739adde 100644
--- a/test/PhpParser/Node/Stmt/InterfaceTest.php
+++ b/test/PhpParser/Node/Stmt/InterfaceTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
diff --git a/test/PhpParser/Node/Stmt/PropertyTest.php b/test/PhpParser/Node/Stmt/PropertyTest.php
index a7efcd3..54b702f 100644
--- a/test/PhpParser/Node/Stmt/PropertyTest.php
+++ b/test/PhpParser/Node/Stmt/PropertyTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Node\Stmt;
diff --git a/test/PhpParser/NodeAbstractTest.php b/test/PhpParser/NodeAbstractTest.php
index dc2e6f7..338fd27 100644
--- a/test/PhpParser/NodeAbstractTest.php
+++ b/test/PhpParser/NodeAbstractTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -6,18 +6,18 @@ class DummyNode extends NodeAbstract {
public $subNode1;
public $subNode2;
- public function __construct($subNode1, $subNode2, $attributes) {
+ public function __construct($subNode1, $subNode2, array $attributes) {
parent::__construct(null, $attributes);
$this->subNode1 = $subNode1;
$this->subNode2 = $subNode2;
}
- public function getSubNodeNames() {
+ public function getSubNodeNames() : array {
return array('subNode1', 'subNode2');
}
// This method is only overwritten because the node is located in an unusual namespace
- public function getType() {
+ public function getType() : string {
return 'Dummy';
}
}
diff --git a/test/PhpParser/NodeDumperTest.php b/test/PhpParser/NodeDumperTest.php
index 306bc20..912b34c 100644
--- a/test/PhpParser/NodeDumperTest.php
+++ b/test/PhpParser/NodeDumperTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/test/PhpParser/NodeTraverserTest.php b/test/PhpParser/NodeTraverserTest.php
index 3b702ea..1fd400c 100644
--- a/test/PhpParser/NodeTraverserTest.php
+++ b/test/PhpParser/NodeTraverserTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/test/PhpParser/NodeVisitor/NameResolverTest.php b/test/PhpParser/NodeVisitor/NameResolverTest.php
index 182ef93..9e0c8ea 100644
--- a/test/PhpParser/NodeVisitor/NameResolverTest.php
+++ b/test/PhpParser/NodeVisitor/NameResolverTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\NodeVisitor;
diff --git a/test/PhpParser/ParserTest.php b/test/PhpParser/ParserTest.php
index 4d4db0e..c0a4fe2 100644
--- a/test/PhpParser/ParserTest.php
+++ b/test/PhpParser/ParserTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
@@ -140,7 +140,7 @@ EOC;
}
class InvalidTokenLexer extends Lexer {
- public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) {
+ public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) : int {
$value = 'foobar';
return 999;
}
diff --git a/test/PhpParser/PrettyPrinterTest.php b/test/PhpParser/PrettyPrinterTest.php
index 6415b06..6eefd2c 100644
--- a/test/PhpParser/PrettyPrinterTest.php
+++ b/test/PhpParser/PrettyPrinterTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser;
diff --git a/test/PhpParser/Serializer/XMLTest.php b/test/PhpParser/Serializer/XMLTest.php
index 78370c6..7a3ab49 100644
--- a/test/PhpParser/Serializer/XMLTest.php
+++ b/test/PhpParser/Serializer/XMLTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Serializer;
diff --git a/test/PhpParser/Unserializer/XMLTest.php b/test/PhpParser/Unserializer/XMLTest.php
index 8ee5d7b..4eac5bf 100644
--- a/test/PhpParser/Unserializer/XMLTest.php
+++ b/test/PhpParser/Unserializer/XMLTest.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
namespace PhpParser\Unserializer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment