Пример #1
0
 public function atPosition(int $position) : Parameter
 {
     if ($position >= 0 && $this->size() > $position) {
         return array_values($this->parameters)[$position];
     }
     throw MissingParameter::atPosition($position, $this->method);
 }
Пример #2
0
 function it_provides_a_parameter_by_its_position(Parameter $parameter)
 {
     $this->atPosition(0)->shouldBe($parameter);
     $this->shouldThrow(MissingParameter::atPosition(1, 'MyClass::myMethod'))->during('atPosition', [1]);
 }