1<?php
2
3/**
4 * Check that the method name is valid
5 *
6 */
7class gtIsValidMethod extends gtPreCondition {
8
9 public function check( $clo) {
10    if($clo->hasOption('m') ) {
11      $className = $clo->getOption('c');
12      $class = new ReflectionClass($className);
13      $methods = $class->getMethods();
14      foreach($methods as $method) {
15        if($clo->getOption('m') == $method->getName()) {
16          return true;
17        }
18      }
19      return false;
20    }
21    return true;
22  }
23
24  public function getMessage() {
25    return gtText::get('unknownMethod');
26  }
27}
28?>
29