Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 2 |
|
25.00% |
1 / 4 |
CRAP | |
15.38% |
2 / 13 |
DirectAPICallTransmitter | |
0.00% |
0 / 1 |
|
66.67% |
2 / 3 |
7.61 | |
20.00% |
2 / 10 |
__construct($apiClassName) | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
transmit($message, $id = null) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 8 |
|||
request() | |
100.00% |
1 / 1 |
1 | ||||||
DirectAPICallTransmissionHelper | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 3 |
transmit($message, $id = null) | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 2 |
|||
request() | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
<?php | |
/** | |
* | |
*/ | |
namespace aae\api { | |
/** | |
* @author Axel Ancona Esselmann | |
* @package aae\api | |
*/ | |
class DirectAPICallTransmitter implements \aae\api\TransmissionServiceInterface { | |
use \aae\log\LoggableTrait; | |
private $_apiClassName; | |
public function __construct($apiClassName) { | |
$this->_apiClassName = $apiClassName; | |
} | |
public function transmit($message, $id = null) { | |
$factory = new \aae\std\SimpleFactory(); | |
$transmissionHelper = new \aae\api\DirectAPICallTransmissionHelper(); | |
$transmissionHelper->transmit($message); | |
$apiInstance = $factory->build( | |
$this->_apiClassName, | |
$transmissionHelper, | |
$this->_logger); | |
return $transmissionHelper->request(); | |
} | |
public function request(){} | |
} | |
class DirectAPICallTransmissionHelper implements \aae\api\TransmissionServiceInterface { | |
private $_result; | |
public function transmit($message, $id = null) { | |
$this->_result = $message; | |
return $this->_result; | |
} | |
public function request() { | |
return $this->_result; | |
} | |
} | |
} |