$context Contexto de la pagina actual * @return bool True si debe excluirse (NO mostrar) */ public function shouldExclude(array $context): bool { if (!$this->enabled) { return false; } // Evaluar cada tipo de exclusion (OR logico) if ($this->categoryExclusion->matches($context)) { return true; } if ($this->postIdExclusion->matches($context)) { return true; } if ($this->urlPatternExclusion->matches($context)) { return true; } return false; } /** * Verifica si tiene alguna regla configurada */ public function hasAnyRule(): bool { return $this->categoryExclusion->hasValues() || $this->postIdExclusion->hasValues() || $this->urlPatternExclusion->hasValues(); } public function getComponentName(): string { return $this->componentName; } public function isEnabled(): bool { return $this->enabled; } public function getCategoryExclusion(): CategoryExclusion { return $this->categoryExclusion; } public function getPostIdExclusion(): PostIdExclusion { return $this->postIdExclusion; } public function getUrlPatternExclusion(): UrlPatternExclusion { return $this->urlPatternExclusion; } /** * Crea una instancia sin exclusiones (por defecto) */ public static function empty(string $componentName): self { return new self( $componentName, false, CategoryExclusion::empty(), PostIdExclusion::empty(), UrlPatternExclusion::empty() ); } }