Code Duplication    Length = 18-18 lines in 2 locations

src/Filter/Conjunction.php 1 location

@@ 14-31 (lines=18) @@
11
12
namespace Serafim\Stream\Filter;
13
14
class Conjunction extends BaseFilter
15
{
16
    /**
17
     * @param string $class
18
     * @param string $pathname
19
     * @return bool
20
     */
21
    public function match(string $class, string $pathname): bool
22
    {
23
        foreach ($this->filters as $filter) {
24
            if (! $filter($class, $pathname)) {
25
                return false;
26
            }
27
        }
28
29
        return true;
30
    }
31
}
32

src/Filter/Disjunction.php 1 location

@@ 14-31 (lines=18) @@
11
12
namespace Serafim\Stream\Filter;
13
14
class Disjunction extends BaseFilter
15
{
16
    /**
17
     * @param string $class
18
     * @param string $pathname
19
     * @return bool
20
     */
21
    public function match(string $class, string $pathname): bool
22
    {
23
        foreach ($this->filters as $filter) {
24
            if ($filter($class, $pathname)) {
25
                return true;
26
            }
27
        }
28
29
        return false;
30
    }
31
}
32