Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
30.00% |
3 / 10 |
CRAP | |
44.44% |
12 / 27 |
| ControllerActionArgs | |
0.00% |
0 / 1 |
|
30.00% |
3 / 10 |
41.98 | |
44.44% |
12 / 27 |
| __construct($controller, $action, $args, $ip = NULL) | |
100.00% |
1 / 1 |
1 | |
100.00% |
4 / 4 |
|||
| setController($controller) | |
100.00% |
1 / 1 |
2 | |
100.00% |
6 / 6 |
|||
| getController() | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| getAction() | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| getArgs() | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setIp($ip) | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getIp() | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| setPublicKey($publicKey) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
| getPublicKey() | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| jsonSerialize() | |
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 8 |
|||
| <?php | |
| /** | |
| * | |
| */ | |
| namespace aae\dispatch\callProtocol { | |
| /** | |
| * @author Axel Ancona Esselmann | |
| * @package aae\dispatch\callProtocol | |
| */ | |
| class ControllerActionArgs implements \aae\dispatch\callProtocol\CallInterface, \JsonSerializable { | |
| protected $_controller, $_action, $_args, $_ip = null, $_publicKey = null; | |
| public function __construct($controller, $action, $args, $ip = NULL) { | |
| $this->setController($controller); | |
| $this->_action = $action; | |
| $this->_args = $args; | |
| } | |
| public function setController($controller) { | |
| $controller = ucfirst($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 setIp($ip) { | |
| $this->_ip = $ip; | |
| } | |
| public function getIp() { | |
| return $this->_ip; | |
| } | |
| public function setPublicKey($publicKey) { | |
| $this->_publicKey = $publicKey; | |
| } | |
| public function getPublicKey() { | |
| return $this->_publicKey; | |
| } | |
| public function jsonSerialize() { | |
| $array = array("controller" => $this->_controller, "action" => $this->_action, "args" => $this->_args); | |
| if (!is_null($this->_ip)) { | |
| $array["ip"] = $this->_ip; | |
| } | |
| if (!is_null($this->_publicKey)) { | |
| $array["publicKey"] = $this->_publicKey; | |
| } | |
| return $array; | |
| } | |
| } | |
| } |