/** * Returns whether the descriptor has any parameter values set. * * @param bool $includeDefault Whether to include the default values set * in the binding type. * * @return bool Returns `true` if any parameter values are set. */ public function hasParameterValues($includeDefault = true) { if (count($this->parameterValues) > 0) { return true; } if ($this->typeDescriptor && $includeDefault) { return $this->typeDescriptor->hasParameterValues(); } return false; }
public function testHasParameterValuesIgnoresRequiredParameters() { $descriptor = new BindingTypeDescriptor('vendor/type', null, array(new BindingParameterDescriptor('param', BindingParameterDescriptor::REQUIRED))); $this->assertFalse($descriptor->hasParameterValues()); }