⬇️ Restore php-parser to its original version as tests are failing :/

This commit is contained in:
Pierre Goiffon
2021-03-29 16:51:10 +02:00
parent d62825c99b
commit afd9ddf46d
235 changed files with 13778 additions and 13877 deletions

View File

@@ -1,23 +1,22 @@
<?php declare(strict_types=1);
<?php
namespace PhpParser\Builder;
use PhpParser;
use PhpParser\BuilderHelpers;
use PhpParser\Node;
use PhpParser\Node\Stmt;
class Function_ extends FunctionLike
{
protected $name;
protected $stmts = [];
protected $stmts = array();
/**
* Creates a function builder.
*
* @param string $name Name of the function
*/
public function __construct(string $name) {
public function __construct($name) {
$this->name = $name;
}
@@ -29,7 +28,7 @@ class Function_ extends FunctionLike
* @return $this The builder instance (for fluid interface)
*/
public function addStmt($stmt) {
$this->stmts[] = BuilderHelpers::normalizeStmt($stmt);
$this->stmts[] = $this->normalizeNode($stmt);
return $this;
}
@@ -39,12 +38,12 @@ class Function_ extends FunctionLike
*
* @return Stmt\Function_ The built function node
*/
public function getNode() : Node {
return new Stmt\Function_($this->name, [
public function getNode() {
return new Stmt\Function_($this->name, array(
'byRef' => $this->returnByRef,
'params' => $this->params,
'returnType' => $this->returnType,
'stmts' => $this->stmts,
], $this->attributes);
), $this->attributes);
}
}