aboutsummaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Prep for V2.2.0 release (#99)V2.2.0Bruce Wells2022-04-261-5/+41
|
* Add a custom variable validator + protected props (#98)Matthijs Meulenbrug2022-04-251-0/+15
|
* Adding varExists method and support for undefined var handler in getVar (#96)V2.1.112.0.4Bruce Wells2022-03-211-15/+30
| | | | | | | | | | | | | | | * Added varExists method * getVar now respects VarNotFoundHandler setting * Use local version of PHP-CS-Fixer Instead of hard coded version from github actions * Fixing actions * Fixing actions * Dropping testing for 7.3, as it is no longer supported
* fix: broken support for positive exponent numbersJavier Marín2022-01-051-0/+8
|
* PhpStan support, consts visibilty and name for tokens (#89)Javier Marín2021-07-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | * Added handler to define not found variables Added support for string variables Fixed strings and ints comparison error * Check if variables have scalar types (int, float, string and bool) Better $onVarNotFound logic * Better support for null variables * Better support for null variables * Better support for null variables * Allow null values in `setVar` method * Support for unary positive operator * Add PhpStan config file Fix PhpStan warnings Set consts visibility Add name info to variable tokens for easier debugging Co-authored-by: Javier Marín <contacto@ideatic.net>
* Release prep (#86)V2.1.8Bruce Wells2021-03-051-11/+14
|
* Merge branch 'master' into masterBruce Wells2021-03-051-1/+1
|\
| * Better unit testingBruce Wells2020-09-161-10/+10
| |
| * Improved support for null variables (#72)Javier Marín2020-09-161-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added handler to define not found variables Added support for string variables Fixed strings and ints comparison error * Check if variables have scalar types (int, float, string and bool) Better $onVarNotFound logic * Better support for null variables * Better support for null variables * Better support for null variables
| * Better setVar error message (#70)Bruce Wells2020-09-161-4/+53
| | | | | | | | Additional unit tests Readme update
| * Release prep (#69)Bruce Wells2020-09-161-4/+35
| | | | | | | | | | | | | | * String comparison unit tests * getVars and getFunctions sanity checks * Add dynamic variable documentation
| * Handler for not found variables (#68)Javier Marín2020-09-161-0/+31
| | | | | | | | | | | | | | | | * Added handler to define not found variables Added support for string variables Fixed strings and ints comparison error * Check if variables have scalar types (int, float, string and bool) Better $onVarNotFound logic
| * Variable fixes (#67)Bruce Wells2020-09-161-0/+68
| | | | | | | | | | | | | | | | | | | | | | * Reproduce if throws UnknownOperatorException * Fix variable detection * Adding IncorrectNumberOfFunctionParametersException * Removing tabs * Better exception message text
* | Support for unary positive expressions (#85)Javier Marín2021-03-051-0/+11
| | | | | | * Support for unary positive operator
* | Unary Minus (#84)V2.1.7Bruce Wells2021-02-171-0/+20
| | | | | | Fixed unary minus to allow a minus sign in front of functions and parentheses.
* | Improve autoloading, asssertions and CI trigger (#79)V2.1.6Chun-Sheng, Li2021-01-061-1/+1
| |
* | Cache-control improvements (#81)Mirosław Sztorc2021-01-061-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cache-control improvements * Update src/NXP/MathExecutor.php yeah, you're right. Co-authored-by: Alexander Kiryukhin <a.kiryukhin@mail.ru> * Update MathExecutor.php braces qfix * Update MathExecutor.php Co-authored-by: Alexander Kiryukhin <a.kiryukhin@mail.ru>
* | Additional tests Hacktoberfest (#77)V2.1.5Bruce Wells2020-10-201-8/+30
| | | | | | | | | | * Additional tests Co-authored-by: diman3210 <diman-3210@mail.ru>
* | add new functions and aliases to the old functions (#76)diman32102020-10-201-0/+41
| | | | | | | | | | * add new functions and aliases to the old functions * add tests for new functions
* | Improved unit tests (#74)V2.1.4Bruce Wells2020-09-161-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Variable fixes (#67) * Reproduce if throws UnknownOperatorException * Fix variable detection * Adding IncorrectNumberOfFunctionParametersException * Removing tabs * Better exception message text * Handler for not found variables (#68) * Added handler to define not found variables Added support for string variables Fixed strings and ints comparison error * Check if variables have scalar types (int, float, string and bool) Better $onVarNotFound logic * Release prep (#69) * String comparison unit tests * getVars and getFunctions sanity checks * Add dynamic variable documentation * Better setVar error message (#70) Additional unit tests Readme update * Improved support for null variables (#72) * Added handler to define not found variables Added support for string variables Fixed strings and ints comparison error * Check if variables have scalar types (int, float, string and bool) Better $onVarNotFound logic * Better support for null variables * Better support for null variables * Better support for null variables * Allow null values in `setVar` method (#73) * Added handler to define not found variables Added support for string variables Fixed strings and ints comparison error * Check if variables have scalar types (int, float, string and bool) Better $onVarNotFound logic * Better support for null variables * Better support for null variables * Better support for null variables * Allow null values in `setVar` method * Better unit testing Co-authored-by: Javier Marín <javier@marinros.com>
* | Improved support for null variables (#72)V2.1.2Javier Marín2020-09-151-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added handler to define not found variables Added support for string variables Fixed strings and ints comparison error * Check if variables have scalar types (int, float, string and bool) Better $onVarNotFound logic * Better support for null variables * Better support for null variables * Better support for null variables
* | Better setVar error message (#70)V2.1.1Bruce Wells2020-07-271-4/+53
| | | | | | | | Additional unit tests Readme update
* | Release prep (#69)V2.1.0Bruce Wells2020-07-271-4/+35
| | | | | | | | | | | | | | * String comparison unit tests * getVars and getFunctions sanity checks * Add dynamic variable documentation
* | Handler for not found variables (#68)Javier Marín2020-07-261-0/+31
| | | | | | | | | | | | | | | | * Added handler to define not found variables Added support for string variables Fixed strings and ints comparison error * Check if variables have scalar types (int, float, string and bool) Better $onVarNotFound logic
* | Variable fixes (#67)V2.0.3Bruce Wells2020-06-041-0/+68
|/ | | | | | | | | | | * Reproduce if throws UnknownOperatorException * Fix variable detection * Adding IncorrectNumberOfFunctionParametersException * Removing tabs * Better exception message text
* Code style fixes & Github Actions (#65)V2.0.2Alexander Kiryukhin2020-06-012-13/+24
| | | | | | | | | | | | * Code style fixes Up phpunit to v8 New CI * Remove travis * Fix CI badge * Added php-cs-fixer action
* setDivisionByZeroIsZeroBruce Wells2020-05-201-7/+2
|
* Massive refactoringAlexander Kiryukhin2020-05-151-23/+36
| | | | | More clean structure Parsing without regular expressions
* Negative expression start (#60)V1.1.4Bruce Wells2020-04-211-1/+8
| | | | | * Update documentation for PHPFUI/InstaDoc * Support for negative numbers starting paren enclosed expressions
* PHP 7.4 support (#57)V1.1.3Bruce Wells2020-02-081-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Merge in neonxp master (#9) * Version 1.1 (#51) * Update README.md and more function support * Removing phpunit symbolic link (#53) * Left bracket and minus fix (#55) * Left bracket and minus fix (#54) * Add test for left bracket and minus fix #55 * Fix substraction by zero bug (#56) Co-authored-by: franksl <info@streamlake.com> Co-authored-by: Clément Lafont <johnrazeur@gmail.com> * Docs and test updates * Update composer Co-authored-by: franksl <info@streamlake.com> Co-authored-by: Clément Lafont <johnrazeur@gmail.com>
* Merge branch 'master' into masterBruce Wells2020-02-071-3/+3
|\
| * PHP 7.4 supportBruce Wells2019-12-011-3/+3
| |
| * Update README.md and more function supportBruce Wells2019-11-271-1/+37
| |
* | Fix substraction by zero bug (#56)Clément Lafont2020-02-071-0/+7
| |
* | Left bracket and minus fix (#55)V1.1.2Clément Lafont2020-01-131-0/+7
| | | | | | | | | | | | * Left bracket and minus fix (#54) * Add test for left bracket and minus fix #55
* | Version 1.1 (#51)V1.1.0Bruce Wells2019-11-271-1/+37
|/ | | | * Update README.md and more function support
* Logicandcompare (#50)franksl2019-11-261-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * TokenFactory: allowing multicharacter tokens * Added logical and compare operators: <, <=, >, >=, ==, !=, ||, && * Fixed operator priorities * Error messages fixes * Fixed operators priority The priorities are assigned by following the php language standard (https://www.php.net/manual/en/language.operators.precedence.php) I've assigned precedence in steps of 10 units by following the linked page: 230 clone new 220 ** 210 ++ -- ~ (int) (float) (string) (array) (object) (bool) @ 200 instanceof 190 ! 180 * / % 170 + - . 160 << >> 150 < <= > >= 140 == != === !== <> <=> 130 & 120 ^ 110 | 100 && 90 || 80 ?? 70 ? : 60 = += -= *= **= /= .= %= &= |= ^= <<= >>= 50 yield from 40 yield 30 and 20 xor 10 or * Added if() function * Cache key fix There are cases where the cache key creation raised an error, for example while evaluating the expression "if(cos(2), cos(2), 0)", because the if() function was passing a float to the MathExecutor:execute() method.
* Upgrading to PHP 7.1 (#48)V1.0.0Bruce Wells2019-10-311-1/+1
| | | | | | | | | | | | | | | | * Subtraction fix (#46) (#7) * Updated unit tests * Fixed docs * Better unary minus support * Subtraction fix (#46) (#8) * Updated unit tests * Fixed docs * Better unary minus support * Upgrading PHPUnit and dropping support for 5.6 and 7.0
* Subtraction fix (#46)v0.8.0Bruce Wells2019-08-161-1/+22
| | | | | * Updated unit tests * Fixed docs * Better unary minus support
* Fixed merge errorBruce Wells2019-01-161-14/+1
|
* Merge branch 'master' into masterBruce Wells2019-01-161-0/+9
|\
| * Fixed function parameter order (#42)v0.7.1Bruce Wells2019-01-121-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fixed parsing for () * sync (#5) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Added simple coc (#37) * Added simple coc * Fix * Replaceable operators (#38) * Updated from NeonXP/MathExecutor * Fixed function in () block issue * Fixing typos in and clarifying documentation. * Syncing from origin (#3) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Allow for operators to be replaced based on regex expression * Fix md typo (#39) * Updated from NeonXP/MathExecutor * Fixed function in () block issue * Fixing typos in and clarifying documentation. * Syncing from origin (#3) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Syncing to origin (#4) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Added simple coc (#37) * Added simple coc * Fix * Replaceable operators (#38) * Updated from NeonXP/MathExecutor * Fixed function in () block issue * Fixing typos in and clarifying documentation. * Syncing from origin (#3) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Allow for operators to be replaced based on regex expression * \\ instead of \ * Update README.md Some small fixes * Fix single quotes parsing (#41) * Fix single quotes parsing Fix e-mails Some small fixes * Mistake in test * More PHP versions * Update README.md Deleted `dev` branch * Fixed function parameter order Corrected $places default value for addFunction to match TokenFactory Added function order test and put expected order first in assertEquals If else blocks in calculator Updated docs
* | Fixed comma operatorBruce Wells2019-01-161-16/+32
| | | | | | | | | | Added unit tests for expressions in function arguments. Changed array_push to $var[] = native code.
* | Fixed function parameter orderBruce Wells2019-01-161-8/+12
| | | | | | | | | | | | | | Corrected $places default value for addFunction to match TokenFactory Added function order test and put expected order first in assertEquals If else blocks in calculator Updated docs
* | Merge branch 'master' into masterBruce Wells2019-01-121-3/+2
|\|
| * Fix single quotes parsing (#41)Alexander Kiryukhin2019-01-111-2/+16
| | | | | | | | | | | | | | | | | | | | * Fix single quotes parsing Fix e-mails Some small fixes * Mistake in test * More PHP versions
| * Fixed Lexor to correctly generate reverse polish notation (#33)v0.6Bruce Wells2018-11-261-0/+14
| | | | | | | | | | | | * Updated from NeonXP/MathExecutor * Fixed function in () block issue
* | Fixed function parameter orderBruce Wells2019-01-121-8/+15
| | | | | | | | | | | | | | Corrected $places default value for addFunction to match TokenFactory Added function order test and put expected order first in assertEquals If else blocks in calculator Updated docs
* | sync (#5)Bruce Wells2019-01-111-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Added simple coc (#37) * Added simple coc * Fix * Replaceable operators (#38) * Updated from NeonXP/MathExecutor * Fixed function in () block issue * Fixing typos in and clarifying documentation. * Syncing from origin (#3) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Allow for operators to be replaced based on regex expression * Fix md typo (#39) * Updated from NeonXP/MathExecutor * Fixed function in () block issue * Fixing typos in and clarifying documentation. * Syncing from origin (#3) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Syncing to origin (#4) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Added simple coc (#37) * Added simple coc * Fix * Replaceable operators (#38) * Updated from NeonXP/MathExecutor * Fixed function in () block issue * Fixing typos in and clarifying documentation. * Syncing from origin (#3) * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36) * Allow for operators to be replaced based on regex expression * \\ instead of \ * Update README.md Some small fixes * Fix single quotes parsing (#41) * Fix single quotes parsing Fix e-mails Some small fixes * Mistake in test * More PHP versions * Update README.md Deleted `dev` branch
* | Fixed function in () block issueBruce Wells2018-11-261-0/+14
|/