Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove totallyTyped #7651

Merged
merged 2 commits into from Feb 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 0 additions & 12 deletions config.xsd
Expand Up @@ -54,18 +54,6 @@
<xs:attribute name="resolveFromConfigFile" type="xs:boolean" default="true" />
<xs:attribute name="strictBinaryOperands" type="xs:boolean" default="false" />
<xs:attribute name="throwExceptionOnError" type="xs:boolean" default="false" />
<xs:attribute name="totallyTyped" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation xml:lang="en">
Setting `totallyTyped` to `"true"` is equivalent to setting `errorLevel` to `"1"`. Setting `totallyTyped` to `"false"` is equivalent to setting `errorLevel` to `"2"` and `reportMixedIssues` to `"false"`
</xs:documentation>

<!-- note: for PHPStorm to mark the attribute as deprecated the doc entry has to be *single line* and start with the word `deprecated` -->
<xs:documentation xml:lang="en">
Deprecated. Replaced by `errorLevel` and `reportMixedIssues`.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="errorLevel" type="xs:integer" default="2" />
<xs:attribute name="reportMixedIssues" type="xs:boolean" default="true" />
<xs:attribute name="useDocblockTypes" type="xs:boolean" default="true" />
Expand Down
2 changes: 1 addition & 1 deletion docs/annotating_code/type_syntax/atomic_types.md
Expand Up @@ -57,7 +57,7 @@ Atomic types are the basic building block of all type information used in Psalm.

### `mixed`

This is the _top type_ in PHP's type system, and represents a lack of type information. Psalm warns about `mixed` types when the `totallyTyped` flag is turned on, or when you're on level 1.
This is the _top type_ in PHP's type system, and represents a lack of type information. Psalm warns about `mixed` types when the `reportMixedIssues` flag is turned on, or when you're on level 1.

### `never`
It can be aliased to `no-return` or `never-return` in docblocks. Note: it replaced the old `empty` type that used to exist in Psalm
Expand Down
10 changes: 1 addition & 9 deletions docs/running_psalm/configuration.md
Expand Up @@ -58,15 +58,7 @@ Setting this to `"false"` hides all issues with `Mixed` types in Psalm’s outpu

#### totallyTyped

```xml
<psalm
totallyTyped="[bool]"
/>
```

\(Deprecated\) Setting `totallyTyped` to `"true"` is equivalent to setting `errorLevel` to `"1"`. Setting `totallyTyped` to `"false"` is equivalent to setting `errorLevel` to `"2"` and `reportMixedIssues` to `"false"`


\(Deprecated\) This setting has been replaced by `reportMixedIssues` which is automatically enabled when `errorLevel` is 1.

#### resolveFromConfigFile

Expand Down
1 change: 0 additions & 1 deletion docs/running_psalm/error_levels.md
Expand Up @@ -5,7 +5,6 @@ You can run Psalm in at different levels of strictness from 1 to 8.
Level 1 is the most strict, level 8 is the most lenient.

When no level is explicitly defined, psalm defaults to level 2.
In case `totallyTyped` is enabled, psalm defaults to level 1.

Some issues are [always treated as errors](#always-treated-as-errors). These are issues with a very low probability of false-positives.

Expand Down
12 changes: 0 additions & 12 deletions src/Psalm/Config.php
Expand Up @@ -1111,18 +1111,6 @@ private static function fromXmlAndPaths(
}

$config->level = $attribute_text;
} elseif (isset($config_xml['totallyTyped'])) {
$totally_typed = (string) $config_xml['totallyTyped'];

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

if ($config->show_mixed_issues === null) {
$config->show_mixed_issues = false;
}
}
} else {
$config->level = 2;
}
Expand Down
Expand Up @@ -108,7 +108,7 @@ public static function fetch(
if ($premixin_method_id->fq_class_name === PDOException::class) {
return Type::getString();
} else {
return Type::getInt(true); // TODO: Remove the flag in Psalm 5
return Type::getInt();
}
}

Expand Down