Skip to content

Commit

Permalink
Merge pull request #7398 from orklah/reconciliation
Browse files Browse the repository at this point in the history
use Reconciler::RECONCILIATION_*
  • Loading branch information
orklah committed Jan 14, 2022
2 parents cdbaf0e + 4a85fed commit fb30d83
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 42 deletions.
Expand Up @@ -52,6 +52,7 @@
use Psalm\Type\Atomic\TNull;
use Psalm\Type\Atomic\TTemplateParamClass;
use Psalm\Type\Atomic\TTrue;
use Psalm\Type\Reconciler;
use Psalm\Type\Union;
use UnexpectedValueException;

Expand Down Expand Up @@ -1907,7 +1908,7 @@ protected static function hasCallableCheck(PhpParser\Node\Expr\FuncCall $stmt):
}

/**
* @return 0|1|2
* @return Reconciler::RECONCILIATION_*
*/
protected static function hasClassExistsCheck(PhpParser\Node\Expr\FuncCall $stmt): int
{
Expand Down
6 changes: 3 additions & 3 deletions src/Psalm/Internal/Type/AssertionReconciler.php
Expand Up @@ -67,7 +67,7 @@ class AssertionReconciler extends Reconciler
*
* @param string[] $suppressed_issues
* @param array<string, array<string, Union>> $template_type_map
* @param-out 0|1|2 $failed_reconciliation
* @param-out Reconciler::RECONCILIATION_* $failed_reconciliation
*/
public static function reconcile(
string $assertion,
Expand Down Expand Up @@ -303,10 +303,10 @@ private static function getMissingType(
* This method is called when SimpleAssertionReconciler was not enough. It receives the existing type, the assertion
* and also a new type created from the assertion string.
*
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
* @param string[] $suppressed_issues
* @param array<string, array<string, Union>> $template_type_map
* @param-out 0|1|2 $failed_reconciliation
* @param-out Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function refine(
StatementsAnalyzer $statements_analyzer,
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Type/NegatedAssertionReconciler.php
Expand Up @@ -34,7 +34,7 @@ class NegatedAssertionReconciler extends Reconciler
/**
* @param array<string, array<string, Union>> $template_type_map
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
public static function reconcile(
StatementsAnalyzer $statements_analyzer,
Expand Down
46 changes: 23 additions & 23 deletions src/Psalm/Internal/Type/SimpleAssertionReconciler.php
Expand Up @@ -73,7 +73,7 @@ class SimpleAssertionReconciler extends Reconciler
{
/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
public static function reconcile(
string $assertion,
Expand Down Expand Up @@ -476,7 +476,7 @@ public static function reconcile(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileIsset(
Union $existing_var_type,
Expand Down Expand Up @@ -541,7 +541,7 @@ private static function reconcileIsset(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileNonEmptyCountable(
Union $existing_var_type,
Expand Down Expand Up @@ -663,7 +663,7 @@ private static function reconcileExactlyCountable(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcilePositiveNumeric(
Union $existing_var_type,
Expand Down Expand Up @@ -741,7 +741,7 @@ private static function reconcilePositiveNumeric(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileHasMethod(
Codebase $codebase,
Expand Down Expand Up @@ -846,7 +846,7 @@ private static function reconcileHasMethod(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileString(
Union $existing_var_type,
Expand Down Expand Up @@ -940,7 +940,7 @@ private static function reconcileString(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileInt(
Union $existing_var_type,
Expand Down Expand Up @@ -1038,7 +1038,7 @@ private static function reconcileInt(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileBool(
Union $existing_var_type,
Expand Down Expand Up @@ -1117,7 +1117,7 @@ private static function reconcileBool(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileScalar(
Union $existing_var_type,
Expand Down Expand Up @@ -1192,7 +1192,7 @@ private static function reconcileScalar(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileNumeric(
Union $existing_var_type,
Expand Down Expand Up @@ -1284,7 +1284,7 @@ private static function reconcileNumeric(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileObject(
Union $existing_var_type,
Expand Down Expand Up @@ -1377,7 +1377,7 @@ private static function reconcileObject(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileResource(
Union $existing_var_type,
Expand Down Expand Up @@ -1434,7 +1434,7 @@ private static function reconcileResource(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileCountable(
Codebase $codebase,
Expand Down Expand Up @@ -1503,7 +1503,7 @@ private static function reconcileCountable(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileIterable(
Codebase $codebase,
Expand Down Expand Up @@ -1563,7 +1563,7 @@ private static function reconcileIterable(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileInArray(
Codebase $codebase,
Expand Down Expand Up @@ -1838,7 +1838,7 @@ private static function reconcileInferiorTo(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileTraversable(
Codebase $codebase,
Expand Down Expand Up @@ -1909,7 +1909,7 @@ private static function reconcileTraversable(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileArray(
Union $existing_var_type,
Expand Down Expand Up @@ -2004,7 +2004,7 @@ private static function reconcileArray(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileList(
Union $existing_var_type,
Expand Down Expand Up @@ -2109,7 +2109,7 @@ private static function reconcileList(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileStringArrayAccess(
Codebase $codebase,
Expand Down Expand Up @@ -2174,7 +2174,7 @@ private static function reconcileStringArrayAccess(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileIntArrayAccess(
Codebase $codebase,
Expand Down Expand Up @@ -2234,7 +2234,7 @@ private static function reconcileIntArrayAccess(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileCallable(
Codebase $codebase,
Expand Down Expand Up @@ -2344,7 +2344,7 @@ private static function reconcileCallable(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileFalsyOrEmpty(
string $assertion,
Expand Down Expand Up @@ -2524,7 +2524,7 @@ private static function reconcileFalsyOrEmpty(
}

/**
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileClassConstant(
Codebase $codebase,
Expand Down
28 changes: 14 additions & 14 deletions src/Psalm/Internal/Type/SimpleNegatedAssertionReconciler.php
Expand Up @@ -60,7 +60,7 @@ class SimpleNegatedAssertionReconciler extends Reconciler
{
/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
public static function reconcile(
Codebase $codebase,
Expand Down Expand Up @@ -401,7 +401,7 @@ private static function reconcileCallable(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileBool(
Union $existing_var_type,
Expand Down Expand Up @@ -469,7 +469,7 @@ private static function reconcileBool(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileNonEmptyCountable(
Union $existing_var_type,
Expand Down Expand Up @@ -542,7 +542,7 @@ private static function reconcileNonEmptyCountable(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileNull(
Union $existing_var_type,
Expand Down Expand Up @@ -608,7 +608,7 @@ private static function reconcileNull(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileFalse(
Union $existing_var_type,
Expand Down Expand Up @@ -674,7 +674,7 @@ private static function reconcileFalse(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileFalsyOrEmpty(
string $assertion,
Expand Down Expand Up @@ -869,7 +869,7 @@ private static function reconcileFalsyOrEmpty(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileScalar(
Union $existing_var_type,
Expand Down Expand Up @@ -955,7 +955,7 @@ private static function reconcileScalar(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileObject(
Union $existing_var_type,
Expand Down Expand Up @@ -1056,7 +1056,7 @@ private static function reconcileObject(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileNumeric(
Union $existing_var_type,
Expand Down Expand Up @@ -1146,7 +1146,7 @@ private static function reconcileNumeric(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileInt(
Union $existing_var_type,
Expand Down Expand Up @@ -1246,7 +1246,7 @@ private static function reconcileInt(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileFloat(
Union $existing_var_type,
Expand Down Expand Up @@ -1341,7 +1341,7 @@ private static function reconcileFloat(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileString(
Union $existing_var_type,
Expand Down Expand Up @@ -1445,7 +1445,7 @@ private static function reconcileString(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileArray(
Union $existing_var_type,
Expand Down Expand Up @@ -1546,7 +1546,7 @@ private static function reconcileArray(

/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param Reconciler::RECONCILIATION_* $failed_reconciliation
*/
private static function reconcileResource(
Union $existing_var_type,
Expand Down

0 comments on commit fb30d83

Please sign in to comment.