MTrack/CommitChecker.php
[web.mtrack] / MTrack / CommitCheck / RequiresTimeReference.php
1 <?php 
2
3 require_once 'MTrack/Interface/CommitListener.php';
4
5 class MTrackCommitCheck_RequiresTimeReference implements IMTrackCommitListener {
6    
7
8   function vetoCommit($msg, $files, $actions, $checker) {
9     $spent = false;
10     foreach ($actions as $act) {
11       if (isset($act[2])) {
12         return true;
13       }
14     }
15     return "You must include at least one ticket and time reference in your\n".
16       "commit message, using the \"refs #123 (spent 2.5)\" notation.\n"
17       ;
18   }
19
20   function postCommit($msg, $files, $actions) {
21     return true;
22   }
23 }