Skip to content

Commit

Permalink
add missing options and
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Dec 21, 2022
1 parent 2b61e2a commit 4966bbb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Configuration/ConfigResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ final class ConfigResolver
private const OPTION_NO_CACHE = 'no-cache';
private const OPTION_CONFIG_FILE = 'configuration';
private const OPTION_MEMORY_LIMIT = 'memory-limit';
private const OPTION_JSON_FILE = 'json';
private const OPTION_XML_FILE = 'xml';

public const DEFAULT_JOBS = 5;
public const DEFAULT_PATH = '.';
Expand All @@ -56,6 +58,8 @@ final class ConfigResolver
self::OPTION_NO_CACHE => false,
self::OPTION_CONFIG_FILE => self::DEFAULT_CONFIG_FILE,
self::OPTION_MEMORY_LIMIT => false,
self::OPTION_JSON_FILE => false,
self::OPTION_XML_FILE => false,
];

/**
Expand Down Expand Up @@ -149,6 +153,8 @@ private function getOptions(): OptionsResolver
$resolver->setAllowedTypes(self::OPTION_NO_CACHE, 'bool');
$resolver->setAllowedTypes(self::OPTION_CONFIG_FILE, 'string');
$resolver->setAllowedTypes(self::OPTION_MEMORY_LIMIT, ['int', 'string']);
$resolver->setAllowedTypes(self::OPTION_JSON_FILE, ['null', 'string']);
$resolver->setAllowedTypes(self::OPTION_XML_FILE, ['null', 'string']);

$resolver->setNormalizer(self::OPTION_PATH, function (Options $options, $value) {
if (is_string($value)) {
Expand Down

0 comments on commit 4966bbb

Please sign in to comment.