/** * Test construction with parameters * * @return void */ public function testConstructWithParameters() { $parameters = ['a' => ['type' => 'float', 'in' => true], 'b' => ['type' => 'float', 'in' => true]]; $method = new Method('CALC.SUM', $parameters); $this->assertEquals(['a', 'b'], $method->parameters()); }
/** * Apply schema structure to the request object. * * @param MethodSchema $schema Method schema object instance. * @return void */ public function applySchema(MethodSchema $schema) { $parameters = $schema->parameters(); foreach ($parameters as $name) { $parameter = $schema->parameter($name); if ($parameter['in']) { $this->set($name, null); // @todo default ??? } if ($parameter['out']) { $this->set($name, null); } } }