示例#1
0
 /**
  * Returns whether the descriptor contains a value for a binding parameter.
  *
  * @param string $parameterName  The name of the binding parameter.
  * @param bool   $includeDefault Whether to include the default values set
  *                               in the binding type.
  *
  * @return bool Returns `true` if a value is set for the parameter.
  */
 public function hasParameterValue($parameterName, $includeDefault = true)
 {
     if (isset($this->parameterValues[$parameterName])) {
         return true;
     }
     if ($this->typeDescriptor && $includeDefault) {
         return $this->typeDescriptor->hasParameterValue($parameterName);
     }
     return false;
 }
 public function testHasParameterValueIgnoresRequiredParameters()
 {
     $descriptor = new BindingTypeDescriptor('vendor/type', null, array(new BindingParameterDescriptor('param', BindingParameterDescriptor::REQUIRED)));
     $this->assertFalse($descriptor->hasParameterValue('param'));
 }