Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
configuration: resolve apigen.yml config case-insensitively
- Loading branch information
|
@@ -34,8 +34,14 @@ public function resolveValue(string $name, $value) |
|
|
*/ |
|
|
public function resolveValuesWithDefaults(array $values): array |
|
|
{ |
|
|
$values = array_change_key_case($values, CASE_LOWER); |
|
|
|
|
|
foreach ($this->getOptionNames() as $name) { |
|
|
$values[$name] = $this->resolveValue($name, $values[$name] ?? null); |
|
|
$lowered = strtolower($name); |
|
|
$values[$name] = $this->resolveValue($name, $values[$lowered] ?? null); |
|
|
if ($name !== $lowered) { |
|
|
unset($values[$lowered]); |
|
|
} |
|
|
} |
|
|
|
|
|
return $values; |
|
|
|
@@ -13,7 +13,7 @@ |
|
|
|
|
|
interface ClassReflectionInterface extends StartAndEndLineInterface, AnnotationsInterface, AbstractReflectionInterface, InNamespaceInterface, FileNameAwareReflectionInterface |
|
|
{ |
|
|
public function getParentClass(): ?ClassReflectionInterface; |
|
|
public function getParentClass(): ?self; |
|
|
|
|
|
public function getParentClassName(): ?string; |
|
|
|
|
|
|
@@ -6,5 +6,5 @@ |
|
|
|
|
|
interface TraitMethodReflectionInterface extends AbstractMethodReflectionInterface, AbstractTraitElementInterface |
|
|
{ |
|
|
public function getOverriddenMethod(): ?TraitMethodReflectionInterface; |
|
|
public function getOverriddenMethod(): ?self; |
|
|
} |
|
@@ -49,16 +49,6 @@ public function resolveOptions(array $options): array |
|
|
|
|
|
$resolvedOptions = $this->configurationResolver->resolveValuesWithDefaults($options); |
|
|
|
|
|
// hack to remove duplicated lowercased value |
|
|
unset($resolvedOptions[strtolower(VisibilityLevelOption::NAME)]); |
|
|
|
|
|
$baseUrlKeyLowered = strtolower(BaseUrlOption::NAME); |
|
|
if (isset($resolvedOptions[$baseUrlKeyLowered])) { |
|
|
$resolvedOptions[BaseUrlOption::NAME] = $resolvedOptions[$baseUrlKeyLowered]; |
|
|
} |
|
|
|
|
|
unset($resolvedOptions[$baseUrlKeyLowered]); |
|
|
|
|
|
return $this->options = $resolvedOptions; |
|
|
} |
|
|
|
|
|