public function typeParameters(MethodParser $method) { $elements = array(); foreach ($method->parameters() as $parameter) { $elements[] = $this->_generateType($parameter); } return $elements; }
public function typeParameters(MethodParser $method) { $element = new TypesElement(); $element->setName($method->getName()); foreach ($method->parameters() as $parameter) { $this->_generateElements($parameter, $element); } return array($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 getParams(MethodParser $method) { $result = array(); foreach ($method->parameters() as $parameter) { if ($parameter instanceof Simple) { $result[] = '?'; } if ($parameter instanceof Arrays) { $result[] = array('?', '?', '?'); } } return $result; }
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; }