Skip to content

Commit

Permalink
Fix #4874 - remove strok stub
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Dec 21, 2020
1 parent fcd9dcb commit 3390097
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/Psalm/Internal/Algebra.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public static function getTruthsFromFormula(
}

foreach ($clauses as $clause) {
if (!$clause->reconcilable) {
if (!$clause->reconcilable || count($clause->possibilities) !== 1) {
continue;
}

Expand All @@ -248,7 +248,7 @@ public static function getTruthsFromFormula(
}

// if there's only one possible type, return it
if (count($clause->possibilities) === 1 && count($possible_types) === 1) {
if (count($possible_types) === 1) {
$possible_type = array_pop($possible_types);

if (isset($truths[$var]) && !isset($clause->redefined_vars[$var])) {
Expand All @@ -264,7 +264,7 @@ public static function getTruthsFromFormula(

$active_truths[$var][count($truths[$var]) - 1] = [$possible_type];
}
} elseif (count($clause->possibilities) === 1) {
} else {
// if there's only one active clause, return all the non-negation clause members ORed together
$things_that_can_be_said = array_filter(
$possible_types,
Expand Down
9 changes: 0 additions & 9 deletions stubs/CoreGenericFunctions.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -807,15 +807,6 @@ function strrchr(string $haystack, string $needle) {}
*/
function strrev(string $string): string {}

/**
* @psalm-pure
* @return string|false
* @psalm-ignore-falsable-return
*
* @psalm-flow ($string) -> return
*/
function strtok(string $str, string $token) {}

/**
* @psalm-pure
*
Expand Down

0 comments on commit 3390097

Please sign in to comment.