Code Duplication    Length = 17-17 lines in 2 locations

src/Matcher/AnnotationScanMatcher.php 2 locations

@@ 44-60 (lines=17) @@
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function matchesClass(\ReflectionClass $class, array $arguments)
45
    {
46
        $count = 0;
47
        $annotation = $arguments[0];
48
        foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflectionMethod) {
49
            $match = $this->reader->getMethodAnnotation($reflectionMethod, $annotation);
50
            if ($match) {
51
                $count++;
52
            }
53
        }
54
        if ($count > 1) {
55
            return false;
56
        }
57
58
        return true;
59
    }
60
61
    /**
62
     * {@inheritdoc}
63
     */
@@ 64-80 (lines=17) @@
61
    /**
62
     * {@inheritdoc}
63
     */
64
    public function matchesMethod(\ReflectionMethod $method, array $arguments)
65
    {
66
        $count = 0;
67
        $annotation = $arguments[0];
68
        $reflectionClass = new \ReflectionClass($method->class);
69
        foreach ($reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflectionMethod) {
70
            $match = $this->reader->getMethodAnnotation($reflectionMethod, $annotation);
71
            if ($match) {
72
                $count++;
73
            }
74
        }
75
        if ($count > 1) {
76
            return false;
77
        }
78
79
        return true;
80
    }
81
}
82