/** * @test */ public function shouldParseMethodAndReturnRawReturn() { //when $parser = new MethodParser($this->_methodName, $this->_methodDoc); //then $this->assertEquals('bool $return', $parser->getRawReturn()); }
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; }
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; }
public function typeReturning(MethodParser $method) { return $this->_generateType($method->returning()); }
private function _messageOutput(MethodParser $method) { $messageOutputElement = $this->createElementWithAttributes('message', array('name' => $method->getName() . 'Response')); $partsOutput = $this->_bindingStyle->methodOutput($method); $partsOutput = $this->createElementWithAttributes('part', $partsOutput); $messageOutputElement->appendChild($partsOutput); return $messageOutputElement; }