Skip to content

Commit

Permalink
Allow totallyTyped to control level
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Feb 18, 2020
1 parent e48d2ae commit f49c896
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Psalm/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ class Config
/** @var bool */
public $allow_includes = true;

/** @var bool */
public $totally_typed = false;

/** @var 1|2|3|4|5|6|7|8 */
public $level = 1;

Expand Down Expand Up @@ -742,7 +739,6 @@ private static function fromXmlAndPaths(string $base_dir, string $file_contents,
'hideExternalErrors' => 'hide_external_errors',
'resolveFromConfigFile' => 'resolve_from_config_file',
'allowFileIncludes' => 'allow_includes',
'totallyTyped' => 'totally_typed',
'strictBinaryOperands' => 'strict_binary_operands',
'requireVoidReturnType' => 'add_void_docblocks',
'useAssertForType' => 'use_assert_for_type',
Expand Down Expand Up @@ -841,8 +837,14 @@ private static function fromXmlAndPaths(string $base_dir, string $file_contents,
$config->level = $attribute_text;
}

if ($config->totally_typed) {
$config->level = 1;
if (isset($config_xml['totallyTyped'])) {
$totally_typed = $config_xml['totallyTyped'];

if ($totally_typed === 'true' || $totally_typed === '1') {
$config->level = 1;
} else {
$config->level = 2;
}
}

if (isset($config_xml['errorBaseline'])) {
Expand Down

0 comments on commit f49c896

Please sign in to comment.