root/scripts/dev/generate-phpt/src/setup/preconditions/gtIsValidFunction.php

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. check
  2. getMessage

<?php

/**
 * Check that the function name is valid
 *
 */
class gtIsValidFunction extends gtPreCondition {

  public function check( $clo) {
    if($clo->hasOption('f') ) {
      $function = $clo->getOption('f');
      $functions = get_defined_functions();
      if( in_array( $function, $functions['internal'] ) ) {
        return true;
      }
      return false;
    }
    return true;
  }

  public function getMessage() {
    return gtText::get('unknownFunction');
  }
}

/* [<][>][^][v][top][bottom][index][help] */