1<?php
2
3declare(strict_types=1);
4
5/*
6 * This is part of the league/commonmark package.
7 *
8 * (c) Martin Hasoň <martin.hason@gmail.com>
9 * (c) Webuni s.r.o. <info@webuni.cz>
10 * (c) Colin O'Dell <colinodell@gmail.com>
11 *
12 * For the full copyright and license information, please view the LICENSE
13 * file that was distributed with this source code.
14 */
15
16namespace League\CommonMark\Extension\Table;
17
18use League\CommonMark\Block\Element\AbstractBlock;
19use League\CommonMark\Cursor;
20use League\CommonMark\Node\Node;
21
22final class TableRow extends AbstractBlock
23{
24    public function canContain(AbstractBlock $block): bool
25    {
26        return $block instanceof TableCell;
27    }
28
29    public function isCode(): bool
30    {
31        return false;
32    }
33
34    public function matchesNextLine(Cursor $cursor): bool
35    {
36        return false;
37    }
38
39    /**
40     * @return AbstractBlock[]
41     */
42    public function children(): iterable
43    {
44        return array_filter((array) parent::children(), static function (Node $child): bool {
45            return $child instanceof AbstractBlock;
46        });
47    }
48}
49