diff --git a/backend/lib/View/JpGraph.php b/backend/lib/View/JpGraph.php index 51cfda5..7b39a5e 100644 --- a/backend/lib/View/JpGraph.php +++ b/backend/lib/View/JpGraph.php @@ -61,7 +61,7 @@ class JpGraph extends View { * @param HTTP\Response $response * @param string $format one of png, jpeg, gif */ - public function __construct(HTTP\Request $request, HTTP\Response $response, $format) { + public function __construct(HTTP\Request $request, HTTP\Response $response, $format = 'png') { parent::__construct($request, $response); $this->graph = new \Graph($this->width,$this->height); diff --git a/backend/lib/View/View.php b/backend/lib/View/View.php index 21e6da4..4cd2d32 100644 --- a/backend/lib/View/View.php +++ b/backend/lib/View/View.php @@ -47,11 +47,29 @@ interface ViewInterface { * */ abstract class View implements ViewInterface { + /** + * @var integer round all values to x decimals + */ const PRECISSION = 5; + /** + * @var HTTP\Request + * @todo do we need this? + * @todo why public? not via getter? + */ public $request; + + /** + * @var HTTP\Response + */ protected $response; + /** + * Constructor + * + * @param HTTP\Request $request + * @param HTTP\Response $response + */ public function __construct(HTTP\Request $request, HTTP\Response $response) { $this->request = $request; $this->response = $response; @@ -69,7 +87,7 @@ abstract class View implements ViewInterface { } final public function exceptionHandler(\Exception $exception) { - $this->addException($exception); + $this->addException($exception, Util\Debug::isActivated()); $code = ($exception->getCode() == 0 && HTTP\Response::getCodeDescription($exception->getCode())) ? 400 : $exception->getCode(); $this->response->setCode($code);