title: Concatenate attributes in Symfony forms
body: <p>I have a <code>symfony</code> form of following structure.</p>
  
  <pre><code>if (!$propertyId) {
          $form-&gt;add('room-type', 'choice', [
              'label' =&gt; false,
              'choices' =&gt; $this-&gt;di-&gt;get("roomType")-&gt;getRoomByPropertyId($propertyId),
              'placeholder' =&gt; 'All Room types',
              'attr' =&gt; ['class' =&gt; 'room-type-id hidden']
          ]);
      } else {
          $form-&gt;add('room-type', 'choice', [
             'label' =&gt; false,
             'choices' =&gt; $this-&gt;di-&gt;get("roomType")-&gt;getRoomByPropertyId($propertyId),
             'placeholder' =&gt; 'All Room types',
             'attr' =&gt; ['class' =&gt; 'room-type-id']
          ]);
      }
  </code></pre>
  
  <p>I want to refactor this so that I can concatenate the <code>hidden</code> attribute if <code>propertyId</code> is <code>null</code>.</p>
  
  <p>Something like this and various other combinations that I have tried is not working.</p>
  
  <p><code>['class' =&gt; 'room-type-id' + isset($propertyId) ? '' : 'hidden']</code></p>
  
  <p>How can I accomplish this?</p>