Incorrect type hint in rdf_sync_entity_bundle_field_info() hook implementation
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3529979. -->
Reported by: [alorenc](https://www.drupal.org/user/3603980)
Related to !39
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>In rdf_sync.module, the hook_entity_bundle_field_info() implementation incorrectly type-hints bundle parameter as string:<br>
<code>function rdf_sync_entity_bundle_field_info(EntityTypeInterface $entityType, string $bundle, array $baseFieldDefinitions): array {</code></p>
<p>According to the official Drupal API documentation, this hook may be invoked with $bundle = NULL when Drupal core or contrib modules (such as OG, TMGMT, or EntityFieldManager) attempt to retrieve field definitions for all bundles of a given entity type.</p>
<p>Strictly type-hinting $bundle as string violates Drupal's expected function signature and causes TypeError exceptions in PHP 8+ and Drupal 10/11 environments.</p>
<p>See <a href="https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21entity.api.php/function/hook_entity_bundle_field_info/11.x">https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21entity.api.php/function/hook_entity_bundle_field_info/11.x</a> </p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Relax the type hint to allow nullable $bundle:<br>
<code>function rdf_sync_entity_bundle_field_info(string $entity_type, ?string $bundle): array {</code></p>
issue