Issue #3616250: Declare every module whose classes a submodule names

Two submodules named a class from a module they do not declare, so neither could ship apart:

  • yoyaku_calendar named Drupal\yoyaku_payment\PaymentPolicyResolverInterface in AvailabilityFeed and SlotBookingForm.
  • yoyaku_orchestra named Drupal\yoyaku_manager\ResourceAccessInterface in its resource_managers audience.

The third one in the summary, yoyaku_placement naming yoyaku_cart's CartCheckoutEvent, is already gone: the controller asks the engine's BookingCartInterface and links the cart by route name.

The calendar's prices

The engine now owns the question as Drupal\yoyaku\PriceResolverInterface (priceForTarget(), currency(), formatAmount()), which PaymentPolicyResolverInterface extends. The calendar takes the engine's interface and keeps the same optional '@?yoyaku_payment.policy_resolver' argument, so the integration stays optional and typed. Same shape as PlacementProviderInterface and BookingCartInterface.

The resource manager audience

The audience exists only for that integration, so it moves to a yoyaku_orchestra_manager bridge depending on both sides, next to yoyaku_orchestra_order. Its optionality goes with it: no nullable resolver, no $container->has(), no early return that answered with nobody. Its config schema moves too, and yoyaku_orchestra_example depends on the bridge rather than on yoyaku_manager.

The check

tests/src/Unit/ModuleBoundariesTest resolves each module's transitive dependencies (against the whole codebase, so a module reached through another counts as declared, and core's required modules are exempt) and walks its shipped files for Drupal\<module>\. Tests and dot directories are out, as the issue asks. It was seen to fail on both violations before the fixes landed.

Coverage

The audience had no test at all, and the calendar's prices had none either (BookingCalendarTest says as much). Both now have one: ResourceManagersAudienceTest and CalendarPriceSeamTest.

Local: phpcs (Drupal and DrupalPractice), phpstan and cspell clean; kernel suites of yoyaku, yoyaku_calendar, yoyaku_manager, yoyaku_orchestra and yoyaku_payment green (105 classes), the two new classes green on MySQL too.

Merge request reports

Loading
Loading