Fix phpcs
This commit is contained in:
parent
33c5db9cc3
commit
d90bf25351
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ================================================================================
|
* ================================================================================
|
||||||
*
|
*
|
||||||
@ -129,11 +128,10 @@ class EvalMath
|
|||||||
/**
|
/**
|
||||||
* Evaluate
|
* Evaluate
|
||||||
*
|
*
|
||||||
* @param string $expr
|
* @param string $expr String
|
||||||
* String
|
|
||||||
* @return boolean|number|NULL|mixed Result
|
* @return boolean|number|NULL|mixed Result
|
||||||
*/
|
*/
|
||||||
function e($expr)
|
public function e($expr)
|
||||||
{
|
{
|
||||||
return $this->evaluate($expr);
|
return $this->evaluate($expr);
|
||||||
}
|
}
|
||||||
@ -141,11 +139,10 @@ class EvalMath
|
|||||||
/**
|
/**
|
||||||
* Evaluate
|
* Evaluate
|
||||||
*
|
*
|
||||||
* @param string $expr
|
* @param string $expr String
|
||||||
* String
|
|
||||||
* @return boolean|number|NULL|mixed Result
|
* @return boolean|number|NULL|mixed Result
|
||||||
*/
|
*/
|
||||||
function evaluate($expr)
|
public function evaluate($expr)
|
||||||
{
|
{
|
||||||
$this->last_error = null;
|
$this->last_error = null;
|
||||||
$this->last_error_code = null;
|
$this->last_error_code = null;
|
||||||
@ -197,7 +194,7 @@ class EvalMath
|
|||||||
*
|
*
|
||||||
* @return string Output
|
* @return string Output
|
||||||
*/
|
*/
|
||||||
function vars()
|
private function vars()
|
||||||
{
|
{
|
||||||
$output = $this->v;
|
$output = $this->v;
|
||||||
unset($output['pi']);
|
unset($output['pi']);
|
||||||
@ -210,7 +207,7 @@ class EvalMath
|
|||||||
*
|
*
|
||||||
* @return string Output
|
* @return string Output
|
||||||
*/
|
*/
|
||||||
function funcs()
|
private function funcs()
|
||||||
{
|
{
|
||||||
$output = array();
|
$output = array();
|
||||||
foreach ($this->f as $fnn => $dat)
|
foreach ($this->f as $fnn => $dat)
|
||||||
@ -227,7 +224,7 @@ class EvalMath
|
|||||||
* Expression
|
* Expression
|
||||||
* @return string Output
|
* @return string Output
|
||||||
*/
|
*/
|
||||||
function nfx($expr)
|
private function nfx($expr)
|
||||||
{
|
{
|
||||||
$index = 0;
|
$index = 0;
|
||||||
$stack = new EvalMathStack();
|
$stack = new EvalMathStack();
|
||||||
@ -362,13 +359,11 @@ class EvalMath
|
|||||||
/**
|
/**
|
||||||
* evaluate postfix notation
|
* evaluate postfix notation
|
||||||
*
|
*
|
||||||
* @param string $tokens
|
* @param string $tokens Expression
|
||||||
* Expression
|
* @param array $vars Array
|
||||||
* @param array $vars
|
* @return string Output
|
||||||
* Array
|
|
||||||
* @return string Output
|
|
||||||
*/
|
*/
|
||||||
function pfx($tokens, $vars = array())
|
private function pfx($tokens, $vars = array())
|
||||||
{
|
{
|
||||||
if ($tokens == false)
|
if ($tokens == false)
|
||||||
return false;
|
return false;
|
||||||
@ -446,13 +441,10 @@ class EvalMath
|
|||||||
/**
|
/**
|
||||||
* trigger an error, but nicely, if need be
|
* trigger an error, but nicely, if need be
|
||||||
*
|
*
|
||||||
* @param string $code
|
* @param string $code Code
|
||||||
* Code
|
* @param string $msg Msg
|
||||||
* @param string $msg
|
* @param string|null $info String
|
||||||
* Msg
|
* @return boolean False
|
||||||
* @param string|null $info
|
|
||||||
* sting
|
|
||||||
* @return boolean False
|
|
||||||
*/
|
*/
|
||||||
function trigger($code, $msg, $info = null)
|
function trigger($code, $msg, $info = null)
|
||||||
{
|
{
|
||||||
@ -477,11 +469,10 @@ class EvalMathStack
|
|||||||
/**
|
/**
|
||||||
* push
|
* push
|
||||||
*
|
*
|
||||||
* @param string $val
|
* @param string $val Val
|
||||||
* Val
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function push($val)
|
public function push($val)
|
||||||
{
|
{
|
||||||
$this->stack[$this->count] = $val;
|
$this->stack[$this->count] = $val;
|
||||||
$this->count ++;
|
$this->count ++;
|
||||||
@ -492,7 +483,7 @@ class EvalMathStack
|
|||||||
*
|
*
|
||||||
* @return mixed Stack
|
* @return mixed Stack
|
||||||
*/
|
*/
|
||||||
function pop()
|
public function pop()
|
||||||
{
|
{
|
||||||
if ($this->count > 0) {
|
if ($this->count > 0) {
|
||||||
$this->count --;
|
$this->count --;
|
||||||
@ -504,11 +495,10 @@ class EvalMathStack
|
|||||||
/**
|
/**
|
||||||
* last
|
* last
|
||||||
*
|
*
|
||||||
* @param int $n
|
* @param int $n N
|
||||||
* N
|
* @return mixed Stack
|
||||||
* @return mixed Stack
|
|
||||||
*/
|
*/
|
||||||
function last($n = 1)
|
public function last($n = 1)
|
||||||
{
|
{
|
||||||
if (isset($this->stack[$this->count - $n])) {
|
if (isset($this->stack[$this->count - $n])) {
|
||||||
return $this->stack[$this->count - $n];
|
return $this->stack[$this->count - $n];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user