Total Complexity | 3 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | class ThirdPartyConnectionCollection |
||
17 | { |
||
18 | /** |
||
19 | * VendorConnection[] list of configured vendor connections |
||
20 | */ |
||
21 | private $vendorConnections; |
||
22 | |||
23 | /** |
||
24 | * Adds a configured vendor connection into the known list of connections. |
||
25 | * |
||
26 | * @param string $vendorName the third party vendor name. ex: google, facebook, linkedin etc |
||
27 | * @param VendorConnection $vendorConnection |
||
28 | */ |
||
29 | 2 | public function add($vendorName, VendorConnection $vendorConnection) |
|
30 | { |
||
31 | 2 | $this->vendorConnections[$vendorName] = $vendorConnection; |
|
32 | 2 | } |
|
33 | |||
34 | /** |
||
35 | * Returns a requested vendor connection if available or throws an exception. |
||
36 | * |
||
37 | * @param string $vendorName the third party vendor name. ex: google, facebook, linkedin etc |
||
38 | * @return VendorConnection |
||
39 | * @throws UnknownVendorRequestException |
||
40 | */ |
||
41 | 2 | public function getByVendor($vendorName) |
|
48 | } |
||
49 | } |
||
50 |