Problem description
MediaSmartContentProvider currently depends on the concrete AccessControlQueryEnhancer implementation instead of the corresponding AccessControlQueryEnhancerInterface.
The constructor currently uses:
public function __construct(
private EntityManagerInterface $entityManager,
private SmartContentQueryEnhancer $smartContentQueryEnhancer,
private TranslatorInterface $translator,
private WebspaceManagerInterface $webspaceManager,
private AccessControlQueryEnhancer $accessControlQueryEnhancer,
private ?Security $security,
private bool $hasAudienceTargeting = false,
private ?array $permissions = null,
)
The dependency should use AccessControlQueryEnhancerInterface instead:
private AccessControlQueryEnhancerInterface $accessControlQueryEnhancer,
This would allow the component to depend on the abstraction rather than a concrete implementation and makes it possible to provide a custom implementation through the interface.
Interface signature is out of sync
Additionally, the enhance() method of AccessControlQueryEnhancer has been extended with a new parameter:
string $entityIdField = 'id'
However, this parameter has not been added to AccessControlQueryEnhancerInterface.
The interface and its implementation should therefore expose the same method signature.
Proposed solution
Inject the Interface and and add the parameter to the interface ;-)
As always: I could provide the fix. The question is, should this be two PRs?
Problem description
MediaSmartContentProvider currently depends on the concrete AccessControlQueryEnhancer implementation instead of the corresponding AccessControlQueryEnhancerInterface.
The constructor currently uses:
The dependency should use AccessControlQueryEnhancerInterface instead:
private AccessControlQueryEnhancerInterface $accessControlQueryEnhancer,This would allow the component to depend on the abstraction rather than a concrete implementation and makes it possible to provide a custom implementation through the interface.
Interface signature is out of sync
Additionally, the enhance() method of AccessControlQueryEnhancer has been extended with a new parameter:
string $entityIdField = 'id'However, this parameter has not been added to AccessControlQueryEnhancerInterface.
The interface and its implementation should therefore expose the same method signature.
Proposed solution
Inject the Interface and and add the parameter to the interface ;-)
As always: I could provide the fix. The question is, should this be two PRs?