Further modules included.
[yaffs-website] / web / modules / contrib / drupalmoduleupgrader / src / Plugin / DMU / Converter / HookWatchdog.php
1 <?php
2
3 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter;
4
5 use Drupal\drupalmoduleupgrader\ConverterBase;
6 use Drupal\drupalmoduleupgrader\TargetInterface;
7
8 /**
9  * @Converter(
10  *  id = "hook_watchdog",
11  *  description = @Translation("Converts hook_watchdog() to an implementation of \\Psr\\Log\\LoggerInterface."),
12  *  hook = "hook_watchdog"
13  * )
14  */
15 class HookWatchdog extends ConverterBase {
16
17   /**
18    * {@inheritdoc}
19    */
20   public function convert(TargetInterface $target) {
21     $this->writeService($target, 'default_logger', [
22       'class' => 'Drupal\\' . $target->id() . '\\Logger\\DefaultLogger',
23       'tags' => [
24         [ 'name' => 'logger' ],
25       ],
26     ]);
27
28     $render = [
29       '#theme' => 'dmu_logger',
30       '#module' => $target->id(),
31     ];
32     $this->writeClass($target, $this->parse($render));
33   }
34
35 }