1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | /* |
||
6 | * This is part of the league/commonmark package. |
||
7 | * |
||
8 | * (c) Martin HasoĊ <[email protected]> |
||
9 | * (c) Webuni s.r.o. <[email protected]> |
||
10 | * (c) Colin O'Dell <[email protected]> |
||
11 | * |
||
12 | * For the full copyright and license information, please view the LICENSE |
||
13 | * file that was distributed with this source code. |
||
14 | */ |
||
15 | |||
16 | namespace League\CommonMark\Extension\Table; |
||
17 | |||
18 | use League\CommonMark\Environment\EnvironmentBuilderInterface; |
||
19 | use League\CommonMark\Extension\ConfigurableExtensionInterface; |
||
20 | use League\CommonMark\Renderer\HtmlDecorator; |
||
21 | use League\Config\ConfigurationBuilderInterface; |
||
22 | use Nette\Schema\Expect; |
||
23 | |||
24 | final class TableExtension implements ConfigurableExtensionInterface |
||
25 | { |
||
26 | public function configureSchema(ConfigurationBuilderInterface $builder): void |
||
27 | { |
||
28 | $attributeArraySchema = Expect::arrayOf( |
||
29 | Expect::type('string|string[]|bool'), // attribute value(s) |
||
30 | 'string' // attribute name |
||
31 | )->mergeDefaults(false); |
||
32 | |||
33 | $builder->addSchema('table', Expect::structure([ |
||
34 | 'wrap' => Expect::structure([ |
||
35 | 'enabled' => Expect::bool()->default(false), |
||
36 | 'tag' => Expect::string()->default('div'), |
||
37 | 'attributes' => Expect::arrayOf(Expect::string()), |
||
38 | ]), |
||
39 | 'alignment_attributes' => Expect::structure([ |
||
40 | 'left' => (clone $attributeArraySchema)->default(['align' => 'left']), |
||
41 | 'center' => (clone $attributeArraySchema)->default(['align' => 'center']), |
||
42 | 'right' => (clone $attributeArraySchema)->default(['align' => 'right']), |
||
43 | ]), |
||
44 | 'max_autocompleted_cells' => Expect::int()->min(0)->default(TableParser::DEFAULT_MAX_AUTOCOMPLETED_CELLS), |
||
0 ignored issues
–
show
|
|||
45 | ])); |
||
46 | } |
||
47 | |||
48 | public function register(EnvironmentBuilderInterface $environment): void |
||
49 | { |
||
50 | $tableRenderer = new TableRenderer(); |
||
51 | if ($environment->getConfiguration()->get('table/wrap/enabled')) { |
||
52 | $tableRenderer = new HtmlDecorator($tableRenderer, $environment->getConfiguration()->get('table/wrap/tag'), $environment->getConfiguration()->get('table/wrap/attributes')); |
||
53 | } |
||
54 | |||
55 | $environment |
||
56 | ->addBlockStartParser(new TableStartParser($environment->getConfiguration()->get('table/max_autocompleted_cells'))) |
||
57 | |||
58 | ->addRenderer(Table::class, $tableRenderer) |
||
59 | ->addRenderer(TableSection::class, new TableSectionRenderer()) |
||
60 | ->addRenderer(TableRow::class, new TableRowRenderer()) |
||
61 | ->addRenderer(TableCell::class, new TableCellRenderer($environment->getConfiguration()->get('table/alignment_attributes'))); |
||
62 | } |
||
63 | } |
||
64 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths