Exemplo n.º 1
0
 public function testConstructorShouldSetStateFromOptions()
 {
     $options = array('type' => 'static', 'class' => 'Foo', 'method' => 'bar');
     $callback = new Zend_Server_Method_Callback($options);
     $test = $callback->toArray();
     $this->assertSame($options, $test);
 }
 /**
  * Build callback for method signature
  *
  * @param  Zend_Server_Reflection_Function_Abstract $reflection
  * @return Zend_Server_Method_Callback
  */
 protected function _buildCallback(Zend_Server_Reflection_Function_Abstract $reflection)
 {
     $callback = new Zend_Server_Method_Callback();
     if ($reflection instanceof Zend_Server_Reflection_Method) {
         $callback->setType($reflection->isStatic() ? 'static' : 'instance')->setClass($reflection->getDeclaringClass()->getName())->setMethod($reflection->getName());
     } elseif ($reflection instanceof Zend_Server_Reflection_Function) {
         $callback->setType('function')->setFunction($reflection->getName());
     }
     return $callback;
 }