PageRenderTime 55ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/exprlib/src/exprlib/contexts/scope/Exp.php

https://bitbucket.org/furyfire/jabberbot
PHP | 18 lines | 14 code | 4 blank | 0 comment | 1 complexity | 93213fb39b087a12574ea58c165cf300 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. namespace exprlib\contexts\scope;
  3. use exprlib\contexts\Scope;
  4. use exprlib\exceptions\ParsingException;
  5. class Exp extends Scope
  6. {
  7. public function evaluate()
  8. {
  9. if (is_array($result = parent::evaluate())) {
  10. throw new ParsingException('exp accept only one argument');
  11. }
  12. return (float) exp($result);
  13. }
  14. }