Lines 100.00% 3 / 3
Functions and Methods 100.00% 3 / 3
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
AttributeFilter 100.00% 3 / 3 100.00% 3 / 3 3 100.00% 1 / 1
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 excludes 100.00% 1 / 1 100.00% 1 / 1 1
 includes 100.00% 1 / 1 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Codegen\Attribute;
6
7final readonly class AttributeFilter
8{
9    public function __construct(
10        public string $domain,
11        public KeyPatterns $include = new KeyPatterns(),
12        public KeyPatterns $exclude = new KeyPatterns(),
13    ) {}
14
15    public function excludes(string $key): bool
16    {
17        return $this->exclude->matches($key);
18    }
19
20    public function includes(string $key): bool
21    {
22        return $this->include->matches($key);
23    }
24}