Skip to content

Commit

Permalink
Fix return type of method never returning null
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Jan 26, 2022
1 parent 9461caa commit 25c8471
Showing 1 changed file with 8 additions and 10 deletions.
Expand Up @@ -114,14 +114,12 @@ public static function analyze(

$outer_context->inside_conditional = true;

if ($externally_applied_if_cond_expr) {
if (ExpressionAnalyzer::analyze(
$statements_analyzer,
$externally_applied_if_cond_expr,
$outer_context
) === false) {
throw new ScopeAnalysisException();
}
if (ExpressionAnalyzer::analyze(
$statements_analyzer,
$externally_applied_if_cond_expr,
$outer_context
) === false) {
throw new ScopeAnalysisException();
}

$first_cond_assigned_var_ids = $outer_context->assigned_var_ids;
Expand Down Expand Up @@ -236,7 +234,7 @@ public static function analyze(
* Returns statements that are definitely evaluated before any statements after the end of the
* if/elseif/else blocks
*/
private static function getDefinitelyEvaluatedExpressionAfterIf(PhpParser\Node\Expr $stmt): ?PhpParser\Node\Expr
private static function getDefinitelyEvaluatedExpressionAfterIf(PhpParser\Node\Expr $stmt): PhpParser\Node\Expr
{
if ($stmt instanceof PhpParser\Node\Expr\BinaryOp\Equal
|| $stmt instanceof PhpParser\Node\Expr\BinaryOp\Identical
Expand Down Expand Up @@ -280,7 +278,7 @@ private static function getDefinitelyEvaluatedExpressionAfterIf(PhpParser\Node\E
* Returns statements that are definitely evaluated before any statements inside
* the if block
*/
private static function getDefinitelyEvaluatedExpressionInsideIf(PhpParser\Node\Expr $stmt): ?PhpParser\Node\Expr
private static function getDefinitelyEvaluatedExpressionInsideIf(PhpParser\Node\Expr $stmt): PhpParser\Node\Expr
{
if ($stmt instanceof PhpParser\Node\Expr\BinaryOp\Equal
|| $stmt instanceof PhpParser\Node\Expr\BinaryOp\Identical
Expand Down

0 comments on commit 25c8471

Please sign in to comment.