| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Also array function is defined which return arguments as array. Square bracket arrays are also supported. (#108)
valid expression -> "max([1,2,3])"
valid expression -> "max(array(1,2,3))"
valid expression -> "max($ages_arr)"
valid expression -> "max(ages_arr())"
|
|
|
|
|
|
|
| |
(handwritten arrays not supported yet, can be used for array variables or functions returning an array) (#107)
invalid expression -> "max([1,2,3])"
valid expression -> "max($ages_arr)"
valid expression -> "max(ages_arr())"
|
|
|
|
|
|
|
|
|
| |
* Support unlimited args for min, max default funcs.
Default functions max and min were requiring 2 arguments strictly. Now they supoort unlimited args, same as php's min, max funcs.
* Improved functions: support unlimited parameters (see min, max funcs), optional parameters (see round func), parameters with types (see round func, throws IncorrectFunctionParameterException on unmatched type, union types and intersection types not supported because of min php level! there is a todo for this, to support them later @see CustomFunction@execute) Also added unittests for improvements.
* Run php-cs-fixer fix
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* test: add testNullReturnType and testUnsupportedOperands
* refactor: fix PhpDoc comments and use PHP 7.4 arrow functions
* refactor: fix PHP-CS-Fixer issues
* test: run testUnsupportedOperands() only on PHP8+
Co-authored-by: Javier Marín <contacto@ideatic.net>
|
|
|
|
|
|
|
| |
* Configuring PHP CS Fixer
Dropping PHP 7,3 support
* Fixing merge issue
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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 operator
|
|
|
| |
Fixed unary minus to allow a minus sign in front of functions and parentheses.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
* add tests for new functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
Additional unit tests
Readme update
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
| |
* Reproduce if throws UnknownOperatorException
* Fix variable detection
* Adding IncorrectNumberOfFunctionParametersException
* Removing tabs
* Better exception message text
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Code style fixes
Up phpunit to v8
New CI
* Remove travis
* Fix CI badge
* Added php-cs-fixer action
|
|
|
|
|
| |
* $variables should be private
* Add Packagist tag
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Massive refactoring
More clean structure
Parsing without regular expressions
* Cleanup unused imports
* Fix version string for Travis
* 7.1 downgrade
* Fix readme
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
More clean structure
Parsing without regular expressions
|
|
|
|
|
| |
* Update documentation for PHPFUI/InstaDoc
* Support for negative numbers starting paren enclosed expressions
|
| |
|
|\ |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
* Left bracket and minus fix (#54)
* Add test for left bracket and minus fix #55
|
|/
|
|
| |
* Update README.md and more function support
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* Updated unit tests
* Fixed docs
* Better unary minus support
|
| |
|
|
|
|
|
| |
Added unit tests for expressions in function arguments.
Changed array_push to $var[] = native code.
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
| |
* Documentation fixes (#34)
Fixing typos in and clarifying documentation.
* MathExecutor allow override default operators, functions and vars (#36)
|
| |
|
|
|
|
|
|
| |
Updated the documentation.
Unit tests for strings.
DivisionByZeroException support.
|
|
|
|
| |
Added more unit tests.
|