Skip to content

Commit 2131462

Browse files
committed
Fix compatibility by removing type constraints
1 parent 77af09b commit 2131462

File tree

7 files changed

+43
-39
lines changed

7 files changed

+43
-39
lines changed

src/main/php/com/handlebarsjs/BlockNode.class.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ class BlockNode extends Node {
1919
/**
2020
* Creates a new section node
2121
*
22-
* @param string $name
23-
* @param var[] $options
24-
* @param com.github.mustache.NodeList $fn
25-
* @param com.github.mustache.NodeList $inverse
26-
* @param string $start
27-
* @param string $end
22+
* @param string $name
23+
* @param var[] $options
24+
* @param ?com.github.mustache.NodeList $fn
25+
* @param ?com.github.mustache.NodeList $inverse
26+
* @param string $start
27+
* @param string $end
2828
*/
29-
public function __construct($name, $options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') {
29+
public function __construct($name, $options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') {
3030
$this->name= $name;
3131
$this->options= $options;
3232
$this->fn= $fn ?? new NodeList();

src/main/php/com/handlebarsjs/EachBlockHelper.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ class EachBlockHelper extends BlockNode {
1111
/**
1212
* Creates a new with block helper
1313
*
14-
* @param string[] $options
15-
* @param com.github.mustache.NodeList $fn
16-
* @param com.github.mustache.NodeList $inverse
17-
* @param string $start
18-
* @param string $end
14+
* @param string[] $options
15+
* @param ?com.github.mustache.NodeList $fn
16+
* @param ?com.github.mustache.NodeList $inverse
17+
* @param string $start
18+
* @param string $end
1919
*/
20-
public function __construct($options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') {
20+
public function __construct($options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') {
2121
parent::__construct('each', $options, $fn, $inverse, $start, $end);
2222
$this->params= isset($options[1]) ? cast($options[1], BlockParams::class)->names : [];
2323
}

src/main/php/com/handlebarsjs/HandlebarsEngine.class.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ static function __static() {
3535
];
3636
}
3737

38-
/** Create new instance and initialize builtin helpers */
39-
public function __construct(HandlebarsParser $parser= null) {
38+
/**
39+
* Create new instance and initialize builtin helpers
40+
*
41+
* @param ?com.handlebarsjs.HandlebarsParser $parser
42+
*/
43+
public function __construct($parser= null) {
4044
$this->parser= $parser ?? new HandlebarsParser();
4145
$this->templates= new Templates();
4246
$this->helpers= self::$builtin;

src/main/php/com/handlebarsjs/IfBlockHelper.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ class IfBlockHelper extends BlockNode {
1010
/**
1111
* Creates a new with block helper
1212
*
13-
* @param string[] $options
14-
* @param com.github.mustache.NodeList $fn
15-
* @param com.github.mustache.NodeList $inverse
16-
* @param string $start
17-
* @param string $end
13+
* @param string[] $options
14+
* @param ?com.github.mustache.NodeList $fn
15+
* @param ?com.github.mustache.NodeList $inverse
16+
* @param string $start
17+
* @param string $end
1818
*/
19-
public function __construct($options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') {
19+
public function __construct($options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') {
2020
parent::__construct('if', $options, $fn, $inverse, $start, $end);
2121
}
2222

src/main/php/com/handlebarsjs/PartialBlockHelper.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ class PartialBlockHelper extends BlockNode {
1313
/**
1414
* Creates a new with block helper
1515
*
16-
* @param string[] $options
17-
* @param com.github.mustache.NodeList $fn
18-
* @param com.github.mustache.NodeList $inverse
19-
* @param string $start
20-
* @param string $end
16+
* @param string[] $options
17+
* @param ?com.github.mustache.NodeList $fn
18+
* @param ?com.github.mustache.NodeList $inverse
19+
* @param string $start
20+
* @param string $end
2121
*/
22-
public function __construct($options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') {
22+
public function __construct($options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') {
2323
$template= (string)array_shift($options);
2424
parent::__construct($template, $options, $fn, $inverse, $start, $end);
2525
}

src/main/php/com/handlebarsjs/UnlessBlockHelper.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ class UnlessBlockHelper extends BlockNode {
1010
/**
1111
* Creates a new with block helper
1212
*
13-
* @param string[] $options
14-
* @param com.github.mustache.NodeList $fn
15-
* @param com.github.mustache.NodeList $inverse
16-
* @param string $start
17-
* @param string $end
13+
* @param string[] $options
14+
* @param ?com.github.mustache.NodeList $fn
15+
* @param ?com.github.mustache.NodeList $inverse
16+
* @param string $start
17+
* @param string $end
1818
*/
19-
public function __construct($options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') {
19+
public function __construct($options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') {
2020
parent::__construct('unless', $options, $fn, $inverse, $start, $end);
2121
}
2222

src/main/php/com/handlebarsjs/WithBlockHelper.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ class WithBlockHelper extends BlockNode {
1111
/**
1212
* Creates a new with block helper
1313
*
14-
* @param string[] $options
15-
* @param com.github.mustache.NodeList $fn
16-
* @param com.github.mustache.NodeList $inverse
17-
* @param string $start
18-
* @param string $end
14+
* @param string[] $options
15+
* @param ?com.github.mustache.NodeList $fn
16+
* @param ?com.github.mustache.NodeList $inverse
17+
* @param string $start
18+
* @param string $end
1919
*/
20-
public function __construct($options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') {
20+
public function __construct($options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') {
2121
parent::__construct('with', $options, $fn, $inverse, $start, $end);
2222
$this->alias= isset($options[1]) ? cast($options[1], BlockParams::class)->names[0] : null;
2323
}

0 commit comments

Comments
 (0)