added simple math and charts modules

This commit is contained in:
2024-12-10 23:53:23 +01:00
parent 62a5f3c97c
commit 688ff42752
196 changed files with 20285 additions and 8 deletions

View File

@@ -0,0 +1,21 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
use Exception;
class AbstractEvalMathException extends Exception implements EvalMathException
{
protected $error = '';
public function __construct(array $parameters=[])
{
$message = strtr($this->error, $parameters);
parent::__construct($message);
}
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class BuiltInFunctionRedefinitionException extends AbstractEvalMathException
{
protected $message = 'Cannot redefine built-in function :function()';
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class ConstantAssignmentException extends AbstractEvalMathException
{
protected $message = 'Cannot assign to constant :constant';
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class DivisionByZeroException extends AbstractEvalMathException
{
protected $message = 'Division by zero';
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
interface EvalMathException
{
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class ExpectingTokenException extends AbstractEvalMathException
{
protected $message = "Expecting ':token'";
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class IllegalCharacterException extends AbstractEvalMathException
{
protected $message = "illegal character ':character'";
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class InternalErrorException extends AbstractEvalMathException
{
protected $message = 'Internal error';
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class InvalidArgumentCountException extends AbstractEvalMathException
{
protected $message = 'Wrong number of arguments';
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class OperatorLacksOperandException extends AbstractEvalMathException
{
protected $message = "operator ':operator' lacks operand";
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class OperatorRequiredException extends AbstractEvalMathException
{
protected $message = 'Operator required';
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class UndefinedVariableException extends AbstractEvalMathException
{
protected $message = "Undefined variable";
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class UndefinedVariableInFunctionDefinitionException extends AbstractEvalMathException
{
protected $message = 'Undefined variable :token in function definition';
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class UnexpectedOperatorException extends AbstractEvalMathException
{
protected $message = 'Unexpected operator \':operator\'';
}

View File

@@ -0,0 +1,14 @@
<?php
/**
* @author Serge Rodovnichenko <serge@syrnik.com>
* @copyright Serge Rodovnichenko, 2019
* @license BSD 2.0
*/
namespace Andileco\Util\EvalMath\Exception;
class UnexpectedTokenException extends AbstractEvalMathException
{
protected $message = 'Unexpected \':token\'';
}