diff --git a/src/main/php/com/handlebarsjs/BlockNode.class.php b/src/main/php/com/handlebarsjs/BlockNode.class.php index f930b46..78eba3f 100755 --- a/src/main/php/com/handlebarsjs/BlockNode.class.php +++ b/src/main/php/com/handlebarsjs/BlockNode.class.php @@ -19,14 +19,14 @@ class BlockNode extends Node { /** * Creates a new section node * - * @param string $name - * @param var[] $options - * @param com.github.mustache.NodeList $fn - * @param com.github.mustache.NodeList $inverse - * @param string $start - * @param string $end + * @param string $name + * @param var[] $options + * @param ?com.github.mustache.NodeList $fn + * @param ?com.github.mustache.NodeList $inverse + * @param string $start + * @param string $end */ - public function __construct($name, $options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') { + public function __construct($name, $options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') { $this->name= $name; $this->options= $options; $this->fn= $fn ?? new NodeList(); diff --git a/src/main/php/com/handlebarsjs/EachBlockHelper.class.php b/src/main/php/com/handlebarsjs/EachBlockHelper.class.php index 795f7d7..53d8303 100755 --- a/src/main/php/com/handlebarsjs/EachBlockHelper.class.php +++ b/src/main/php/com/handlebarsjs/EachBlockHelper.class.php @@ -11,13 +11,13 @@ class EachBlockHelper extends BlockNode { /** * Creates a new with block helper * - * @param string[] $options - * @param com.github.mustache.NodeList $fn - * @param com.github.mustache.NodeList $inverse - * @param string $start - * @param string $end + * @param string[] $options + * @param ?com.github.mustache.NodeList $fn + * @param ?com.github.mustache.NodeList $inverse + * @param string $start + * @param string $end */ - public function __construct($options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') { + public function __construct($options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') { parent::__construct('each', $options, $fn, $inverse, $start, $end); $this->params= isset($options[1]) ? cast($options[1], BlockParams::class)->names : []; } diff --git a/src/main/php/com/handlebarsjs/HandlebarsEngine.class.php b/src/main/php/com/handlebarsjs/HandlebarsEngine.class.php index ef173d3..9b8220a 100755 --- a/src/main/php/com/handlebarsjs/HandlebarsEngine.class.php +++ b/src/main/php/com/handlebarsjs/HandlebarsEngine.class.php @@ -35,8 +35,12 @@ static function __static() { ]; } - /** Create new instance and initialize builtin helpers */ - public function __construct(HandlebarsParser $parser= null) { + /** + * Create new instance and initialize builtin helpers + * + * @param ?com.handlebarsjs.HandlebarsParser $parser + */ + public function __construct($parser= null) { $this->parser= $parser ?? new HandlebarsParser(); $this->templates= new Templates(); $this->helpers= self::$builtin; diff --git a/src/main/php/com/handlebarsjs/IfBlockHelper.class.php b/src/main/php/com/handlebarsjs/IfBlockHelper.class.php index 7340177..dc914b5 100755 --- a/src/main/php/com/handlebarsjs/IfBlockHelper.class.php +++ b/src/main/php/com/handlebarsjs/IfBlockHelper.class.php @@ -10,13 +10,13 @@ class IfBlockHelper extends BlockNode { /** * Creates a new with block helper * - * @param string[] $options - * @param com.github.mustache.NodeList $fn - * @param com.github.mustache.NodeList $inverse - * @param string $start - * @param string $end + * @param string[] $options + * @param ?com.github.mustache.NodeList $fn + * @param ?com.github.mustache.NodeList $inverse + * @param string $start + * @param string $end */ - public function __construct($options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') { + public function __construct($options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') { parent::__construct('if', $options, $fn, $inverse, $start, $end); } diff --git a/src/main/php/com/handlebarsjs/PartialBlockHelper.class.php b/src/main/php/com/handlebarsjs/PartialBlockHelper.class.php index a1b09f5..9b452d9 100755 --- a/src/main/php/com/handlebarsjs/PartialBlockHelper.class.php +++ b/src/main/php/com/handlebarsjs/PartialBlockHelper.class.php @@ -13,13 +13,13 @@ class PartialBlockHelper extends BlockNode { /** * Creates a new with block helper * - * @param string[] $options - * @param com.github.mustache.NodeList $fn - * @param com.github.mustache.NodeList $inverse - * @param string $start - * @param string $end + * @param string[] $options + * @param ?com.github.mustache.NodeList $fn + * @param ?com.github.mustache.NodeList $inverse + * @param string $start + * @param string $end */ - public function __construct($options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') { + public function __construct($options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') { $template= (string)array_shift($options); parent::__construct($template, $options, $fn, $inverse, $start, $end); } diff --git a/src/main/php/com/handlebarsjs/UnlessBlockHelper.class.php b/src/main/php/com/handlebarsjs/UnlessBlockHelper.class.php index c8c0f7e..b029388 100755 --- a/src/main/php/com/handlebarsjs/UnlessBlockHelper.class.php +++ b/src/main/php/com/handlebarsjs/UnlessBlockHelper.class.php @@ -10,13 +10,13 @@ class UnlessBlockHelper extends BlockNode { /** * Creates a new with block helper * - * @param string[] $options - * @param com.github.mustache.NodeList $fn - * @param com.github.mustache.NodeList $inverse - * @param string $start - * @param string $end + * @param string[] $options + * @param ?com.github.mustache.NodeList $fn + * @param ?com.github.mustache.NodeList $inverse + * @param string $start + * @param string $end */ - public function __construct($options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') { + public function __construct($options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') { parent::__construct('unless', $options, $fn, $inverse, $start, $end); } diff --git a/src/main/php/com/handlebarsjs/WithBlockHelper.class.php b/src/main/php/com/handlebarsjs/WithBlockHelper.class.php index bd2c173..b5c1040 100755 --- a/src/main/php/com/handlebarsjs/WithBlockHelper.class.php +++ b/src/main/php/com/handlebarsjs/WithBlockHelper.class.php @@ -11,13 +11,13 @@ class WithBlockHelper extends BlockNode { /** * Creates a new with block helper * - * @param string[] $options - * @param com.github.mustache.NodeList $fn - * @param com.github.mustache.NodeList $inverse - * @param string $start - * @param string $end + * @param string[] $options + * @param ?com.github.mustache.NodeList $fn + * @param ?com.github.mustache.NodeList $inverse + * @param string $start + * @param string $end */ - public function __construct($options= [], NodeList $fn= null, NodeList $inverse= null, $start= '{{', $end= '}}') { + public function __construct($options= [], $fn= null, $inverse= null, $start= '{{', $end= '}}') { parent::__construct('with', $options, $fn, $inverse, $start, $end); $this->alias= isset($options[1]) ? cast($options[1], BlockParams::class)->names[0] : null; }