Skip to content

Commit

Permalink
Merge pull request #233 from ADmad/element-node
Browse files Browse the repository at this point in the history
Fix method signatures and use of defunct classes
  • Loading branch information
WyriHaximus authored Dec 30, 2019
2 parents a5a4c3f + 42b6d44 commit ec1d309
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions src/Lib/Twig/Node/Cell.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use Twig\Compiler;
use Twig\Node\Expression\AbstractExpression;
use Twig\Node\Expression\ArrayExpression;
use Twig\Node\Node;
use Twig\Node\NodeOutputInterface;

Expand All @@ -38,7 +39,7 @@ final class Cell extends Node implements NodeOutputInterface
* @param \Twig\Node\Expression\AbstractExpression $name Name.
* @param \Twig\Node\Expression\AbstractExpression $data Data array.
* @param \Twig\Node\Expression\AbstractExpression $options Options array.
* @param string $lineno Line number.
* @param int $lineno Line number.
* @param string $tag Tag name.
*/
public function __construct(
Expand All @@ -47,15 +48,15 @@ public function __construct(
AbstractExpression $name,
?AbstractExpression $data = null,
?AbstractExpression $options = null,
$lineno = '',
$tag = null
int $lineno = 0,
?string $tag = null
) {
if ($data === null) {
$data = new \Twig_Node_Expression_Array([], $lineno);
$data = new ArrayExpression([], $lineno);
}

if ($options === null) {
$options = new \Twig_Node_Expression_Array([], $lineno);
$options = new ArrayExpression([], $lineno);
}

parent::__construct(
Expand Down
11 changes: 6 additions & 5 deletions src/Lib/Twig/Node/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use Twig\Compiler;
use Twig\Node\Expression\AbstractExpression;
use Twig\Node\Expression\ArrayExpression;
use Twig\Node\Node;

/**
Expand All @@ -28,22 +29,22 @@ final class Element extends Node
* @param \Twig\Node\Expression\AbstractExpression $name Name.
* @param \Twig\Node\Expression\AbstractExpression $data Data.
* @param \Twig\Node\Expression\AbstractExpression $options Options.
* @param string $lineno Linenumber.
* @param int $lineno Linenumber.
* @param string $tag Tag.
*/
public function __construct(
AbstractExpression $name,
?AbstractExpression $data = null,
?AbstractExpression $options = null,
$lineno = '',
$tag = null
int $lineno = 0,
?string $tag = null
) {
if ($data === null) {
$data = new \Twig_Node_Expression_Array([], $lineno);
$data = new ArrayExpression([], $lineno);
}

if ($options === null) {
$options = new \Twig_Node_Expression_Array([], $lineno);
$options = new ArrayExpression([], $lineno);
}

parent::__construct(
Expand Down

0 comments on commit ec1d309

Please sign in to comment.