Code Duplication    Length = 10-12 lines in 3 locations

src/AppBundle/Helper/AutomatedEditsHelper.php 3 locations

@@ 44-53 (lines=10) @@
41
     * @param  string  $summary Edit summary
42
     * @return boolean          Yes or no
43
     */
44
    public function isAutomated($summary)
45
    {
46
        foreach ($this->getTools() as $tool => $regex) {
47
            if (preg_match("/$regex/", $summary)) {
48
                return true;
49
            }
50
        }
51
52
        return false;
53
    }
54
55
    /**
56
     * Was the edit a revert, based on the edit summary?
@@ 60-71 (lines=12) @@
57
     * @param  string $summary Edit summary
58
     * @return boolean         Yes or no
59
     */
60
    public function isRevert($summary)
61
    {
62
        foreach ($this->revertTools as $tool) {
63
            $regex = $this->getTools()[$tool];
64
65
            if (preg_match("/$regex/", $summary)) {
66
                return true;
67
            }
68
        }
69
70
        return false;
71
    }
72
73
    /**
74
     * Get the name of the tool that matched the given edit summary
@@ 78-87 (lines=10) @@
75
     * @param  string $summary Edit summary
76
     * @return string|boolean  Name of tool, or false if nothing was found
77
     */
78
    public function getTool($summary)
79
    {
80
        foreach ($this->getTools() as $tool => $regex) {
81
            if (preg_match("/$regex/", $summary)) {
82
                return $tool;
83
            }
84
        }
85
86
        return false;
87
    }
88
89
    /**
90
     * Get the list of automated tools