/** * @return MethodContainer */ public static function instance() { $service = ServiceTest::instance('Bar'); $methodContainer = new MethodContainer(self::getBingGeneratorInstance()); $methodContainer->add(new Method(self::getBingGeneratorInstance(), 'Foo', 'string', 'int', $service)); $methodContainer->add(new Method(self::getBingGeneratorInstance(), 'Bar', 'string', 'int', $service)); $methodContainer->add(new Method(self::getBingGeneratorInstance(), 'FooBar', array('string', 'int', 'int'), 'int', $service)); return $methodContainer; }
/** * Adds a method to the service * @uses Method::setIsUnique() * @param string $methodName original method name * @param string|array $methodParameterType original parameter type/name * @param string|array $methodReturnType original return type/name * @param bool $methodIsUnique original isUnique value * @return Method */ public function addMethod($methodName, $methodParameterType, $methodReturnType, $methodIsUnique = true) { $method = new Method($this->getGenerator(), $methodName, $methodParameterType, $methodReturnType, $this, $methodIsUnique); $this->methods->add($method); return $method; }