Commit Graph

8 Commits

Author SHA1 Message Date
HawkForge a7dbf35f62 Fix branch pruning for IF nested in the condition of a pruned IF
When an IF sits in the condition of another IF, BranchPruner only
looked at the immediately enclosing IF to decide which branch the
condition tokens depend on. If that enclosing IF was itself still in
its condition, nothing was recorded, so the link to an outer IF whose
branch is being pruned was lost. Those tokens were then evaluated and
left on the stack while the rest of the branch was pruned, and the
calculation ended with "internal error".

Walk up the stack of enclosing IFs to the closest one whose then or
else branch contains the nested IF instead.

Fixes #3790
Fixes #3755
2026-10-16 20:36:20 +06:00
oleibman 19555d6d96 Phpstan 10 and IterableValue Prep Part 2
There will probably be dozens, if not hundreds, of these before I'm ready to commit.
2025-04-18 23:27:29 -07:00
Adrien Crivelli ec4098c8fd Strict mode for all tests
While we might never be able to have 100% of our code strict, we can at
the very least do it for all of our tests. This ensures that our tests
are using our API with the types as intended by the test author, and not
silently be cast to what our API requires.
2023-09-07 17:44:56 +08:00
Adrien Crivelli 49f87de165 Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
Adrien Crivelli fcd9f10663 Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
Fräntz Miccoli 75dfcb5a36 Fix branch pruning resolution of non boolean conditions
Closes #1167
2019-11-10 22:59:09 +01:00
Adrien Crivelli 34675bdf5d Remove dead code 2019-08-12 10:04:40 -07:00
Fräntz Miccoli 0b387e767e Branch pruning around IF function calls to avoid resolution of every branches
Calculation engine was resolving every function by first resolving its arguments
including IFs, this was causing significant over evaluation when IFs were used
as it meant for every case to be evaluated.

Introduce elements to identify ifs and enable better branch resolution
(pruning). We tag parsed tokens to associate a branch identifier to them.

Closes #844
2019-08-11 18:23:47 -07:00