This commit is contained in:
2026-02-02 15:18:51 +01:00
parent 7a26dd69a5
commit ae0ee002ec
170 changed files with 7446 additions and 1519 deletions

View File

@@ -41,62 +41,68 @@ class OptionsResolverIntrospector
}
/**
* @param string $option
*
* @return mixed
*
* @throws NoConfigurationException on no configured value
*/
public function getDefault($option)
public function getDefault(string $option)
{
return \call_user_func($this->get, 'defaults', $option, sprintf('No default value was set for the "%s" option.', $option));
return ($this->get)('defaults', $option, sprintf('No default value was set for the "%s" option.', $option));
}
/**
* @param string $option
*
* @return \Closure[]
*
* @throws NoConfigurationException on no configured closures
*/
public function getLazyClosures($option)
public function getLazyClosures(string $option): array
{
return \call_user_func($this->get, 'lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option));
return ($this->get)('lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option));
}
/**
* @param string $option
*
* @return string[]
*
* @throws NoConfigurationException on no configured types
*/
public function getAllowedTypes($option)
public function getAllowedTypes(string $option): array
{
return \call_user_func($this->get, 'allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option));
return ($this->get)('allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option));
}
/**
* @param string $option
*
* @return mixed[]
*
* @throws NoConfigurationException on no configured values
*/
public function getAllowedValues($option)
public function getAllowedValues(string $option): array
{
return \call_user_func($this->get, 'allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option));
return ($this->get)('allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option));
}
/**
* @param string $option
*
* @return \Closure
*
* @throws NoConfigurationException on no configured normalizer
*/
public function getNormalizer($option)
public function getNormalizer(string $option): \Closure
{
return \call_user_func($this->get, 'normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option));
return current($this->getNormalizers($option));
}
/**
* @throws NoConfigurationException when no normalizer is configured
*/
public function getNormalizers(string $option): array
{
return ($this->get)('normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option));
}
/**
* @return string|\Closure
*
* @throws NoConfigurationException on no configured deprecation
*/
public function getDeprecationMessage(string $option)
{
return ($this->get)('deprecated', $option, sprintf('No deprecation was set for the "%s" option.', $option));
}
}