1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Add helper constructor with variadic

This commit is contained in:
Aidan Woods 2018-11-11 18:30:00 +00:00
parent 9046f066df
commit 822cf15ac9
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -25,11 +25,22 @@ final class Element implements Renderable
public function __construct( public function __construct(
string $name, string $name,
array $attributes, array $attributes,
?array $Components ?array $Contents
) { ) {
$this->name = $name; $this->name = $name;
$this->attributes = $attributes; $this->attributes = $attributes;
$this->Components = $Components; $this->Contents = $Contents;
}
/**
* @param string $name
* @param array<string, string> $attributes
* @param Renderable ...$Contents
*
*/
public static function new(string $name, array $attributes, Renderable ...$Contents): self
{
return new self($name, $attributes, $Contents);
} }
/** /**