1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Fix #4874 - remove strok stub

This commit is contained in:
Matthew Brown 2020-12-21 17:14:25 +00:00 committed by Daniil Gentili
parent 7ddec46e76
commit 9405773882
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 3 additions and 12 deletions

View File

@ -238,7 +238,7 @@ class Algebra
} }
foreach ($clauses as $clause) { foreach ($clauses as $clause) {
if (!$clause->reconcilable) { if (!$clause->reconcilable || count($clause->possibilities) !== 1) {
continue; continue;
} }
@ -248,7 +248,7 @@ class Algebra
} }
// if there's only one possible type, return it // 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); $possible_type = array_pop($possible_types);
if (isset($truths[$var]) && !isset($clause->redefined_vars[$var])) { if (isset($truths[$var]) && !isset($clause->redefined_vars[$var])) {
@ -264,7 +264,7 @@ class Algebra
$active_truths[$var][count($truths[$var]) - 1] = [$possible_type]; $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 // if there's only one active clause, return all the non-negation clause members ORed together
$things_that_can_be_said = array_filter( $things_that_can_be_said = array_filter(
$possible_types, $possible_types,

View File

@ -807,15 +807,6 @@ function strrchr(string $haystack, string $needle) {}
*/ */
function strrev(string $string): string {} 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 * @psalm-pure
* *