/** * @param MethodContainer $methods */ protected function getClassMethods(MethodContainer $methods) { $method = new PhpMethod(self::METHOD_NAME, array(), PhpMethod::ACCESS_PUBLIC, false, true, true); $this->addMethodBody($method); $methods->add($method); return $this; }
/** * @param MethodContainer $methods * @param MethodModel $method * @return Service */ protected function addMainMethod(MethodContainer $methods, MethodModel $method) { $methodFile = new Operation($method, $this->getGenerator()); $mainMethod = $methodFile->getMainMethod(); $methods->add($mainMethod); $this->setModelFromMethod($mainMethod, $method); return $this; }
/** * @param MethodContainer $methods * @param string $name * @param string $body * @param string[] $methodParameters * @return StructArray */ protected function addArrayMethodGenericMethod(MethodContainer $methods, $name, $body, array $methodParameters = array()) { $method = new PhpMethod($name, $methodParameters); $method->addChild($body); $methods->add($method); return $this; }
/** * @param MethodContainer $methods * @return Struct */ protected function addStructMethodSetState(MethodContainer $methods) { $method = new PhpMethod(self::METHOD_SET_STATE, array(new PhpFunctionParameter('array', PhpFunctionParameter::NO_VALUE, 'array')), PhpMethod::ACCESS_PUBLIC, false, true); $method->addChild(sprintf('return parent::__set_state($array);')); $methods->add($method); return $this; }
/** * @param MethodContainer */ protected function getClassMethods(MethodContainer $methods) { $methods->add($this->getEnumMethodValueIsValid())->add($this->getEnumMethodGetValidValues()); }
/** * @expectedException \InvalidArgumentException */ public function testAddWithException() { $method = new Method(self::getBingGeneratorInstance()); $method->add(new PhpConstant('Bar')); }