Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function findMatching($route, $host)
 {
     if ($this->cache->contains($this->getCacheKey())) {
         return $this->cache->fetch($this->getCacheKey());
     }
     $rules = $this->ruleProvider->getRules();
     $this->cache->save($this->getCacheKey(), $rules, $this->ttl);
     return $rules;
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function resolve(Request $request)
 {
     $host = $this->extractHost($request);
     $route = $this->extractRoute($request);
     try {
         return $this->ruleProvider->findMatching($route, $host)->getTags();
     } catch (RuleNotFoundException $e) {
         return [];
     }
 }