icon_map in PHP annotation instead of layouts.yml I need to add an Icon to a layout added by a contrib module. But I see it is adding the layout via plugin PHP file instead of layouts.yml.
The annotation looks like following
/**
 * A very advanced custom layout.
 *
 * @Layout(
 *   id = &quot;lb_tabs_tabs&quot;,
 *   label = @Translation(&quot;Tabs&quot;),
 *   category = @Translation(&quot;Effects&quot;),
 *   path = &quot;layouts/tabs&quot;,
 *   template = &quot;lb-tabs-tabs&quot;,
 *   icon_map = &quot;&quot;
 * )
 */

I don't know how to represent the multidimensional array into this annotation form. When I tried simple [['region', 'region']] form it errored [Syntax Error] Expected PlainValue, got  '[' .
tried @Array(@Array('region', 'region')) as well but got
Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_CLOSE_PARENTHESIS, got '(' .
What is the correct way to add an icon_map there?
Also tried adding layouts.yml and moving these values to yml and the layout option just disappeared as a whole`.
You can do this via the layout alter hook ( hook_layout_alter(&amp;$definitions) ).  The definitions variable is an array of all the defined layouts keyed by the layout machine name.
The value here is a Drupal\Core\Layout\LayoutDefinition object.  This has a setIconMap method.  You can pass this an array of arrays that define the icon.
E.g. if the yml format is:
- [top]
- [first, second]
- [bottom]

the value is something like:
$map = [
  ['top'],
  ['first', 'second'],
  ['bottom']
]