Skip to content

3.0.0

Latest

Choose a tag to compare

@arokettu arokettu released this 20 Sep 22:54
· 28 commits to master since this release

RC1:

  • LazyCalculator: allows lazy operators and lazy functions
    • Lazy binary and unary operators
    • Lazy functions
    • AND and OR operators are now lazy
    • if() is now lazy
  • addFunctions() no longer accepts callables, use addFunctionsFromCallables()
  • Default config additions:
    • NOT operator
    • Functions returning special constants: true(), false(), nan(), inf()
  • Binary operator priorities moved to a separate class, Arokettu\ArithmeticParser\Config\BinaryPriority
    • BinaryOperator::PRIORITY_* constants are deprecated

Release:

  • defined() lazy function to check if a variable is defined
  • setFunctions() no longer accepts callables too
  • More granular exceptions for Calculator classes:
    • CalcCallException now has 2 subclasses: UndefinedVariableException and UndefinedFunctionException
    • CalcConfigException is thrown if calculator is misconfigured or duplicate variables are passed
    • CalculatorException interface to catch both CalcCallException and CalcConfigException