use Wallabag\CoreBundle\Repository\EntryRepository;
use Wallabag\CoreBundle\Repository\TagRepository;
use Wallabag\UserBundle\Entity\User;
+use Psr\Log\LoggerInterface;
class RuleBasedTagger
{
private $tagRepository;
private $entryRepository;
- public function __construct(RulerZ $rulerz, TagRepository $tagRepository, EntryRepository $entryRepository)
+ public function __construct(RulerZ $rulerz, TagRepository $tagRepository, EntryRepository $entryRepository, LoggerInterface $logger)
{
$this->rulerz = $rulerz;
$this->tagRepository = $tagRepository;
$this->entryRepository = $entryRepository;
+ $this->logger = $logger;
}
/**
continue;
}
+ $this->logger->info('Matching rule.', [
+ 'rule' => $rule->getRule(),
+ 'tags' => $rule->getTags(),
+ ]);
+
foreach ($rule->getTags() as $label) {
$tag = $this->getTag($label);