aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/MathExecutor.php
Commit message (Collapse)AuthorAgeFilesLines
* Handler for not found variables (#68)Javier Marín2020-07-261-10/+38
| | | | | | | | * 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
* Code style fixes & Github Actions (#65)V2.0.2Alexander Kiryukhin2020-06-011-4/+5
| | | | | | | | | | | | * 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-201-2/+2
|\
| * WIP: New generation (#62)Alexander Kiryukhin2020-05-201-218/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-201-9/+9
| |
* | 7.1 downgradeAlexander Kiryukhin2020-05-151-2/+0
| |
* | Massive refactoringAlexander Kiryukhin2020-05-151-217/+169
|/ | | | | More clean structure Parsing without regular expressions
* Update documentation for PHPFUI/InstaDoc (#58)Bruce Wells2020-04-111-14/+30
|
* PHP 7.4 supportBruce Wells2019-12-011-2/+2
|
* Update README.md and more function supportBruce Wells2019-11-271-15/+108
|
* Logicandcompare (#50)franksl2019-11-261-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Fixed function parameter order (#42)v0.7.1Bruce Wells2019-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Merge branch 'master' into masterBruce Wells2019-01-111-1/+1
|\
| * Syncing from origin (#3)Bruce Wells2019-01-101-29/+70
| | | | | | | | | | | | | | | | * Documentation fixes (#34) Fixing typos in and clarifying documentation. * MathExecutor allow override default operators, functions and vars (#36)
* | Fix single quotes parsing (#41)Alexander Kiryukhin2019-01-111-12/+15
| | | | | | | | | | | | | | | | | | | | * Fix single quotes parsing Fix e-mails Some small fixes * Mistake in test * More PHP versions
* | MathExecutor allow override default operators, functions and vars (#36)Timur2019-01-101-29/+70
|/
* Division By Zero Exception supportBruce Wells2018-10-311-0/+23
| | | | | | Updated the documentation. Unit tests for strings. DivisionByZeroException support.
* Merge branch 'master' into support_for_double_quoted_stringsBruce Wells2018-09-121-1/+5
|\
| * Merge branch 'master' into devAlexander Kiryukhin2018-09-061-0/+21
| |\
| | * Merge branch 'master' into getters_for_function_and_operatorsAlexander Kiryukhin2018-09-061-4/+0
| | |\
| | * | Add ability to get functions and operators that have been registeredBruce Wells2018-08-311-0/+21
| | | |
| * | | Added variable type to diagnostic messageBruce Wells2018-09-061-1/+1
| | | |
| * | | Exception MessagesBruce Wells2018-08-281-1/+1
| |/ / | | | | | | | | | Basically the token that is causing the exception for better diagnostics.
| * | ~ remove callable for PHP 5.3NeonXP2013-09-181-1/+1
| | |
* | | Support for double quoted stringsBruce Wells2018-09-121-6/+53
| |/ |/| | | | | | | | | | | | | Changed array() to [] syntax. Added variable in question to unknown variable exception. Added getVar and getVars accessor functions. Added getOperators and getFunctions accessor functions for completeness. Extended all Exceptions off MathExecutorException.
* | Removing the numeric test on setVar.charles VILLETTE2016-07-071-4/+0
|/
* + Added cache, which speeds up the repetitive calculationsNeonXP2013-09-061-5/+88
| | | | + Returned variables, because they need for cached expressions
* ~ PHP CS fixerNeonXP2013-09-061-3/+3
|
* Mass refactoringNeonXP2013-09-061-316/+35
| | | | | | | | | | | Some changes: + Added support of functions with multiple arguments + Added some default function (min, max, avg). just example of multiple arguments :) - Removed variables support (I think they pointless) ~ All tokens now in individual classes ~ Parsing based on regular expressions ~ Fix negative numbers ~ Fix grouping with brackets
* Fix to PSR standart, fix tokenizer, fix function executor.zhukv2013-08-031-0/+393