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