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

deprecate totallyTyped #7650

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
2 changes: 1 addition & 1 deletion bin/phar.psalm.xml
Expand Up @@ -2,7 +2,7 @@
<psalm
name="Psalm for Psalm"
useDocblockTypes="true"
totallyTyped="true"
errorLevel=1
strictBinaryOperands="false"
rememberPropertyAssignmentsAfterCall="true"
throwExceptionOnError="0"
Expand Down
13 changes: 12 additions & 1 deletion config.xsd
Expand Up @@ -97,7 +97,18 @@
<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: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
4 changes: 3 additions & 1 deletion src/Psalm/Config.php
Expand Up @@ -814,7 +814,9 @@ private static function processConfigDeprecations(
$deprecated_attributes = [
'allowCoercionFromStringToClassConst',
'allowPhpStormGenerics',
'forbidEcho'
'forbidEcho',
'loadXdebugStub',
'totallyTyped'
];

$deprecated_elements = [
Expand Down
8 changes: 2 additions & 6 deletions tests/Config/ConfigFileTest.php
Expand Up @@ -174,9 +174,7 @@ public function removeKillsSpecifiedPluginWithOneRemaining(): void
{
$noPlugins = trim('
<?xml version="1.0"?>
<psalm
totallyTyped="false"
>
<psalm>
<plugins>
<pluginClass class="d\e\f"/>
</plugins>
Expand All @@ -185,9 +183,7 @@ public function removeKillsSpecifiedPluginWithOneRemaining(): void

$abcEnabled = trim('
<?xml version="1.0"?>
<psalm
totallyTyped="false"
>
<psalm>
<plugins>
<pluginClass class="a\b\c"/>
<pluginClass class="d\e\f"/>
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/DestructiveAutoloader/psalm.xml
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
autoloader="autoloader.php"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/DummyProject/psalm.xml
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/ModularConfig/psalm.xml
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/SuicidalAutoloader/psalm.xml
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
autoloader="autoloader.php"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Expand Down