aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Add a custom variable validator + protected props (#98)Matthijs Meulenbrug2022-04-251-10/+46
|
* Adding varExists method and support for undefined var handler in getVar (#96)V2.1.112.0.4Bruce Wells2022-03-215-31/+41
| | | | | | | | | | | | | | | * 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-1/+1
|
* PhpStan support, consts visibilty and name for tokens (#89)Javier Marín2021-07-145-35/+48
| | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Support for unary positive expressions (#85)Javier Marín2021-03-052-23/+30
| | | * Support for unary positive operator
* Unary Minus (#84)V2.1.7Bruce Wells2021-02-172-31/+46
| | | Fixed unary minus to allow a minus sign in front of functions and parentheses.
* Cache-control improvements (#81)Mirosław Sztorc2021-01-061-5/+26
| | | | | | | | | | | | | | | | | * 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>
* add new functions and aliases to the old functions (#76)diman32102020-10-201-1/+64
| | | | | * add new functions and aliases to the old functions * add tests for new functions
* Allow null values in `setVar` method (#73)V2.1.3Javier Marín2020-09-161-1/+1
| | | | | | | | | | | | | | | | * 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
* Improved support for null variables (#72)V2.1.2Javier Marín2020-09-152-4/+2
| | | | | | | | | | | | | | * 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-1/+2
| | | | Additional unit tests Readme update
* Handler for not found variables (#68)Javier Marín2020-07-263-14/+50
| | | | | | | | * 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-045-11/+29
| | | | | | | | | | | * 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-015-13/+10
| | | | | | | | | | | | * Code style fixes Up phpunit to v8 New CI * Remove travis * Fix CI badge * Added php-cs-fixer action
* Packagist tag (#64)V2.0.1Bruce Wells2020-05-211-1/+1
| | | | | * $variables should be private * Add Packagist tag
* Merge branch 'master' into neonxp-ngBruce Wells2020-05-202-3/+3
|\
| * WIP: New generation (#62)Alexander Kiryukhin2020-05-2035-1810/+682
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Massive refactoring More clean structure Parsing without regular expressions * Cleanup unused imports * Fix version string for Travis * 7.1 downgrade * Fix readme
* | Null parameters allowedBruce Wells2020-05-201-1/+1
| |
* | Adding setVars back inBruce Wells2020-05-201-0/+19
| |
* | setDivisionByZeroIsZeroBruce Wells2020-05-201-0/+16
| |
* | Private membersBruce Wells2020-05-201-4/+90
| |
* | typed parameters and return typesBruce Wells2020-05-205-23/+23
| |
* | 7.1 downgradeAlexander Kiryukhin2020-05-152-15/+2
| |
* | Cleanup unused importsAlexander Kiryukhin2020-05-151-6/+0
| |
* | Massive refactoringAlexander Kiryukhin2020-05-1535-1804/+695
|/ | | | | More clean structure Parsing without regular expressions
* Negative expression start (#60)V1.1.4Bruce Wells2020-04-211-2/+2
| | | | | * Update documentation for PHPFUI/InstaDoc * Support for negative numbers starting paren enclosed expressions
* Update documentation for PHPFUI/InstaDoc (#58)Bruce Wells2020-04-115-17/+43
|
* Merge branch 'master' into masterBruce Wells2020-02-071-2/+2
|\
| * PHP 7.4 supportBruce Wells2019-12-011-2/+2
| |
| * Update README.md and more function supportBruce Wells2019-11-272-16/+109
| |
* | Fix substraction by zero bug (#56)Clément Lafont2020-02-071-2/+14
| |
* | Left bracket and minus fix (#55)V1.1.2Clément Lafont2020-01-131-2/+6
| | | | | | | | | | | | * Left bracket and minus fix (#54) * Add test for left bracket and minus fix #55
* | Version 1.1 (#51)V1.1.0Bruce Wells2019-11-272-16/+109
|/ | | | * Update README.md and more function support
* Logicandcompare (#50)franksl2019-11-2615-13/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Subtraction fix (#46)v0.8.0Bruce Wells2019-08-161-2/+18
| | | | | * Updated unit tests * Fixed docs * Better unary minus support
* Fixed typo in constantBruce Wells2019-01-161-1/+1
|
* Fixed comma operatorBruce Wells2019-01-164-14/+42
| | | | | Added unit tests for expressions in function arguments. Changed array_push to $var[] = native code.
* Fixed function parameter orderBruce Wells2019-01-123-11/+7
| | | | | | | 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-1124-175/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Syncing to origin (#4)Bruce Wells2019-01-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Syncing from origin (#3)Bruce Wells2019-01-102-32/+78
| | | | | | | | * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36)
* Fixed function in () block issueBruce Wells2018-11-261-130/+133
|
* Division By Zero Exception supportBruce Wells2018-10-314-1/+89
| | | | | | Updated the documentation. Unit tests for strings. DivisionByZeroException support.
* Removing DivisionByZeroException testing for nowBruce Wells2018-10-251-4/+0
| | | | Added more unit tests.
* Additional validation for bad expressions (*+ for example)Bruce Wells2018-10-247-1/+76
|
* Fixed merge errorBruce Wells2018-09-121-13/+0
|
* Merge branch 'master' into support_for_double_quoted_stringsBruce Wells2018-09-122-1/+17
|\
| * Merge branch 'master' into devAlexander Kiryukhin2018-09-065-5/+48
| |\
| | * Merge branch 'master' into getters_for_function_and_operatorsAlexander Kiryukhin2018-09-064-9/+5
| | |\
| | * | Add ability to get functions and operators that have been registeredBruce Wells2018-08-312-0/+43
| | | |