| Conditions | 5 |
| Paths | 6 |
| Total Lines | 25 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5.0909 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | 2 | public function E($aXMin, $aXMax, $aSteps = 50) |
|
| 38 | { |
||
| 39 | 2 | $this->iMin = $aXMin; |
|
| 40 | 2 | $this->iMax = $aXMax; |
|
| 41 | 2 | $this->iStepSize = ($aXMax - $aXMin) / $aSteps; |
|
| 42 | |||
| 43 | 2 | if ($this->iXFunc != '') { |
|
| 44 | 1 | $t = 'for($i=' . $aXMin . '; $i<=' . $aXMax . '; $i += ' . $this->iStepSize . ') {$ya[]=' . $this->iFunc . ';$xa[]=' . $this->iXFunc . ';}'; |
|
| 45 | 2 | } elseif ($this->iFunc != '') { |
|
| 46 | 2 | $t = 'for($x=' . $aXMin . '; $x<=' . $aXMax . '; $x += ' . $this->iStepSize . ') {$ya[]=' . $this->iFunc . ';$xa[]=$x;} $x=' . $aXMax . ';$ya[]=' . $this->iFunc . ';$xa[]=$x;'; |
|
| 47 | } else { |
||
| 48 | JpGraphError::RaiseL(24001); |
||
| 49 | } |
||
| 50 | //('FuncGenerator : No function specified. '); |
||
| 51 | |||
| 52 | 2 | @eval($t); |
|
| 53 | |||
| 54 | // If there is an error in the function specifcation this is the only |
||
| 55 | // way we can discover that. |
||
| 56 | 2 | if (empty($xa) || empty($ya)) { |
|
| 57 | JpGraphError::RaiseL(24002); |
||
| 58 | } |
||
| 59 | //('FuncGenerator : Syntax error in function specification '); |
||
| 60 | |||
| 61 | 2 | return [$xa, $ya]; |
|
| 62 | } |
||
| 64 |