- ๐ท๐บRussia Chi
Overall, this will only mitigate the problem. Dropping render arrays is the only way to fully resolve the issue. Iโve filed a ticket in the ideas queue.
- ๐ท๐บRussia Chi
PHP has evolved a lot since this issue was created. Type hints, property promotion, named arguments, etc. So instead of builders we can create value objects. It'll give same DX in modern IDEs.
Builder
$variables['table'] = TableElement::create() ->setHeader($headers) ->setRows($rows) ->setAttributes(['id' => $table_id]) ->setTableDrag([ [ 'action' => 'order', 'relationship' => 'sibling', 'group' => $weight_class, ], ], )->toRenderArray();
Constructor
$variables['table'] = new TableElement( header: $headers, rows: $rows, attributes: ['id' => $table_id], tableDrag: [ [ 'action' => 'order', 'relationship' => 'sibling', 'group' => $weight_class, ], ], )->toRenderArray();
- ๐ซ๐ทFrance PhilY ๐ช๐บ๐ซ๐ท Paris, France
Patch #51 works for me using Drupal 10.3.9