diff --git a/src/Node/Block/Table.php b/src/Node/Block/Table.php index 21e3351..58ea820 100644 --- a/src/Node/Block/Table.php +++ b/src/Node/Block/Table.php @@ -47,10 +47,9 @@ public function __construct(string $layout = 'default', bool $isNumberColumnEnab public static function load(array $data, ?BlockNode $parent = null): self { - self::checkNodeData(static::class, $data, ['attrs']); - self::checkRequiredKeys(['layout', 'isNumberColumnEnabled'], $data['attrs']); + self::checkNodeData(static::class, $data); - $node = new self($data['attrs']['layout'], (bool) $data['attrs']['isNumberColumnEnabled'], $data['attrs']['localId'] ?? null, $parent); + $node = new self($data['attrs']['layout'] ?? self::LAYOUT_DEFAULT, (bool) $data['attrs']['isNumberColumnEnabled'] ?? false, $data['attrs']['localId'] ?? null, $parent); // set content if defined if (\array_key_exists('content', $data)) { diff --git a/src/Node/Inline/Mention.php b/src/Node/Inline/Mention.php index e88a1f0..421ce69 100644 --- a/src/Node/Inline/Mention.php +++ b/src/Node/Inline/Mention.php @@ -58,11 +58,11 @@ public function __construct(string $id, string $text, ?string $accessLevel = nul public static function load(array $data, ?BlockNode $parent = null): self { self::checkNodeData(static::class, $data); - self::checkRequiredKeys(['id', 'text'], $data['attrs']); + self::checkRequiredKeys(['id'], $data['attrs']); return new self( $data['attrs']['id'], - $data['attrs']['text'], + $data['attrs']['text'] ?? '', $data['attrs']['accessLevel'] ?? null, $data['attrs']['userType'] ?? null );