Skip to content

Commit

Permalink
Minor fixes after rebasing.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrolGenhald committed Jan 26, 2022
1 parent 740a101 commit e268a05
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion UPGRADING.md
Expand Up @@ -196,4 +196,4 @@
- [BC] Method `Psalm\Issue\CodeIssue::getMessage()` was removed
- [BC] Method `Psalm\DocComment::parse()` was removed
- [BC] Class `Psalm\Type\Atomic\THtmlEscapedString` has been removed
- [BC] Property `Psalm\Context::$vars_from_global` has been removed
- [BC] Property `Psalm\Context::$vars_from_global` has been renamed to `$referenced_globals`
1 change: 1 addition & 0 deletions docs/running_psalm/issues.md
Expand Up @@ -216,6 +216,7 @@
- [RedundantIdentityWithTrue](issues/RedundantIdentityWithTrue.md)
- [RedundantPropertyInitializationCheck](issues/RedundantPropertyInitializationCheck.md)
- [ReferenceConstraintViolation](issues/ReferenceConstraintViolation.md)
- [ReferenceReusedFromConfusingScope](issues/ReferenceReusedFromConfusingScope.md)
- [ReservedWord](issues/ReservedWord.md)
- [StringIncrement](issues/StringIncrement.md)
- [TaintedCallable](issues/TaintedCallable.md)
Expand Down
7 changes: 2 additions & 5 deletions src/Psalm/Internal/Analyzer/Statements/GlobalAnalyzer.php
Expand Up @@ -8,7 +8,6 @@
use Psalm\Internal\Analyzer\FunctionLikeAnalyzer;
use Psalm\Internal\Analyzer\Statements\Expression\Fetch\VariableFetchAnalyzer;
use Psalm\Internal\Analyzer\StatementsAnalyzer;
use Psalm\Internal\Codebase\VariableUseGraph;
use Psalm\Internal\DataFlow\DataFlowNode;
use Psalm\Internal\ReferenceConstraint;
use Psalm\Issue\InvalidGlobal;
Expand Down Expand Up @@ -93,10 +92,8 @@ public static function analyze(
$var_id
);

if ($statements_analyzer->data_flow_graph instanceof VariableUseGraph) {
if ($global_context !== null && $global_context->hasVariable($var_id)) {
$global_context->referenced_globals[$var_id] = true;
}
if ($global_context !== null && $global_context->hasVariable($var_id)) {
$global_context->referenced_globals[$var_id] = true;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/Psalm/Internal/Type/TypeExpander.php
Expand Up @@ -125,6 +125,8 @@ public static function expandUnion(
* @param string|TNamedObject|TTemplateParam|null $static_class_type
*
* @return non-empty-list<Atomic>
*
* @psalm-suppress ComplexMethod
*/
public static function expandAtomic(
Codebase $codebase,
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Issue/ReferenceReusedFromConfusingScope.php
Expand Up @@ -5,5 +5,5 @@
class ReferenceReusedFromConfusingScope extends CodeIssue
{
public const ERROR_LEVEL = 4;
public const SHORTCODE = 303;
public const SHORTCODE = 308;
}
2 changes: 0 additions & 2 deletions src/Psalm/Type/Reconciler.php
Expand Up @@ -95,8 +95,6 @@ class Reconciler
* @param array<string, array<string, Union>> $template_type_map
*
* @return array<string, Union>
*
* @psalm-suppress ComplexMethod
*/
public static function reconcileKeyedTypes(
array $new_types,
Expand Down

0 comments on commit e268a05

Please sign in to comment.