| Total Complexity | 4 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class TransactionFactory |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | private $publicKey; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var Identity |
||
| 28 | */ |
||
| 29 | private $identity; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var Encryption |
||
| 33 | */ |
||
| 34 | private $encryption; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param int $publicKey |
||
| 38 | * @param Identity $identity |
||
| 39 | * @param Encryption $encryption |
||
| 40 | */ |
||
| 41 | public function __construct($publicKey, Identity $identity, Encryption $encryption) |
||
| 42 | { |
||
| 43 | $this->publicKey = $publicKey; |
||
| 44 | $this->identity = $identity; |
||
| 45 | $this->encryption = $encryption; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param Request |
||
| 50 | * |
||
| 51 | * @return Transaction |
||
| 52 | */ |
||
| 53 | public function create(Request $request) |
||
| 54 | { |
||
| 55 | return new Transaction($this->identity, $this->encryption, $request); |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return integer |
||
| 60 | */ |
||
| 61 | public function getPublicKey() |
||
| 62 | { |
||
| 63 | return $this->publicKey; |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @return Identity |
||
| 68 | */ |
||
| 69 | public function getIdentity() |
||
| 72 | } |
||
| 73 | } |
||
| 74 |