public function typeReturning(MethodParser $method) { $element = new TypesElement(); $element->setName($method->getName() . 'Response'); $returning = $method->returning(); $this->_generateElements($returning, $element); return $element; }
public function typeReturning(MethodParser $method) { $element = new TypesElement(); $element->setName($method->getName() . 'Response'); foreach ($method->returning() as $parameter) { $this->_generateElements($parameter, $element); } return $element; }
/** * @test */ public function shouldParseMethodData() { //when $parser = new MethodParser($this->_methodName, $this->_methodDoc); //then $this->assertEquals('Method to adding user', $parser->description()); $this->assertCount(3, $parser->parameters()); $this->assertInstanceOf('WSDL\\Types\\Simple', $parser->returning()); $this->assertEquals($this->_methodDoc, $parser->getDoc()); $this->assertEquals($this->_methodName, $parser->getName()); }
public function __call($method, $args) { if (!method_exists($this->_obj, $method)) { throw new BadMethodCallException('Unknown method [' . $method . ']'); } $reflectedMethod = new ReflectionMethod($this->_obj, $method); $parsedMethod = new MethodParser($method, $reflectedMethod->getDocComment()); $parameters = $parsedMethod->parameters(); $returning = $parsedMethod->returning(); $args = $this->_parseArgs($args, $parameters); $return = call_user_func_array(array($this->_obj, $method), $args); $obj = new stdClass(); foreach (array_keys($return) as $returnVariable) { $obj->{$returnVariable} = $return[$returnVariable]; } return $obj; }
public function typeReturning(MethodParser $method) { return $this->_generateType($method->returning()); }