示例#1
0
 public function named(string $name) : Parameter
 {
     if ($this->contains($name)) {
         return $this->parameters[$name];
     }
     throw MissingParameter::named($name, $this->method);
 }
示例#2
0
 function it_provides_a_parameter_by_name(Parameter $parameter)
 {
     $this->named('foo')->shouldBe($parameter);
     $this->shouldThrow(MissingParameter::named('bar', 'MyClass::myMethod'))->during('named', ['bar']);
 }