Basic prototype to handle Github webhooks

This commit is contained in:
Frédéric Guillot
2014-09-22 14:31:12 +02:00
parent eeb4688dcc
commit ab1a4760ed
7 changed files with 168 additions and 2 deletions

View File

@@ -696,4 +696,22 @@ class Task extends Base
return false;
}
/**
* Get a the task id from a text
*
* Example: "Fix bug #1234" will return 1234
*
* @access public
* @param string $message Text
* @return integer
*/
public function getTaskIdFromText($message)
{
if (preg_match('!#(\d+)!i', $message, $matches) && isset($matches[1])) {
return $matches[1];
}
return 0;
}
}