Back to index

php5  5.3.10
gtFunction.php
Go to the documentation of this file.
00001 <?php
00002 
00007 class gtFunction extends gtTestSubject {
00008 
00009   private $functionName;
00010   
00016   public function __construct($functionName)  {
00017     $this->functionName = $functionName;
00018   }
00019 
00020 
00025   public function setArgumentNames() {
00026     $function= new ReflectionFunction($this->functionName);
00027 
00028     foreach ($function->getParameters() as $i => $param) {
00029       if($param->isOptional()) {
00030         $this->optionalArgumentNames[] = $param->getName();
00031       } else {
00032         $this->mandatoryArgumentNames[] = $param->getName();
00033       }
00034     }
00035   }
00036 
00037 
00043   public function getName() {
00044     return $this->functionName;
00045   }
00046 
00047 }
00048 ?>