Use named arguments for FunctionCall constraints
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3565226. -->
Reported by: [lussoluca](https://www.drupal.org/user/138068)
Related to !222
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Drupal 11.3 requires Symfony 7.4.</p>
<p>In Symfony 7.4, passing an array to constraint constructors is deprecated; we must use named arguments instead. See <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/3522497" title="Status: Closed (fixed)">#3522497: Passing an $options array to constraint constructors is deprecated, use named arguments instead</a></span>.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Ask the chatbot, or the agent explorer, to create a content type or a vocabulary. You get an error like "Unknown named parameter $value".</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Use named arguments on constraint definitions in FunctionCall.</p>
<p>From:</p>
<pre>constraints: ['Regex' => '/^[a-zA-Z0-9_]+$/'],</pre><p>to:</p>
<pre>constraints: ['Regex' => ['pattern' => '/^[a-zA-Z0-9_]+$/']],</pre><h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>Review the MR.</p>
<h3 id="summary-ui-changes">User interface changes</h3>
<p>None.</p>
<h3 id="summary-api-changes">API changes</h3>
<p>None.</p>
<h3 id="summary-data-model-changes">Data model changes</h3>
<p>None.</p>
issue