Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
83.33% |
5 / 6 |
CRAP | |
92.31% |
12 / 13 |
APIRequest | |
0.00% |
0 / 1 |
|
83.33% |
5 / 6 |
7.02 | |
92.31% |
12 / 13 |
__construct($controller, $action, $args) | |
100.00% |
1 / 1 |
1 | |
100.00% |
4 / 4 |
|||
setController($controller) | |
100.00% |
1 / 1 |
2 | |
100.00% |
5 / 5 |
|||
getController() | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
getAction() | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
getArgs() | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
jsonSerialize() | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
<?php | |
/** | |
* | |
*/ | |
namespace aae\api { | |
/** | |
* @author Axel Ancona Esselmann | |
* @package aae\api | |
*/ | |
class APIRequest implements \JsonSerializable { | |
protected $_controller; | |
protected $_action; | |
protected $_args; | |
public function __construct($controller, $action, $args) { | |
$this->setController($controller); | |
$this->_action = $action; | |
$this->_args = $args; | |
} | |
public function setController($controller) { | |
$this->_controller = str_replace("/", "\\", $controller); | |
if (substr($this->_controller, 0,1) != "\\") { | |
$this->_controller = "\\".$this->_controller; | |
} | |
} | |
public function getController() { | |
return $this->_controller; | |
} | |
public function getAction() { | |
return $this->_action; | |
} | |
public function getArgs() { | |
return $this->_args; | |
} | |
public function jsonSerialize() { | |
return array("controller" => $this->_controller, "action" => $this->_action, "args" => $this->_args); | |
} | |
} | |
} |