Exemplo n.º 1
0
 /**
  * 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());
 }
Exemplo n.º 2
0
 /**
  * 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);
         }
     }
 }