Skip to content

Commit

Permalink
LCH-7174: Fixing deprecation of module_handler service.
Browse files Browse the repository at this point in the history
  • Loading branch information
narendradesai committed Nov 19, 2024
1 parent 3a53438 commit 44d0786
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/Command/PqCommands/ContentHubPqCodeCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,23 @@ protected function configure() {
*/
public function getHookImplementation(): array {
$hookImplementation = [];
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler */
$moduleHandler = $this->drupalServiceFactory->getDrupalService('module_handler');
foreach (ContentHubAudit::V1_MODULE_HOOKS as $hook) {
if (!empty($moduleList = $moduleHandler->getImplementations($hook))) {
$hookImplementation[$hook] = $moduleList;
if (method_exists($moduleHandler, 'invokeAllWith')) {
$moduleHandler->invokeAllWith(
$hook,
function (callable $hook, string $module) use (&$implementations) {
if (!empty($module)) {
$implementations[$hool][] = $module;

Check failure on line 90 in src/Command/PqCommands/ContentHubPqCodeCheck.php

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 7.4)

Undefined variable: $hool

Check failure on line 90 in src/Command/PqCommands/ContentHubPqCodeCheck.php

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 8.1)

Undefined variable: $hool

Check failure on line 90 in src/Command/PqCommands/ContentHubPqCodeCheck.php

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 8.2)

Undefined variable: $hool

Check failure on line 90 in src/Command/PqCommands/ContentHubPqCodeCheck.php

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 7.4)

Undefined variable: $hool

Check failure on line 90 in src/Command/PqCommands/ContentHubPqCodeCheck.php

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 8.1)

Undefined variable: $hool
}
}
);
}
else {
if (!empty($moduleList = $moduleHandler->getImplementations($hook))) {
$hookImplementation[$hook] = $moduleList;
}
}
}
return $hookImplementation;
Expand Down

0 comments on commit 44d0786

Please sign in to comment.