Skip to content

Commit

Permalink
Remove deprecated loadXdebugStub attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrolGenhald committed Jan 27, 2022
1 parent c2b44ff commit 5c01913
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 55 deletions.
12 changes: 0 additions & 12 deletions config.xsd
Expand Up @@ -49,18 +49,6 @@
<xs:attribute name="ignoreInternalFunctionNullReturn" type="xs:boolean" default="true" />
<xs:attribute name="includePhpVersionsInErrorBaseline" type="xs:boolean" default="false" />
<xs:attribute name="inferPropertyTypesFromConstructor" type="xs:boolean" default="true" />
<xs:attribute name="loadXdebugStub" type="xs:boolean">
<xs:annotation>
<xs:documentation xml:lang="en">
Default is runtime-specific: if not present, Psalm will only load the Xdebug stub if psalm has unloaded the extension.
</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. In Psalm 5 extensions will be loaded based on composer.json and overridden with enableExtensions/disableExtensions.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="memoizeMethodCallResults" type="xs:boolean" default="false" />
<xs:attribute name="rememberPropertyAssignmentsAfterCall" type="xs:boolean" default="true" />
<xs:attribute name="resolveFromConfigFile" type="xs:boolean" default="true" />
Expand Down
11 changes: 0 additions & 11 deletions docs/running_psalm/configuration.md
Expand Up @@ -246,17 +246,6 @@ When `true`, Psalm will attempt to find all unused code (including unused variab
```
When `true`, Psalm will report all `@psalm-suppress` annotations that aren't used, the equivalent of running with `--find-unused-psalm-suppress`. Defaults to `false`.

#### loadXdebugStub
```xml
<psalm
loadXdebugStub="[bool]"
>
```
Deprecated, use &lt;enableExtensions&gt; instead.
If not present, Psalm will only load the Xdebug stub if Psalm has unloaded the extension.
When `true`, Psalm will load the Xdebug extension stub (as the extension is unloaded when Psalm runs).
Setting to `false` prevents the stub from loading.

#### ensureArrayStringOffsetsExist
```xml
<psalm
Expand Down
14 changes: 2 additions & 12 deletions psalm-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="dev-master@c90cffd382bb7a5d390387d4ad2a02a4935fba5c">
<files psalm-version="dev-master@093edcbe1d5c90ad574efcddd62fe741819e7cf2">
<file src="examples/TemplateChecker.php">
<PossiblyUndefinedIntArrayOffset occurrences="2">
<code>$comment_block-&gt;tags['variablesfrom'][0]</code>
Expand All @@ -24,9 +24,6 @@
<code>getAdditionalFileTypeAnalyzers</code>
<code>getAdditionalFileTypeScanners</code>
</DeprecatedMethod>
<DeprecatedProperty occurrences="1">
<code>$this-&gt;load_xdebug_stub</code>
</DeprecatedProperty>
</file>
<file src="src/Psalm/Config/FileFilter.php">
<PossiblyUndefinedIntArrayOffset occurrences="1">
Expand Down Expand Up @@ -203,12 +200,6 @@
<code>$stmt-&gt;expr-&gt;getArgs()[0]</code>
</PossiblyUndefinedIntArrayOffset>
</file>
<file src="src/Psalm/Internal/Cli/Psalm.php">
<DeprecatedProperty occurrences="2">
<code>$config-&gt;load_xdebug_stub</code>
<code>$config-&gt;load_xdebug_stub</code>
</DeprecatedProperty>
</file>
<file src="src/Psalm/Internal/Codebase/InternalCallMapHandler.php">
<PossiblyUndefinedIntArrayOffset occurrences="2">
<code>$callables[0]</code>
Expand Down Expand Up @@ -286,8 +277,7 @@
<DeprecatedProperty occurrences="1">
<code>$storage-&gt;template_extended_count</code>
</DeprecatedProperty>
<PossiblyUndefinedIntArrayOffset occurrences="4">
<code>$imported_type_data[3]</code>
<PossiblyUndefinedIntArrayOffset occurrences="3">
<code>$l[4]</code>
<code>$r[4]</code>
<code>$var_line_parts[0]</code>
Expand Down
14 changes: 0 additions & 14 deletions src/Psalm/Config.php
Expand Up @@ -196,15 +196,6 @@ class Config
*/
public $throw_exception = false;

/**
* Whether or not to load Xdebug stub
*
* @deprecated going to be removed in Psalm 5
*
* @var bool|null
*/
public $load_xdebug_stub;

/**
* The directory to store PHP Parser (and other) caches
*
Expand Down Expand Up @@ -957,7 +948,6 @@ private static function fromXmlAndPaths(
'ignoreInternalFunctionFalseReturn' => 'ignore_internal_falsable_issues',
'ignoreInternalFunctionNullReturn' => 'ignore_internal_nullable_issues',
'includePhpVersionsInErrorBaseline' => 'include_php_versions_in_error_baseline',
'loadXdebugStub' => 'load_xdebug_stub',
'ensureArrayStringOffsetsExist' => 'ensure_array_string_offsets_exist',
'ensureArrayIntOffsetsExist' => 'ensure_array_int_offsets_exist',
'reportMixedIssues' => 'show_mixed_issues',
Expand Down Expand Up @@ -1004,10 +994,6 @@ private static function fromXmlAndPaths(
$config->php_extensions[$ext] = isset($composer_json["require"]["ext-$ext"]);
}

if ($config->load_xdebug_stub !== null) {
$config->php_extensions["xdebug"] = $config->load_xdebug_stub;
}

if (isset($config_xml->enableExtensions) && isset($config_xml->enableExtensions->extension)) {
foreach ($config_xml->enableExtensions->extension as $extension) {
assert(isset($extension["name"]));
Expand Down
8 changes: 2 additions & 6 deletions src/Psalm/Internal/Cli/Psalm.php
Expand Up @@ -253,7 +253,7 @@ public static function run(array $argv): void

self::emitMacPcreWarning($options, $threads);

self::restart($options, $config, $threads);
self::restart($options, $threads);

if (isset($options['debug-emitted-issues'])) {
$config->debug_emitted_issues = true;
Expand Down Expand Up @@ -882,7 +882,7 @@ private static function emitMacPcreWarning(array $options, int $threads): void
}
}

private static function restart(array $options, Config $config, int $threads): void
private static function restart(array $options, int $threads): void
{
$ini_handler = new PsalmRestarter('PSALM');

Expand All @@ -907,10 +907,6 @@ private static function restart(array $options, Config $config, int $threads): v

// If Xdebug is enabled, restart without it
$ini_handler->check();

if ($config->load_xdebug_stub === null && PsalmRestarter::getSkippedVersion() !== '') {
$config->load_xdebug_stub = true;
}
}

private static function detectThreads(array $options, Config $config, bool $in_ci): int
Expand Down

0 comments on commit 5c01913

Please sign in to comment.